Class MetadataServiceClient (3.30.0)

public class MetadataServiceClient implements BackgroundResource

Service Description: Service for reading and writing metadata entries.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   MetadataStore response = metadataServiceClient.getMetadataStore(name);
 }
 

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

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

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 MetadataServiceSettings 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
 MetadataServiceSettings metadataServiceSettings =
     MetadataServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 MetadataServiceClient metadataServiceClient =
     MetadataServiceClient.create(metadataServiceSettings);
 

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
 MetadataServiceSettings metadataServiceSettings =
     MetadataServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 MetadataServiceClient metadataServiceClient =
     MetadataServiceClient.create(metadataServiceSettings);
 

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

Inheritance

java.lang.Object > MetadataServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final MetadataServiceClient create()

Constructs an instance of MetadataServiceClient with default settings.

Returns
Type Description
MetadataServiceClient
Exceptions
Type Description
IOException

create(MetadataServiceSettings settings)

public static final MetadataServiceClient create(MetadataServiceSettings settings)

Constructs an instance of MetadataServiceClient, 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 MetadataServiceSettings
Returns
Type Description
MetadataServiceClient
Exceptions
Type Description
IOException

create(MetadataServiceStub stub)

public static final MetadataServiceClient create(MetadataServiceStub stub)

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

Parameter
Name Description
stub MetadataServiceStub
Returns
Type Description
MetadataServiceClient

Constructors

MetadataServiceClient(MetadataServiceSettings settings)

protected MetadataServiceClient(MetadataServiceSettings settings)

Constructs an instance of MetadataServiceClient, 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 MetadataServiceSettings

MetadataServiceClient(MetadataServiceStub stub)

protected MetadataServiceClient(MetadataServiceStub stub)
Parameter
Name Description
stub MetadataServiceStub

Methods

addContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest request)

public final AddContextArtifactsAndExecutionsResponse addContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest request)

Adds a set of Artifacts and Executions to a Context. If any of the Artifacts or Executions have already been added to a Context, they are simply skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddContextArtifactsAndExecutionsRequest request =
       AddContextArtifactsAndExecutionsRequest.newBuilder()
           .setContext(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .addAllArtifacts(new ArrayList<String>())
           .addAllExecutions(new ArrayList<String>())
           .build();
   AddContextArtifactsAndExecutionsResponse response =
       metadataServiceClient.addContextArtifactsAndExecutions(request);
 }
 
Parameter
Name Description
request AddContextArtifactsAndExecutionsRequest

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

Returns
Type Description
AddContextArtifactsAndExecutionsResponse

addContextArtifactsAndExecutions(ContextName context, List<String> artifacts, List<String> executions)

public final AddContextArtifactsAndExecutionsResponse addContextArtifactsAndExecutions(ContextName context, List<String> artifacts, List<String> executions)

Adds a set of Artifacts and Executions to a Context. If any of the Artifacts or Executions have already been added to a Context, they are simply skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ContextName context =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]");
   List<String> artifacts = new ArrayList<>();
   List<String> executions = new ArrayList<>();
   AddContextArtifactsAndExecutionsResponse response =
       metadataServiceClient.addContextArtifactsAndExecutions(context, artifacts, executions);
 }
 
Parameters
Name Description
context ContextName

Required. The resource name of the Context that the Artifacts and Executions belong to. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

artifacts List<String>

The resource names of the Artifacts to attribute to the Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

executions List<String>

The resource names of the Executions to associate with the Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

Returns
Type Description
AddContextArtifactsAndExecutionsResponse

addContextArtifactsAndExecutions(String context, List<String> artifacts, List<String> executions)

public final AddContextArtifactsAndExecutionsResponse addContextArtifactsAndExecutions(String context, List<String> artifacts, List<String> executions)

Adds a set of Artifacts and Executions to a Context. If any of the Artifacts or Executions have already been added to a Context, they are simply skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String context =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]").toString();
   List<String> artifacts = new ArrayList<>();
   List<String> executions = new ArrayList<>();
   AddContextArtifactsAndExecutionsResponse response =
       metadataServiceClient.addContextArtifactsAndExecutions(context, artifacts, executions);
 }
 
Parameters
Name Description
context String

Required. The resource name of the Context that the Artifacts and Executions belong to. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

artifacts List<String>

The resource names of the Artifacts to attribute to the Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

executions List<String>

The resource names of the Executions to associate with the Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

Returns
Type Description
AddContextArtifactsAndExecutionsResponse

addContextArtifactsAndExecutionsCallable()

public final UnaryCallable<AddContextArtifactsAndExecutionsRequest,AddContextArtifactsAndExecutionsResponse> addContextArtifactsAndExecutionsCallable()

Adds a set of Artifacts and Executions to a Context. If any of the Artifacts or Executions have already been added to a Context, they are simply skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddContextArtifactsAndExecutionsRequest request =
       AddContextArtifactsAndExecutionsRequest.newBuilder()
           .setContext(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .addAllArtifacts(new ArrayList<String>())
           .addAllExecutions(new ArrayList<String>())
           .build();
   ApiFuture<AddContextArtifactsAndExecutionsResponse> future =
       metadataServiceClient.addContextArtifactsAndExecutionsCallable().futureCall(request);
   // Do something.
   AddContextArtifactsAndExecutionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddContextArtifactsAndExecutionsRequest,AddContextArtifactsAndExecutionsResponse>

addContextChildren(AddContextChildrenRequest request)

public final AddContextChildrenResponse addContextChildren(AddContextChildrenRequest request)

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddContextChildrenRequest request =
       AddContextChildrenRequest.newBuilder()
           .setContext(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .addAllChildContexts(new ArrayList<String>())
           .build();
   AddContextChildrenResponse response = metadataServiceClient.addContextChildren(request);
 }
 
Parameter
Name Description
request AddContextChildrenRequest

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

Returns
Type Description
AddContextChildrenResponse

addContextChildren(ContextName context, List<String> childContexts)

public final AddContextChildrenResponse addContextChildren(ContextName context, List<String> childContexts)

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ContextName context =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]");
   List<String> childContexts = new ArrayList<>();
   AddContextChildrenResponse response =
       metadataServiceClient.addContextChildren(context, childContexts);
 }
 
Parameters
Name Description
context ContextName

Required. The resource name of the parent Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

childContexts List<String>

The resource names of the child Contexts.

Returns
Type Description
AddContextChildrenResponse

addContextChildren(String context, List<String> childContexts)

public final AddContextChildrenResponse addContextChildren(String context, List<String> childContexts)

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String context =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]").toString();
   List<String> childContexts = new ArrayList<>();
   AddContextChildrenResponse response =
       metadataServiceClient.addContextChildren(context, childContexts);
 }
 
Parameters
Name Description
context String

Required. The resource name of the parent Context.

Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

childContexts List<String>

The resource names of the child Contexts.

Returns
Type Description
AddContextChildrenResponse

addContextChildrenCallable()

public final UnaryCallable<AddContextChildrenRequest,AddContextChildrenResponse> addContextChildrenCallable()

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddContextChildrenRequest request =
       AddContextChildrenRequest.newBuilder()
           .setContext(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .addAllChildContexts(new ArrayList<String>())
           .build();
   ApiFuture<AddContextChildrenResponse> future =
       metadataServiceClient.addContextChildrenCallable().futureCall(request);
   // Do something.
   AddContextChildrenResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddContextChildrenRequest,AddContextChildrenResponse>

addExecutionEvents(AddExecutionEventsRequest request)

public final AddExecutionEventsResponse addExecutionEvents(AddExecutionEventsRequest request)

Adds Events to the specified Execution. An Event indicates whether an Artifact was used as an input or output for an Execution. If an Event already exists between the Execution and the Artifact, the Event is skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddExecutionEventsRequest request =
       AddExecutionEventsRequest.newBuilder()
           .setExecution(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .addAllEvents(new ArrayList<Event>())
           .build();
   AddExecutionEventsResponse response = metadataServiceClient.addExecutionEvents(request);
 }
 
Parameter
Name Description
request AddExecutionEventsRequest

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

Returns
Type Description
AddExecutionEventsResponse

addExecutionEvents(ExecutionName execution, List<Event> events)

public final AddExecutionEventsResponse addExecutionEvents(ExecutionName execution, List<Event> events)

Adds Events to the specified Execution. An Event indicates whether an Artifact was used as an input or output for an Execution. If an Event already exists between the Execution and the Artifact, the Event is skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ExecutionName execution =
       ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]");
   List<Event> events = new ArrayList<>();
   AddExecutionEventsResponse response =
       metadataServiceClient.addExecutionEvents(execution, events);
 }
 
Parameters
Name Description
execution ExecutionName

Required. The resource name of the Execution that the Events connect Artifacts with. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

events List<Event>

The Events to create and add.

Returns
Type Description
AddExecutionEventsResponse

addExecutionEvents(String execution, List<Event> events)

public final AddExecutionEventsResponse addExecutionEvents(String execution, List<Event> events)

Adds Events to the specified Execution. An Event indicates whether an Artifact was used as an input or output for an Execution. If an Event already exists between the Execution and the Artifact, the Event is skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String execution =
       ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]").toString();
   List<Event> events = new ArrayList<>();
   AddExecutionEventsResponse response =
       metadataServiceClient.addExecutionEvents(execution, events);
 }
 
Parameters
Name Description
execution String

Required. The resource name of the Execution that the Events connect Artifacts with. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

events List<Event>

The Events to create and add.

Returns
Type Description
AddExecutionEventsResponse

addExecutionEventsCallable()

public final UnaryCallable<AddExecutionEventsRequest,AddExecutionEventsResponse> addExecutionEventsCallable()

Adds Events to the specified Execution. An Event indicates whether an Artifact was used as an input or output for an Execution. If an Event already exists between the Execution and the Artifact, the Event is skipped.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   AddExecutionEventsRequest request =
       AddExecutionEventsRequest.newBuilder()
           .setExecution(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .addAllEvents(new ArrayList<Event>())
           .build();
   ApiFuture<AddExecutionEventsResponse> future =
       metadataServiceClient.addExecutionEventsCallable().futureCall(request);
   // Do something.
   AddExecutionEventsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddExecutionEventsRequest,AddExecutionEventsResponse>

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()

createArtifact(CreateArtifactRequest request)

public final Artifact createArtifact(CreateArtifactRequest request)

Creates an Artifact associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateArtifactRequest request =
       CreateArtifactRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setArtifact(Artifact.newBuilder().build())
           .setArtifactId("artifactId240640653")
           .build();
   Artifact response = metadataServiceClient.createArtifact(request);
 }
 
Parameter
Name Description
request CreateArtifactRequest

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

Returns
Type Description
Artifact

createArtifact(MetadataStoreName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(MetadataStoreName parent, Artifact artifact, String artifactId)

Creates an Artifact associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = metadataServiceClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
Name Description
parent MetadataStoreName

Required. The resource name of the MetadataStore where the Artifact should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

artifact Artifact

Required. The Artifact to create.

artifactId String

The {artifact} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact} If not provided, the Artifact's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Artifacts in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Artifact.)

Returns
Type Description
Artifact

createArtifact(String parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(String parent, Artifact artifact, String artifactId)

Creates an Artifact associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString();
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = metadataServiceClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the MetadataStore where the Artifact should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

artifact Artifact

Required. The Artifact to create.

artifactId String

The {artifact} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact} If not provided, the Artifact's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Artifacts in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Artifact.)

Returns
Type Description
Artifact

createArtifactCallable()

public final UnaryCallable<CreateArtifactRequest,Artifact> createArtifactCallable()

Creates an Artifact associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateArtifactRequest request =
       CreateArtifactRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setArtifact(Artifact.newBuilder().build())
           .setArtifactId("artifactId240640653")
           .build();
   ApiFuture<Artifact> future =
       metadataServiceClient.createArtifactCallable().futureCall(request);
   // Do something.
   Artifact response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateArtifactRequest,Artifact>

createContext(CreateContextRequest request)

public final Context createContext(CreateContextRequest request)

Creates a Context associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateContextRequest request =
       CreateContextRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setContext(Context.newBuilder().build())
           .setContextId("contextId-406810838")
           .build();
   Context response = metadataServiceClient.createContext(request);
 }
 
Parameter
Name Description
request CreateContextRequest

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

Returns
Type Description
Context

createContext(MetadataStoreName parent, Context context, String contextId)

public final Context createContext(MetadataStoreName parent, Context context, String contextId)

Creates a Context associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   Context context = Context.newBuilder().build();
   String contextId = "contextId-406810838";
   Context response = metadataServiceClient.createContext(parent, context, contextId);
 }
 
Parameters
Name Description
parent MetadataStoreName

Required. The resource name of the MetadataStore where the Context should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

context Context

Required. The Context to create.

contextId String

The {context} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}. If not provided, the Context's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Contexts in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Context.)

Returns
Type Description
Context

createContext(String parent, Context context, String contextId)

public final Context createContext(String parent, Context context, String contextId)

Creates a Context associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString();
   Context context = Context.newBuilder().build();
   String contextId = "contextId-406810838";
   Context response = metadataServiceClient.createContext(parent, context, contextId);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the MetadataStore where the Context should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

context Context

Required. The Context to create.

contextId String

The {context} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}. If not provided, the Context's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Contexts in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Context.)

Returns
Type Description
Context

createContextCallable()

public final UnaryCallable<CreateContextRequest,Context> createContextCallable()

Creates a Context associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateContextRequest request =
       CreateContextRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setContext(Context.newBuilder().build())
           .setContextId("contextId-406810838")
           .build();
   ApiFuture<Context> future = metadataServiceClient.createContextCallable().futureCall(request);
   // Do something.
   Context response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateContextRequest,Context>

createExecution(CreateExecutionRequest request)

public final Execution createExecution(CreateExecutionRequest request)

Creates an Execution associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateExecutionRequest request =
       CreateExecutionRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setExecution(Execution.newBuilder().build())
           .setExecutionId("executionId-454906285")
           .build();
   Execution response = metadataServiceClient.createExecution(request);
 }
 
Parameter
Name Description
request CreateExecutionRequest

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

Returns
Type Description
Execution

createExecution(MetadataStoreName parent, Execution execution, String executionId)

public final Execution createExecution(MetadataStoreName parent, Execution execution, String executionId)

Creates an Execution associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   Execution execution = Execution.newBuilder().build();
   String executionId = "executionId-454906285";
   Execution response = metadataServiceClient.createExecution(parent, execution, executionId);
 }
 
Parameters
Name Description
parent MetadataStoreName

Required. The resource name of the MetadataStore where the Execution should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

execution Execution

Required. The Execution to create.

executionId String

The {execution} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution} If not provided, the Execution's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Executions in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Execution.)

Returns
Type Description
Execution

createExecution(String parent, Execution execution, String executionId)

public final Execution createExecution(String parent, Execution execution, String executionId)

Creates an Execution associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString();
   Execution execution = Execution.newBuilder().build();
   String executionId = "executionId-454906285";
   Execution response = metadataServiceClient.createExecution(parent, execution, executionId);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the MetadataStore where the Execution should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

execution Execution

Required. The Execution to create.

executionId String

The {execution} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution} If not provided, the Execution's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Executions in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Execution.)

Returns
Type Description
Execution

createExecutionCallable()

public final UnaryCallable<CreateExecutionRequest,Execution> createExecutionCallable()

Creates an Execution associated with a MetadataStore.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateExecutionRequest request =
       CreateExecutionRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setExecution(Execution.newBuilder().build())
           .setExecutionId("executionId-454906285")
           .build();
   ApiFuture<Execution> future =
       metadataServiceClient.createExecutionCallable().futureCall(request);
   // Do something.
   Execution response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateExecutionRequest,Execution>

createMetadataSchema(CreateMetadataSchemaRequest request)

public final MetadataSchema createMetadataSchema(CreateMetadataSchemaRequest request)

Creates a MetadataSchema.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateMetadataSchemaRequest request =
       CreateMetadataSchemaRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setMetadataSchema(MetadataSchema.newBuilder().build())
           .setMetadataSchemaId("metadataSchemaId1549245163")
           .build();
   MetadataSchema response = metadataServiceClient.createMetadataSchema(request);
 }
 
Parameter
Name Description
request CreateMetadataSchemaRequest

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

Returns
Type Description
MetadataSchema

createMetadataSchema(MetadataStoreName parent, MetadataSchema metadataSchema, String metadataSchemaId)

public final MetadataSchema createMetadataSchema(MetadataStoreName parent, MetadataSchema metadataSchema, String metadataSchemaId)

Creates a MetadataSchema.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   MetadataSchema metadataSchema = MetadataSchema.newBuilder().build();
   String metadataSchemaId = "metadataSchemaId1549245163";
   MetadataSchema response =
       metadataServiceClient.createMetadataSchema(parent, metadataSchema, metadataSchemaId);
 }
 
Parameters
Name Description
parent MetadataStoreName

Required. The resource name of the MetadataStore where the MetadataSchema should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

metadataSchema MetadataSchema

Required. The MetadataSchema to create.

metadataSchemaId String

The {metadata_schema} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema} If not provided, the MetadataStore's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all MetadataSchemas in the parent Location. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting MetadataSchema.)

Returns
Type Description
MetadataSchema

createMetadataSchema(String parent, MetadataSchema metadataSchema, String metadataSchemaId)

public final MetadataSchema createMetadataSchema(String parent, MetadataSchema metadataSchema, String metadataSchemaId)

Creates a MetadataSchema.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String parent =
       MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString();
   MetadataSchema metadataSchema = MetadataSchema.newBuilder().build();
   String metadataSchemaId = "metadataSchemaId1549245163";
   MetadataSchema response =
       metadataServiceClient.createMetadataSchema(parent, metadataSchema, metadataSchemaId);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the MetadataStore where the MetadataSchema should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

metadataSchema MetadataSchema

Required. The MetadataSchema to create.

metadataSchemaId String

The {metadata_schema} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema} If not provided, the MetadataStore's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all MetadataSchemas in the parent Location. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting MetadataSchema.)

Returns
Type Description
MetadataSchema

createMetadataSchemaCallable()

public final UnaryCallable<CreateMetadataSchemaRequest,MetadataSchema> createMetadataSchemaCallable()

Creates a MetadataSchema.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateMetadataSchemaRequest request =
       CreateMetadataSchemaRequest.newBuilder()
           .setParent(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setMetadataSchema(MetadataSchema.newBuilder().build())
           .setMetadataSchemaId("metadataSchemaId1549245163")
           .build();
   ApiFuture<MetadataSchema> future =
       metadataServiceClient.createMetadataSchemaCallable().futureCall(request);
   // Do something.
   MetadataSchema response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateMetadataSchemaRequest,MetadataSchema>

createMetadataStoreAsync(CreateMetadataStoreRequest request)

public final OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata> createMetadataStoreAsync(CreateMetadataStoreRequest request)

Initializes a MetadataStore, including allocation of resources.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateMetadataStoreRequest request =
       CreateMetadataStoreRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMetadataStore(MetadataStore.newBuilder().build())
           .setMetadataStoreId("metadataStoreId-1811789907")
           .build();
   MetadataStore response = metadataServiceClient.createMetadataStoreAsync(request).get();
 }
 
Parameter
Name Description
request CreateMetadataStoreRequest

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

Returns
Type Description
OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata>

createMetadataStoreAsync(LocationName parent, MetadataStore metadataStore, String metadataStoreId)

public final OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata> createMetadataStoreAsync(LocationName parent, MetadataStore metadataStore, String metadataStoreId)

Initializes a MetadataStore, including allocation of resources.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   MetadataStore metadataStore = MetadataStore.newBuilder().build();
   String metadataStoreId = "metadataStoreId-1811789907";
   MetadataStore response =
       metadataServiceClient
           .createMetadataStoreAsync(parent, metadataStore, metadataStoreId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location where the MetadataStore should be created. Format: projects/{project}/locations/{location}/

metadataStore MetadataStore

Required. The MetadataStore to create.

metadataStoreId String

The {metadatastore} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore} If not provided, the MetadataStore's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all MetadataStores in the parent Location. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting MetadataStore.)

Returns
Type Description
OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata>

createMetadataStoreAsync(String parent, MetadataStore metadataStore, String metadataStoreId)

public final OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata> createMetadataStoreAsync(String parent, MetadataStore metadataStore, String metadataStoreId)

Initializes a MetadataStore, including allocation of resources.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   MetadataStore metadataStore = MetadataStore.newBuilder().build();
   String metadataStoreId = "metadataStoreId-1811789907";
   MetadataStore response =
       metadataServiceClient
           .createMetadataStoreAsync(parent, metadataStore, metadataStoreId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location where the MetadataStore should be created. Format: projects/{project}/locations/{location}/

metadataStore MetadataStore

Required. The MetadataStore to create.

metadataStoreId String

The {metadatastore} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore} If not provided, the MetadataStore's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all MetadataStores in the parent Location. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting MetadataStore.)

Returns
Type Description
OperationFuture<MetadataStore,CreateMetadataStoreOperationMetadata>

createMetadataStoreCallable()

public final UnaryCallable<CreateMetadataStoreRequest,Operation> createMetadataStoreCallable()

Initializes a MetadataStore, including allocation of resources.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateMetadataStoreRequest request =
       CreateMetadataStoreRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMetadataStore(MetadataStore.newBuilder().build())
           .setMetadataStoreId("metadataStoreId-1811789907")
           .build();
   ApiFuture<Operation> future =
       metadataServiceClient.createMetadataStoreCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateMetadataStoreRequest,Operation>

createMetadataStoreOperationCallable()

public final OperationCallable<CreateMetadataStoreRequest,MetadataStore,CreateMetadataStoreOperationMetadata> createMetadataStoreOperationCallable()

Initializes a MetadataStore, including allocation of resources.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   CreateMetadataStoreRequest request =
       CreateMetadataStoreRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMetadataStore(MetadataStore.newBuilder().build())
           .setMetadataStoreId("metadataStoreId-1811789907")
           .build();
   OperationFuture<MetadataStore, CreateMetadataStoreOperationMetadata> future =
       metadataServiceClient.createMetadataStoreOperationCallable().futureCall(request);
   // Do something.
   MetadataStore response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateMetadataStoreRequest,MetadataStore,CreateMetadataStoreOperationMetadata>

deleteArtifactAsync(ArtifactName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteArtifactAsync(ArtifactName name)

Deletes an Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ArtifactName name =
       ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]");
   metadataServiceClient.deleteArtifactAsync(name).get();
 }
 
Parameter
Name Description
name ArtifactName

Required. The resource name of the Artifact to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteArtifactAsync(DeleteArtifactRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteArtifactAsync(DeleteArtifactRequest request)

Deletes an Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteArtifactRequest request =
       DeleteArtifactRequest.newBuilder()
           .setName(
               ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   metadataServiceClient.deleteArtifactAsync(request).get();
 }
 
Parameter
Name Description
request DeleteArtifactRequest

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

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteArtifactAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteArtifactAsync(String name)

Deletes an Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name =
       ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]").toString();
   metadataServiceClient.deleteArtifactAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the Artifact to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteArtifactCallable()

public final UnaryCallable<DeleteArtifactRequest,Operation> deleteArtifactCallable()

Deletes an Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteArtifactRequest request =
       DeleteArtifactRequest.newBuilder()
           .setName(
               ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   ApiFuture<Operation> future =
       metadataServiceClient.deleteArtifactCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteArtifactRequest,Operation>

deleteArtifactOperationCallable()

public final OperationCallable<DeleteArtifactRequest,Empty,DeleteOperationMetadata> deleteArtifactOperationCallable()

Deletes an Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteArtifactRequest request =
       DeleteArtifactRequest.newBuilder()
           .setName(
               ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       metadataServiceClient.deleteArtifactOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteArtifactRequest,Empty,DeleteOperationMetadata>

deleteContextAsync(ContextName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteContextAsync(ContextName name)

Deletes a stored Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ContextName name = ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]");
   metadataServiceClient.deleteContextAsync(name).get();
 }
 
Parameter
Name Description
name ContextName

Required. The resource name of the Context to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteContextAsync(DeleteContextRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteContextAsync(DeleteContextRequest request)

Deletes a stored Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteContextRequest request =
       DeleteContextRequest.newBuilder()
           .setName(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .setForce(true)
           .setEtag("etag3123477")
           .build();
   metadataServiceClient.deleteContextAsync(request).get();
 }
 
Parameter
Name Description
request DeleteContextRequest

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

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteContextAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteContextAsync(String name)

Deletes a stored Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]").toString();
   metadataServiceClient.deleteContextAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the Context to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteContextCallable()

public final UnaryCallable<DeleteContextRequest,Operation> deleteContextCallable()

Deletes a stored Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteContextRequest request =
       DeleteContextRequest.newBuilder()
           .setName(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .setForce(true)
           .setEtag("etag3123477")
           .build();
   ApiFuture<Operation> future =
       metadataServiceClient.deleteContextCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteContextRequest,Operation>

deleteContextOperationCallable()

public final OperationCallable<DeleteContextRequest,Empty,DeleteOperationMetadata> deleteContextOperationCallable()

Deletes a stored Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteContextRequest request =
       DeleteContextRequest.newBuilder()
           .setName(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .setForce(true)
           .setEtag("etag3123477")
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       metadataServiceClient.deleteContextOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteContextRequest,Empty,DeleteOperationMetadata>

deleteExecutionAsync(DeleteExecutionRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteExecutionAsync(DeleteExecutionRequest request)

Deletes an Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteExecutionRequest request =
       DeleteExecutionRequest.newBuilder()
           .setName(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   metadataServiceClient.deleteExecutionAsync(request).get();
 }
 
Parameter
Name Description
request DeleteExecutionRequest

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

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteExecutionAsync(ExecutionName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteExecutionAsync(ExecutionName name)

Deletes an Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ExecutionName name =
       ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]");
   metadataServiceClient.deleteExecutionAsync(name).get();
 }
 
Parameter
Name Description
name ExecutionName

Required. The resource name of the Execution to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteExecutionAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteExecutionAsync(String name)

Deletes an Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name =
       ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]").toString();
   metadataServiceClient.deleteExecutionAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the Execution to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteExecutionCallable()

public final UnaryCallable<DeleteExecutionRequest,Operation> deleteExecutionCallable()

Deletes an Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteExecutionRequest request =
       DeleteExecutionRequest.newBuilder()
           .setName(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   ApiFuture<Operation> future =
       metadataServiceClient.deleteExecutionCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteExecutionRequest,Operation>

deleteExecutionOperationCallable()

public final OperationCallable<DeleteExecutionRequest,Empty,DeleteOperationMetadata> deleteExecutionOperationCallable()

Deletes an Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteExecutionRequest request =
       DeleteExecutionRequest.newBuilder()
           .setName(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       metadataServiceClient.deleteExecutionOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteExecutionRequest,Empty,DeleteOperationMetadata>

deleteMetadataStoreAsync(DeleteMetadataStoreRequest request)

public final OperationFuture<Empty,DeleteMetadataStoreOperationMetadata> deleteMetadataStoreAsync(DeleteMetadataStoreRequest request)

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteMetadataStoreRequest request =
       DeleteMetadataStoreRequest.newBuilder()
           .setName(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setForce(true)
           .build();
   metadataServiceClient.deleteMetadataStoreAsync(request).get();
 }
 
Parameter
Name Description
request DeleteMetadataStoreRequest

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

Returns
Type Description
OperationFuture<Empty,DeleteMetadataStoreOperationMetadata>

deleteMetadataStoreAsync(MetadataStoreName name)

public final OperationFuture<Empty,DeleteMetadataStoreOperationMetadata> deleteMetadataStoreAsync(MetadataStoreName name)

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   MetadataStoreName name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]");
   metadataServiceClient.deleteMetadataStoreAsync(name).get();
 }
 
Parameter
Name Description
name MetadataStoreName

Required. The resource name of the MetadataStore to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

Returns
Type Description
OperationFuture<Empty,DeleteMetadataStoreOperationMetadata>

deleteMetadataStoreAsync(String name)

public final OperationFuture<Empty,DeleteMetadataStoreOperationMetadata> deleteMetadataStoreAsync(String name)

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString();
   metadataServiceClient.deleteMetadataStoreAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the MetadataStore to delete. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

Returns
Type Description
OperationFuture<Empty,DeleteMetadataStoreOperationMetadata>

deleteMetadataStoreCallable()

public final UnaryCallable<DeleteMetadataStoreRequest,Operation> deleteMetadataStoreCallable()

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteMetadataStoreRequest request =
       DeleteMetadataStoreRequest.newBuilder()
           .setName(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setForce(true)
           .build();
   ApiFuture<Operation> future =
       metadataServiceClient.deleteMetadataStoreCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteMetadataStoreRequest,Operation>

deleteMetadataStoreOperationCallable()

public final OperationCallable<DeleteMetadataStoreRequest,Empty,DeleteMetadataStoreOperationMetadata> deleteMetadataStoreOperationCallable()

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   DeleteMetadataStoreRequest request =
       DeleteMetadataStoreRequest.newBuilder()
           .setName(
               MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString())
           .setForce(true)
           .build();
   OperationFuture<Empty, DeleteMetadataStoreOperationMetadata> future =
       metadataServiceClient.deleteMetadataStoreOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteMetadataStoreRequest,Empty,DeleteMetadataStoreOperationMetadata>

getArtifact(ArtifactName name)

public final Artifact getArtifact(ArtifactName name)

Retrieves a specific Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ArtifactName name =
       ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]");
   Artifact response = metadataServiceClient.getArtifact(name);
 }
 
Parameter
Name Description
name ArtifactName

Required. The resource name of the Artifact to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

Returns
Type Description
Artifact

getArtifact(GetArtifactRequest request)

public final Artifact getArtifact(GetArtifactRequest request)

Retrieves a specific Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   GetArtifactRequest request =
       GetArtifactRequest.newBuilder()
           .setName(
               ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]")
                   .toString())
           .build();
   Artifact response = metadataServiceClient.getArtifact(request);
 }
 
Parameter
Name Description
request GetArtifactRequest

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

Returns
Type Description
Artifact

getArtifact(String name)

public final Artifact getArtifact(String name)

Retrieves a specific Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name =
       ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]").toString();
   Artifact response = metadataServiceClient.getArtifact(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the Artifact to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

Returns
Type Description
Artifact

getArtifactCallable()

public final UnaryCallable<GetArtifactRequest,Artifact> getArtifactCallable()

Retrieves a specific Artifact.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   GetArtifactRequest request =
       GetArtifactRequest.newBuilder()
           .setName(
               ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]")
                   .toString())
           .build();
   ApiFuture<Artifact> future = metadataServiceClient.getArtifactCallable().futureCall(request);
   // Do something.
   Artifact response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetArtifactRequest,Artifact>

getContext(ContextName name)

public final Context getContext(ContextName name)

Retrieves a specific Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ContextName name = ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]");
   Context response = metadataServiceClient.getContext(name);
 }
 
Parameter
Name Description
name ContextName

Required. The resource name of the Context to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

Returns
Type Description
Context

getContext(GetContextRequest request)

public final Context getContext(GetContextRequest request)

Retrieves a specific Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   GetContextRequest request =
       GetContextRequest.newBuilder()
           .setName(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .build();
   Context response = metadataServiceClient.getContext(request);
 }
 
Parameter
Name Description
request GetContextRequest

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

Returns
Type Description
Context

getContext(String name)

public final Context getContext(String name)

Retrieves a specific Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   String name =
       ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]").toString();
   Context response = metadataServiceClient.getContext(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the Context to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

Returns
Type Description
Context

getContextCallable()

public final UnaryCallable<GetContextRequest,Context> getContextCallable()

Retrieves a specific Context.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   GetContextRequest request =
       GetContextRequest.newBuilder()
           .setName(
               ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]")
                   .toString())
           .build();
   ApiFuture<Context> future = metadataServiceClient.getContextCallable().futureCall(request);
   // Do something.
   Context response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetContextRequest,Context>

getExecution(ExecutionName name)

public final Execution getExecution(ExecutionName name)

Retrieves a specific Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   ExecutionName name =
       ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]");
   Execution response = metadataServiceClient.getExecution(name);
 }
 
Parameter
Name Description
name ExecutionName

Required. The resource name of the Execution to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

Returns
Type Description
Execution

getExecution(GetExecutionRequest request)

public final Execution getExecution(GetExecutionRequest request)

Retrieves a specific Execution.

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 (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
   GetExecutionRequest request =
       GetExecutionRequest.newBuilder()
           .setName(
               ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]")
                   .toString())
           .build();
   Execution response = metadataServiceClient.getExecution(request);
 }
 
Parameter
Name Description
request GetExecutionRequest

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