Class ConfigManagementServiceClient (0.83.0)

GitHub RepositoryProduct Reference

Service Description: Lineage Config Management service. Config Management service is used to manage the configuration for Data Lineage. These Configs define different configuration options for Lineage customers to control behaviour of lineage systems.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   ConfigName name = ConfigName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
   Config response = configManagementServiceClient.getConfig(name);
 }
 

Note: close() needs to be called on the ConfigManagementServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

GetConfig

Get the Config for a given resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getConfig(GetConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getConfig(ConfigName name)

  • getConfig(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getConfigCallable()

UpdateConfig

Update the Config for a given resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateConfig(UpdateConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateConfig(Config config)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateConfigCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ConfigManagementServiceSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ConfigManagementServiceSettings configManagementServiceSettings =
     ConfigManagementServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create(configManagementServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ConfigManagementServiceSettings configManagementServiceSettings =
     ConfigManagementServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create(configManagementServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ConfigManagementServiceSettings configManagementServiceSettings =
     ConfigManagementServiceSettings.newHttpJsonBuilder().build();
 ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create(configManagementServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ConfigManagementServiceClient

Static Methods

create()

public static final ConfigManagementServiceClient create()

Constructs an instance of ConfigManagementServiceClient with default settings.

Returns
Type Description
ConfigManagementServiceClient
Exceptions
Type Description
IOException

create(ConfigManagementServiceSettings settings)

public static final ConfigManagementServiceClient create(ConfigManagementServiceSettings settings)

Constructs an instance of ConfigManagementServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings ConfigManagementServiceSettings
Returns
Type Description
ConfigManagementServiceClient
Exceptions
Type Description
IOException

create(ConfigManagementServiceStub stub)

public static final ConfigManagementServiceClient create(ConfigManagementServiceStub stub)

Constructs an instance of ConfigManagementServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConfigManagementServiceSettings).

Parameter
Name Description
stub ConfigManagementServiceStub
Returns
Type Description
ConfigManagementServiceClient

Constructors

ConfigManagementServiceClient(ConfigManagementServiceSettings settings)

protected ConfigManagementServiceClient(ConfigManagementServiceSettings settings)

Constructs an instance of ConfigManagementServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings ConfigManagementServiceSettings

ConfigManagementServiceClient(ConfigManagementServiceStub stub)

protected ConfigManagementServiceClient(ConfigManagementServiceStub stub)
Parameter
Name Description
stub ConfigManagementServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

getConfig(ConfigName name)

public final Config getConfig(ConfigName name)

Get the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   ConfigName name = ConfigName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
   Config response = configManagementServiceClient.getConfig(name);
 }
 
Parameter
Name Description
name ConfigName

Required. REQUIRED: The resource name of the config to be fetched. Format: organizations/{organization_id}/locations/global/config folders/{folder_id}/locations/global/config projects/{project_id}/locations/global/config projects/{project_number}/locations/global/config

Returns
Type Description
Config

getConfig(GetConfigRequest request)

public final Config getConfig(GetConfigRequest request)

Get the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   GetConfigRequest request =
       GetConfigRequest.newBuilder()
           .setName(ConfigName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
           .build();
   Config response = configManagementServiceClient.getConfig(request);
 }
 
Parameter
Name Description
request GetConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Config

getConfig(String name)

public final Config getConfig(String name)

Get the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   String name = ConfigName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
   Config response = configManagementServiceClient.getConfig(name);
 }
 
Parameter
Name Description
name String

Required. REQUIRED: The resource name of the config to be fetched. Format: organizations/{organization_id}/locations/global/config folders/{folder_id}/locations/global/config projects/{project_id}/locations/global/config projects/{project_number}/locations/global/config

Returns
Type Description
Config

getConfigCallable()

public final UnaryCallable<GetConfigRequest,Config> getConfigCallable()

Get the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   GetConfigRequest request =
       GetConfigRequest.newBuilder()
           .setName(ConfigName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
           .build();
   ApiFuture<Config> future =
       configManagementServiceClient.getConfigCallable().futureCall(request);
   // Do something.
   Config response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetConfigRequest,Config>

getSettings()

public final ConfigManagementServiceSettings getSettings()
Returns
Type Description
ConfigManagementServiceSettings

getStub()

public ConfigManagementServiceStub getStub()
Returns
Type Description
ConfigManagementServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateConfig(Config config)

public final Config updateConfig(Config config)

Update the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   Config config = Config.newBuilder().build();
   Config response = configManagementServiceClient.updateConfig(config);
 }
 
Parameter
Name Description
config Config

Required. REQUIRED: The config to be applied to the resource and all its descendants.

Returns
Type Description
Config

updateConfig(UpdateConfigRequest request)

public final Config updateConfig(UpdateConfigRequest request)

Update the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   UpdateConfigRequest request =
       UpdateConfigRequest.newBuilder().setConfig(Config.newBuilder().build()).build();
   Config response = configManagementServiceClient.updateConfig(request);
 }
 
Parameter
Name Description
request UpdateConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Config

updateConfigCallable()

public final UnaryCallable<UpdateConfigRequest,Config> updateConfigCallable()

Update the Config for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigManagementServiceClient configManagementServiceClient =
     ConfigManagementServiceClient.create()) {
   UpdateConfigRequest request =
       UpdateConfigRequest.newBuilder().setConfig(Config.newBuilder().build()).build();
   ApiFuture<Config> future =
       configManagementServiceClient.updateConfigCallable().futureCall(request);
   // Do something.
   Config response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateConfigRequest,Config>