Class MetadataServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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().
| Method | Description | Method Variants |
|---|---|---|
CreateMetadataStore |
Initializes a MetadataStore, including allocation of resources. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetMetadataStore |
Retrieves a specific MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListMetadataStores |
Lists MetadataStores for a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteMetadataStore |
Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateArtifact |
Creates an Artifact associated with a MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetArtifact |
Retrieves a specific Artifact. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListArtifacts |
Lists Artifacts in the MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateArtifact |
Updates a stored Artifact. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteArtifact |
Deletes an Artifact. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PurgeArtifacts |
Purges Artifacts. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateContext |
Creates a Context associated with a MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetContext |
Retrieves a specific Context. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListContexts |
Lists Contexts on the MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateContext |
Updates a stored Context. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteContext |
Deletes a stored Context. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PurgeContexts |
Purges Contexts. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddContextArtifactsAndExecutions |
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. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddContextChildren |
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. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveContextChildren |
Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent Context, they are simply skipped. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
QueryContextLineageSubgraph |
Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateExecution |
Creates an Execution associated with a MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetExecution |
Retrieves a specific Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListExecutions |
Lists Executions in the MetadataStore. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateExecution |
Updates a stored Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteExecution |
Deletes an Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PurgeExecutions |
Purges Executions. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddExecutionEvents |
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. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
QueryExecutionInputsAndOutputs |
Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateMetadataSchema |
Creates a MetadataSchema. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetMetadataSchema |
Retrieves a specific MetadataSchema. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListMetadataSchemas |
Lists MetadataSchemas. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
QueryArtifactLineageSubgraph |
Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetadataServiceClient(MetadataServiceSettings settings) Constructs an instance of MetadataServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionAdds a set of Artifacts and Executions to a Context.addContextArtifactsAndExecutions(ContextName context, List<String> artifacts, List<String> executions) Adds a set of Artifacts and Executions to a Context.Adds a set of Artifacts and Executions to a Context.final UnaryCallable<AddContextArtifactsAndExecutionsRequest,AddContextArtifactsAndExecutionsResponse> Adds a set of Artifacts and Executions to a Context.Adds a set of Contexts as children to a parent Context.addContextChildren(ContextName context, List<String> childContexts) Adds a set of Contexts as children to a parent Context.addContextChildren(String context, List<String> childContexts) Adds a set of Contexts as children to a parent Context.Adds a set of Contexts as children to a parent Context.Adds Events to the specified Execution.addExecutionEvents(ExecutionName execution, List<Event> events) Adds Events to the specified Execution.addExecutionEvents(String execution, List<Event> events) Adds Events to the specified Execution.Adds Events to the specified Execution.booleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final MetadataServiceClientcreate()Constructs an instance of MetadataServiceClient with default settings.static final MetadataServiceClientcreate(MetadataServiceSettings settings) Constructs an instance of MetadataServiceClient, using the given settings.static final MetadataServiceClientcreate(MetadataServiceStub stub) Constructs an instance of MetadataServiceClient, using the given stub for making calls.final ArtifactcreateArtifact(CreateArtifactRequest request) Creates an Artifact associated with a MetadataStore.final ArtifactcreateArtifact(MetadataStoreName parent, Artifact artifact, String artifactId) Creates an Artifact associated with a MetadataStore.final ArtifactcreateArtifact(String parent, Artifact artifact, String artifactId) Creates an Artifact associated with a MetadataStore.Creates an Artifact associated with a MetadataStore.final ContextcreateContext(CreateContextRequest request) Creates a Context associated with a MetadataStore.final ContextcreateContext(MetadataStoreName parent, Context context, String contextId) Creates a Context associated with a MetadataStore.final ContextcreateContext(String parent, Context context, String contextId) Creates a Context associated with a MetadataStore.Creates a Context associated with a MetadataStore.final ExecutioncreateExecution(CreateExecutionRequest request) Creates an Execution associated with a MetadataStore.final ExecutioncreateExecution(MetadataStoreName parent, Execution execution, String executionId) Creates an Execution associated with a MetadataStore.final ExecutioncreateExecution(String parent, Execution execution, String executionId) Creates an Execution associated with a MetadataStore.Creates an Execution associated with a MetadataStore.final MetadataSchemaCreates a MetadataSchema.final MetadataSchemacreateMetadataSchema(MetadataStoreName parent, MetadataSchema metadataSchema, String metadataSchemaId) Creates a MetadataSchema.final MetadataSchemacreateMetadataSchema(String parent, MetadataSchema metadataSchema, String metadataSchemaId) Creates a MetadataSchema.Creates a MetadataSchema.Initializes a MetadataStore, including allocation of resources.createMetadataStoreAsync(LocationName parent, MetadataStore metadataStore, String metadataStoreId) Initializes a MetadataStore, including allocation of resources.createMetadataStoreAsync(String parent, MetadataStore metadataStore, String metadataStoreId) Initializes a MetadataStore, including allocation of resources.Initializes a MetadataStore, including allocation of resources.final OperationCallable<CreateMetadataStoreRequest,MetadataStore, CreateMetadataStoreOperationMetadata> Initializes a MetadataStore, including allocation of resources.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes an Artifact.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteArtifactAsync(DeleteArtifactRequest request) Deletes an Artifact.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteArtifactAsync(String name) Deletes an Artifact.Deletes an Artifact.final OperationCallable<DeleteArtifactRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes an Artifact.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a stored Context.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteContextAsync(DeleteContextRequest request) Deletes a stored Context.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteContextAsync(String name) Deletes a stored Context.Deletes a stored Context.final OperationCallable<DeleteContextRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a stored Context.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes an Execution.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes an Execution.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteExecutionAsync(String name) Deletes an Execution.Deletes an Execution.final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes an Execution.final OperationFuture<com.google.protobuf.Empty,DeleteMetadataStoreOperationMetadata> Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).final OperationFuture<com.google.protobuf.Empty,DeleteMetadataStoreOperationMetadata> Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).final OperationFuture<com.google.protobuf.Empty,DeleteMetadataStoreOperationMetadata> Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).final OperationCallable<DeleteMetadataStoreRequest,com.google.protobuf.Empty, DeleteMetadataStoreOperationMetadata> Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).final ArtifactgetArtifact(ArtifactName name) Retrieves a specific Artifact.final ArtifactgetArtifact(GetArtifactRequest request) Retrieves a specific Artifact.final ArtifactgetArtifact(String name) Retrieves a specific Artifact.Retrieves a specific Artifact.final ContextgetContext(ContextName name) Retrieves a specific Context.final ContextgetContext(GetContextRequest request) Retrieves a specific Context.final ContextgetContext(String name) Retrieves a specific Context.Retrieves a specific Context.final ExecutiongetExecution(ExecutionName name) Retrieves a specific Execution.final ExecutiongetExecution(GetExecutionRequest request) Retrieves a specific Execution.final ExecutiongetExecution(String name) Retrieves a specific Execution.Retrieves a specific Execution.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final MetadataSchemaRetrieves a specific MetadataSchema.final MetadataSchemaRetrieves a specific MetadataSchema.final MetadataSchemagetMetadataSchema(String name) Retrieves a specific MetadataSchema.Retrieves a specific MetadataSchema.final MetadataStoregetMetadataStore(GetMetadataStoreRequest request) Retrieves a specific MetadataStore.final MetadataStoreRetrieves a specific MetadataStore.final MetadataStoregetMetadataStore(String name) Retrieves a specific MetadataStore.Retrieves a specific MetadataStore.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final MetadataServiceSettingsgetStub()booleanbooleanlistArtifacts(ListArtifactsRequest request) Lists Artifacts in the MetadataStore.listArtifacts(MetadataStoreName parent) Lists Artifacts in the MetadataStore.listArtifacts(String parent) Lists Artifacts in the MetadataStore.Lists Artifacts in the MetadataStore.Lists Artifacts in the MetadataStore.listContexts(ListContextsRequest request) Lists Contexts on the MetadataStore.listContexts(MetadataStoreName parent) Lists Contexts on the MetadataStore.listContexts(String parent) Lists Contexts on the MetadataStore.Lists Contexts on the MetadataStore.Lists Contexts on the MetadataStore.listExecutions(ListExecutionsRequest request) Lists Executions in the MetadataStore.listExecutions(MetadataStoreName parent) Lists Executions in the MetadataStore.listExecutions(String parent) Lists Executions in the MetadataStore.Lists Executions in the MetadataStore.Lists Executions in the MetadataStore.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists MetadataSchemas.listMetadataSchemas(MetadataStoreName parent) Lists MetadataSchemas.listMetadataSchemas(String parent) Lists MetadataSchemas.Lists MetadataSchemas.final UnaryCallable<ListMetadataSchemasRequest,MetadataServiceClient.ListMetadataSchemasPagedResponse> Lists MetadataSchemas.Lists MetadataStores for a Location.listMetadataStores(LocationName parent) Lists MetadataStores for a Location.listMetadataStores(String parent) Lists MetadataStores for a Location.Lists MetadataStores for a Location.final UnaryCallable<ListMetadataStoresRequest,MetadataServiceClient.ListMetadataStoresPagedResponse> Lists MetadataStores for a Location.purgeArtifactsAsync(MetadataStoreName parent) Purges Artifacts.purgeArtifactsAsync(PurgeArtifactsRequest request) Purges Artifacts.purgeArtifactsAsync(String parent) Purges Artifacts.Purges Artifacts.Purges Artifacts.purgeContextsAsync(MetadataStoreName parent) Purges Contexts.purgeContextsAsync(PurgeContextsRequest request) Purges Contexts.purgeContextsAsync(String parent) Purges Contexts.Purges Contexts.Purges Contexts.Purges Executions.Purges Executions.purgeExecutionsAsync(String parent) Purges Executions.Purges Executions.Purges Executions.final LineageSubgraphqueryArtifactLineageSubgraph(ArtifactName artifact) Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphRetrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphqueryArtifactLineageSubgraph(String artifact) Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphqueryContextLineageSubgraph(ContextName context) Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphRetrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphqueryContextLineageSubgraph(String context) Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.final LineageSubgraphqueryExecutionInputsAndOutputs(ExecutionName execution) Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.final LineageSubgraphObtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.final LineageSubgraphqueryExecutionInputsAndOutputs(String execution) Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.removeContextChildren(ContextName context, List<String> childContexts) Remove a set of children contexts from a parent Context.Remove a set of children contexts from a parent Context.removeContextChildren(String context, List<String> childContexts) Remove a set of children contexts from a parent Context.Remove a set of children contexts from a parent Context.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.final ArtifactupdateArtifact(Artifact artifact, com.google.protobuf.FieldMask updateMask) Updates a stored Artifact.final ArtifactupdateArtifact(UpdateArtifactRequest request) Updates a stored Artifact.Updates a stored Artifact.final ContextupdateContext(Context context, com.google.protobuf.FieldMask updateMask) Updates a stored Context.final ContextupdateContext(UpdateContextRequest request) Updates a stored Context.Updates a stored Context.final ExecutionupdateExecution(Execution execution, com.google.protobuf.FieldMask updateMask) Updates a stored Execution.final ExecutionupdateExecution(UpdateExecutionRequest request) Updates a stored Execution.Updates a stored Execution.
-
Constructor Details
-
MetadataServiceClient
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.- Throws:
IOException
-
MetadataServiceClient
-
-
Method Details
-
create
Constructs an instance of MetadataServiceClient with default settings.- Throws:
IOException
-
create
public static final MetadataServiceClient create(MetadataServiceSettings settings) throws IOException 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.- Throws:
IOException
-
create
Constructs an instance of MetadataServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(MetadataServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createMetadataStoreAsync
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:
parent- Required. The resource name of the Location where the MetadataStore should be created. Format: `projects/{project}/locations/{location}/`metadataStore- Required. The MetadataStore to create.metadataStoreId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createMetadataStoreAsync
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:
parent- Required. The resource name of the Location where the MetadataStore should be created. Format: `projects/{project}/locations/{location}/`metadataStore- Required. The MetadataStore to create.metadataStoreId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createMetadataStoreAsync
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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createMetadataStoreOperationCallable
public final OperationCallable<CreateMetadataStoreRequest,MetadataStore, createMetadataStoreOperationCallable()CreateMetadataStoreOperationMetadata> 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(); } -
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(); } -
getMetadataStore
Retrieves a specific 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 name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]"); MetadataStore response = metadataServiceClient.getMetadataStore(name); }- Parameters:
name- Required. The resource name of the MetadataStore to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
getMetadataStore
Retrieves a specific 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 name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString(); MetadataStore response = metadataServiceClient.getMetadataStore(name); }- Parameters:
name- Required. The resource name of the MetadataStore to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
getMetadataStore
Retrieves a specific 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()) { GetMetadataStoreRequest request = GetMetadataStoreRequest.newBuilder() .setName( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .build(); MetadataStore response = metadataServiceClient.getMetadataStore(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getMetadataStoreCallable
Retrieves a specific 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()) { GetMetadataStoreRequest request = GetMetadataStoreRequest.newBuilder() .setName( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .build(); ApiFuture<MetadataStore> future = metadataServiceClient.getMetadataStoreCallable().futureCall(request); // Do something. MetadataStore response = future.get(); } -
listMetadataStores
public final MetadataServiceClient.ListMetadataStoresPagedResponse listMetadataStores(LocationName parent) Lists MetadataStores for a Location.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]"); for (MetadataStore element : metadataServiceClient.listMetadataStores(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The Location whose MetadataStores should be listed. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listMetadataStores
public final MetadataServiceClient.ListMetadataStoresPagedResponse listMetadataStores(String parent) Lists MetadataStores for a Location.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(); for (MetadataStore element : metadataServiceClient.listMetadataStores(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The Location whose MetadataStores should be listed. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listMetadataStores
public final MetadataServiceClient.ListMetadataStoresPagedResponse listMetadataStores(ListMetadataStoresRequest request) Lists MetadataStores for a Location.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()) { ListMetadataStoresRequest request = ListMetadataStoresRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (MetadataStore element : metadataServiceClient.listMetadataStores(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listMetadataStoresPagedCallable
public final UnaryCallable<ListMetadataStoresRequest,MetadataServiceClient.ListMetadataStoresPagedResponse> listMetadataStoresPagedCallable()Lists MetadataStores for a Location.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()) { ListMetadataStoresRequest request = ListMetadataStoresRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<MetadataStore> future = metadataServiceClient.listMetadataStoresPagedCallable().futureCall(request); // Do something. for (MetadataStore element : future.get().iterateAll()) { // doThingsWith(element); } } -
listMetadataStoresCallable
public final UnaryCallable<ListMetadataStoresRequest,ListMetadataStoresResponse> listMetadataStoresCallable()Lists MetadataStores for a Location.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()) { ListMetadataStoresRequest request = ListMetadataStoresRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListMetadataStoresResponse response = metadataServiceClient.listMetadataStoresCallable().call(request); for (MetadataStore element : response.getMetadataStoresList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteMetadataStoreAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the MetadataStore to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
deleteMetadataStoreAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the MetadataStore to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
deleteMetadataStoreAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteMetadataStoreOperationCallable
public final OperationCallable<DeleteMetadataStoreRequest,com.google.protobuf.Empty, deleteMetadataStoreOperationCallable()DeleteMetadataStoreOperationMetadata> 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(); } -
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(); } -
createArtifact
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:
parent- Required. The resource name of the MetadataStore where the Artifact should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`artifact- Required. The Artifact to create.artifactId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The resource name of the MetadataStore where the Artifact should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`artifact- Required. The Artifact to create.artifactId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createArtifact
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
getArtifact
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); }- Parameters:
name- Required. The resource name of the Artifact to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`- Throws:
ApiException- if the remote call fails
-
getArtifact
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); }- Parameters:
name- Required. The resource name of the Artifact to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`- Throws:
ApiException- if the remote call fails
-
getArtifact
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
listArtifacts
public final MetadataServiceClient.ListArtifactsPagedResponse listArtifacts(MetadataStoreName parent) Lists Artifacts in the 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]"); for (Artifact element : metadataServiceClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Artifacts should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listArtifacts
Lists Artifacts in the 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(); for (Artifact element : metadataServiceClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Artifacts should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listArtifacts
public final MetadataServiceClient.ListArtifactsPagedResponse listArtifacts(ListArtifactsRequest request) Lists Artifacts in the 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Artifact element : metadataServiceClient.listArtifacts(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listArtifactsPagedCallable
public final UnaryCallable<ListArtifactsRequest,MetadataServiceClient.ListArtifactsPagedResponse> listArtifactsPagedCallable()Lists Artifacts in the 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Artifact> future = metadataServiceClient.listArtifactsPagedCallable().futureCall(request); // Do something. for (Artifact element : future.get().iterateAll()) { // doThingsWith(element); } } -
listArtifactsCallable
Lists Artifacts in the 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListArtifactsResponse response = metadataServiceClient.listArtifactsCallable().call(request); for (Artifact element : response.getArtifactsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateArtifact
Updates a stored 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()) { Artifact artifact = Artifact.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Artifact response = metadataServiceClient.updateArtifact(artifact, updateMask); }- Parameters:
artifact- Required. The Artifact containing updates. The Artifact's [Artifact.name][google.cloud.aiplatform.v1beta1.Artifact.name] field is used to identify the Artifact to be updated. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`updateMask- Optional. A FieldMask indicating which fields should be updated.- Throws:
ApiException- if the remote call fails
-
updateArtifact
Updates a stored 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()) { UpdateArtifactRequest request = UpdateArtifactRequest.newBuilder() .setArtifact(Artifact.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); Artifact response = metadataServiceClient.updateArtifact(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateArtifactCallable
Updates a stored 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()) { UpdateArtifactRequest request = UpdateArtifactRequest.newBuilder() .setArtifact(Artifact.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Artifact> future = metadataServiceClient.updateArtifactCallable().futureCall(request); // Do something. Artifact response = future.get(); } -
deleteArtifactAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Artifact to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`- Throws:
ApiException- if the remote call fails
-
deleteArtifactAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Artifact to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`- Throws:
ApiException- if the remote call fails
-
deleteArtifactAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteArtifactOperationCallable
public final OperationCallable<DeleteArtifactRequest,com.google.protobuf.Empty, deleteArtifactOperationCallable()DeleteOperationMetadata> 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(); } -
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(); } -
purgeArtifactsAsync
public final OperationFuture<PurgeArtifactsResponse,PurgeArtifactsMetadata> purgeArtifactsAsync(MetadataStoreName parent) Purges Artifacts.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]"); PurgeArtifactsResponse response = metadataServiceClient.purgeArtifactsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Artifacts from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeArtifactsAsync
public final OperationFuture<PurgeArtifactsResponse,PurgeArtifactsMetadata> purgeArtifactsAsync(String parent) Purges Artifacts.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(); PurgeArtifactsResponse response = metadataServiceClient.purgeArtifactsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Artifacts from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeArtifactsAsync
public final OperationFuture<PurgeArtifactsResponse,PurgeArtifactsMetadata> purgeArtifactsAsync(PurgeArtifactsRequest request) Purges Artifacts.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()) { PurgeArtifactsRequest request = PurgeArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); PurgeArtifactsResponse response = metadataServiceClient.purgeArtifactsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
purgeArtifactsOperationCallable
public final OperationCallable<PurgeArtifactsRequest,PurgeArtifactsResponse, purgeArtifactsOperationCallable()PurgeArtifactsMetadata> Purges Artifacts.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()) { PurgeArtifactsRequest request = PurgeArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); OperationFuture<PurgeArtifactsResponse, PurgeArtifactsMetadata> future = metadataServiceClient.purgeArtifactsOperationCallable().futureCall(request); // Do something. PurgeArtifactsResponse response = future.get(); } -
purgeArtifactsCallable
Purges Artifacts.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()) { PurgeArtifactsRequest request = PurgeArtifactsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); ApiFuture<Operation> future = metadataServiceClient.purgeArtifactsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createContext
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:
parent- Required. The resource name of the MetadataStore where the Context should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`context- Required. The Context to create.contextId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createContext
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:
parent- Required. The resource name of the MetadataStore where the Context should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`context- Required. The Context to create.contextId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createContext
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
getContext
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); }- Parameters:
name- Required. The resource name of the Context to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`- Throws:
ApiException- if the remote call fails
-
getContext
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); }- Parameters:
name- Required. The resource name of the Context to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`- Throws:
ApiException- if the remote call fails
-
getContext
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
listContexts
Lists Contexts on the 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]"); for (Context element : metadataServiceClient.listContexts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Contexts should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listContexts
Lists Contexts on the 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(); for (Context element : metadataServiceClient.listContexts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Contexts should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listContexts
public final MetadataServiceClient.ListContextsPagedResponse listContexts(ListContextsRequest request) Lists Contexts on the 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()) { ListContextsRequest request = ListContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Context element : metadataServiceClient.listContexts(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listContextsPagedCallable
public final UnaryCallable<ListContextsRequest,MetadataServiceClient.ListContextsPagedResponse> listContextsPagedCallable()Lists Contexts on the 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()) { ListContextsRequest request = ListContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Context> future = metadataServiceClient.listContextsPagedCallable().futureCall(request); // Do something. for (Context element : future.get().iterateAll()) { // doThingsWith(element); } } -
listContextsCallable
Lists Contexts on the 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()) { ListContextsRequest request = ListContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListContextsResponse response = metadataServiceClient.listContextsCallable().call(request); for (Context element : response.getContextsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateContext
Updates 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()) { Context context = Context.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Context response = metadataServiceClient.updateContext(context, updateMask); }- Parameters:
context- Required. The Context containing updates. The Context's [Context.name][google.cloud.aiplatform.v1beta1.Context.name] field is used to identify the Context to be updated. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`updateMask- Optional. A FieldMask indicating which fields should be updated.- Throws:
ApiException- if the remote call fails
-
updateContext
Updates 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()) { UpdateContextRequest request = UpdateContextRequest.newBuilder() .setContext(Context.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); Context response = metadataServiceClient.updateContext(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateContextCallable
Updates 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()) { UpdateContextRequest request = UpdateContextRequest.newBuilder() .setContext(Context.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Context> future = metadataServiceClient.updateContextCallable().futureCall(request); // Do something. Context response = future.get(); } -
deleteContextAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Context to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`- Throws:
ApiException- if the remote call fails
-
deleteContextAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Context to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`- Throws:
ApiException- if the remote call fails
-
deleteContextAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteContextOperationCallable
public final OperationCallable<DeleteContextRequest,com.google.protobuf.Empty, deleteContextOperationCallable()DeleteOperationMetadata> 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(); } -
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(); } -
purgeContextsAsync
public final OperationFuture<PurgeContextsResponse,PurgeContextsMetadata> purgeContextsAsync(MetadataStoreName parent) Purges 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 parent = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]"); PurgeContextsResponse response = metadataServiceClient.purgeContextsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Contexts from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeContextsAsync
public final OperationFuture<PurgeContextsResponse,PurgeContextsMetadata> purgeContextsAsync(String parent) Purges 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 parent = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString(); PurgeContextsResponse response = metadataServiceClient.purgeContextsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Contexts from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeContextsAsync
public final OperationFuture<PurgeContextsResponse,PurgeContextsMetadata> purgeContextsAsync(PurgeContextsRequest request) Purges 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()) { PurgeContextsRequest request = PurgeContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); PurgeContextsResponse response = metadataServiceClient.purgeContextsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
purgeContextsOperationCallable
public final OperationCallable<PurgeContextsRequest,PurgeContextsResponse, purgeContextsOperationCallable()PurgeContextsMetadata> Purges 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()) { PurgeContextsRequest request = PurgeContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); OperationFuture<PurgeContextsResponse, PurgeContextsMetadata> future = metadataServiceClient.purgeContextsOperationCallable().futureCall(request); // Do something. PurgeContextsResponse response = future.get(); } -
purgeContextsCallable
Purges 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()) { PurgeContextsRequest request = PurgeContextsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); ApiFuture<Operation> future = metadataServiceClient.purgeContextsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
addContextArtifactsAndExecutions
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:
context- Required. The resource name of the Context that the Artifacts and Executions belong to. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`artifacts- The resource names of the Artifacts to attribute to the Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
executions- The resource names of the Executions to associate with the Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
- Throws:
ApiException- if the remote call fails
-
addContextArtifactsAndExecutions
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:
context- Required. The resource name of the Context that the Artifacts and Executions belong to. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`artifacts- The resource names of the Artifacts to attribute to the Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
executions- The resource names of the Executions to associate with the Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
- Throws:
ApiException- if the remote call fails
-
addContextArtifactsAndExecutions
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
addContextChildren
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:
context- Required. The resource name of the parent Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
childContexts- The resource names of the child Contexts.- Throws:
ApiException- if the remote call fails
-
addContextChildren
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:
context- Required. The resource name of the parent Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
childContexts- The resource names of the child Contexts.- Throws:
ApiException- if the remote call fails
-
addContextChildren
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
removeContextChildren
public final RemoveContextChildrenResponse removeContextChildren(ContextName context, List<String> childContexts) Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent 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> childContexts = new ArrayList<>(); RemoveContextChildrenResponse response = metadataServiceClient.removeContextChildren(context, childContexts); }- Parameters:
context- Required. The resource name of the parent Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
childContexts- The resource names of the child Contexts.- Throws:
ApiException- if the remote call fails
-
removeContextChildren
public final RemoveContextChildrenResponse removeContextChildren(String context, List<String> childContexts) Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent 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> childContexts = new ArrayList<>(); RemoveContextChildrenResponse response = metadataServiceClient.removeContextChildren(context, childContexts); }- Parameters:
context- Required. The resource name of the parent Context.Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
childContexts- The resource names of the child Contexts.- Throws:
ApiException- if the remote call fails
-
removeContextChildren
public final RemoveContextChildrenResponse removeContextChildren(RemoveContextChildrenRequest request) Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent 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()) { RemoveContextChildrenRequest request = RemoveContextChildrenRequest.newBuilder() .setContext( ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]") .toString()) .addAllChildContexts(new ArrayList<String>()) .build(); RemoveContextChildrenResponse response = metadataServiceClient.removeContextChildren(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeContextChildrenCallable
public final UnaryCallable<RemoveContextChildrenRequest,RemoveContextChildrenResponse> removeContextChildrenCallable()Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent 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()) { RemoveContextChildrenRequest request = RemoveContextChildrenRequest.newBuilder() .setContext( ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]") .toString()) .addAllChildContexts(new ArrayList<String>()) .build(); ApiFuture<RemoveContextChildrenResponse> future = metadataServiceClient.removeContextChildrenCallable().futureCall(request); // Do something. RemoveContextChildrenResponse response = future.get(); } -
queryContextLineageSubgraph
Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.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]"); LineageSubgraph response = metadataServiceClient.queryContextLineageSubgraph(context); }- Parameters:
context- Required. The resource name of the Context whose Artifacts and Executions should be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`The request may error with FAILED_PRECONDITION if the number of Artifacts, the number of Executions, or the number of Events that would be returned for the Context exceeds 1000.
- Throws:
ApiException- if the remote call fails
-
queryContextLineageSubgraph
Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.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(); LineageSubgraph response = metadataServiceClient.queryContextLineageSubgraph(context); }- Parameters:
context- Required. The resource name of the Context whose Artifacts and Executions should be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`The request may error with FAILED_PRECONDITION if the number of Artifacts, the number of Executions, or the number of Events that would be returned for the Context exceeds 1000.
- Throws:
ApiException- if the remote call fails
-
queryContextLineageSubgraph
public final LineageSubgraph queryContextLineageSubgraph(QueryContextLineageSubgraphRequest request) Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.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()) { QueryContextLineageSubgraphRequest request = QueryContextLineageSubgraphRequest.newBuilder() .setContext( ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]") .toString()) .build(); LineageSubgraph response = metadataServiceClient.queryContextLineageSubgraph(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
queryContextLineageSubgraphCallable
public final UnaryCallable<QueryContextLineageSubgraphRequest,LineageSubgraph> queryContextLineageSubgraphCallable()Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.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()) { QueryContextLineageSubgraphRequest request = QueryContextLineageSubgraphRequest.newBuilder() .setContext( ContextName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[CONTEXT]") .toString()) .build(); ApiFuture<LineageSubgraph> future = metadataServiceClient.queryContextLineageSubgraphCallable().futureCall(request); // Do something. LineageSubgraph response = future.get(); } -
createExecution
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:
parent- Required. The resource name of the MetadataStore where the Execution should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`execution- Required. The Execution to create.executionId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createExecution
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:
parent- Required. The resource name of the MetadataStore where the Execution should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`execution- Required. The Execution to create.executionId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createExecution
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
getExecution
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); }- Parameters:
name- Required. The resource name of the Execution to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
getExecution
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()) { String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]").toString(); Execution response = metadataServiceClient.getExecution(name); }- Parameters:
name- Required. The resource name of the Execution to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
getExecution
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getExecutionCallable
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(); ApiFuture<Execution> future = metadataServiceClient.getExecutionCallable().futureCall(request); // Do something. Execution response = future.get(); } -
listExecutions
public final MetadataServiceClient.ListExecutionsPagedResponse listExecutions(MetadataStoreName parent) Lists Executions in the 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]"); for (Execution element : metadataServiceClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Executions should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listExecutions
Lists Executions in the 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(); for (Execution element : metadataServiceClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose Executions should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listExecutions
public final MetadataServiceClient.ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) Lists Executions in the 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Execution element : metadataServiceClient.listExecutions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listExecutionsPagedCallable
public final UnaryCallable<ListExecutionsRequest,MetadataServiceClient.ListExecutionsPagedResponse> listExecutionsPagedCallable()Lists Executions in the 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Execution> future = metadataServiceClient.listExecutionsPagedCallable().futureCall(request); // Do something. for (Execution element : future.get().iterateAll()) { // doThingsWith(element); } } -
listExecutionsCallable
Lists Executions in the 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListExecutionsResponse response = metadataServiceClient.listExecutionsCallable().call(request); for (Execution element : response.getExecutionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateExecution
public final Execution updateExecution(Execution execution, com.google.protobuf.FieldMask updateMask) Updates a stored 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()) { Execution execution = Execution.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Execution response = metadataServiceClient.updateExecution(execution, updateMask); }- Parameters:
execution- Required. The Execution containing updates. The Execution's [Execution.name][google.cloud.aiplatform.v1beta1.Execution.name] field is used to identify the Execution to be updated. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`updateMask- Optional. A FieldMask indicating which fields should be updated.- Throws:
ApiException- if the remote call fails
-
updateExecution
Updates a stored 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()) { UpdateExecutionRequest request = UpdateExecutionRequest.newBuilder() .setExecution(Execution.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); Execution response = metadataServiceClient.updateExecution(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateExecutionCallable
Updates a stored 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()) { UpdateExecutionRequest request = UpdateExecutionRequest.newBuilder() .setExecution(Execution.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Execution> future = metadataServiceClient.updateExecutionCallable().futureCall(request); // Do something. Execution response = future.get(); } -
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Execution to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The resource name of the Execution to delete. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteExecutionOperationCallable
public final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, deleteExecutionOperationCallable()DeleteOperationMetadata> 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(); } -
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(); } -
purgeExecutionsAsync
public final OperationFuture<PurgeExecutionsResponse,PurgeExecutionsMetadata> purgeExecutionsAsync(MetadataStoreName parent) Purges Executions.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]"); PurgeExecutionsResponse response = metadataServiceClient.purgeExecutionsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Executions from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeExecutionsAsync
public final OperationFuture<PurgeExecutionsResponse,PurgeExecutionsMetadata> purgeExecutionsAsync(String parent) Purges Executions.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(); PurgeExecutionsResponse response = metadataServiceClient.purgeExecutionsAsync(parent).get(); }- Parameters:
parent- Required. The metadata store to purge Executions from. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
purgeExecutionsAsync
public final OperationFuture<PurgeExecutionsResponse,PurgeExecutionsMetadata> purgeExecutionsAsync(PurgeExecutionsRequest request) Purges Executions.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()) { PurgeExecutionsRequest request = PurgeExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); PurgeExecutionsResponse response = metadataServiceClient.purgeExecutionsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
purgeExecutionsOperationCallable
public final OperationCallable<PurgeExecutionsRequest,PurgeExecutionsResponse, purgeExecutionsOperationCallable()PurgeExecutionsMetadata> Purges Executions.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()) { PurgeExecutionsRequest request = PurgeExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); OperationFuture<PurgeExecutionsResponse, PurgeExecutionsMetadata> future = metadataServiceClient.purgeExecutionsOperationCallable().futureCall(request); // Do something. PurgeExecutionsResponse response = future.get(); } -
purgeExecutionsCallable
Purges Executions.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()) { PurgeExecutionsRequest request = PurgeExecutionsRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); ApiFuture<Operation> future = metadataServiceClient.purgeExecutionsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
addExecutionEvents
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:
execution- Required. The resource name of the Execution that the Events connect Artifacts with. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`events- The Events to create and add.- Throws:
ApiException- if the remote call fails
-
addExecutionEvents
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:
execution- Required. The resource name of the Execution that the Events connect Artifacts with. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`events- The Events to create and add.- Throws:
ApiException- if the remote call fails
-
addExecutionEvents
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
queryExecutionInputsAndOutputs
Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.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]"); LineageSubgraph response = metadataServiceClient.queryExecutionInputsAndOutputs(execution); }- Parameters:
execution- Required. The resource name of the Execution whose input and output Artifacts should be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
queryExecutionInputsAndOutputs
Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.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(); LineageSubgraph response = metadataServiceClient.queryExecutionInputsAndOutputs(execution); }- Parameters:
execution- Required. The resource name of the Execution whose input and output Artifacts should be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`- Throws:
ApiException- if the remote call fails
-
queryExecutionInputsAndOutputs
public final LineageSubgraph queryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest request) Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.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()) { QueryExecutionInputsAndOutputsRequest request = QueryExecutionInputsAndOutputsRequest.newBuilder() .setExecution( ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]") .toString()) .build(); LineageSubgraph response = metadataServiceClient.queryExecutionInputsAndOutputs(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
queryExecutionInputsAndOutputsCallable
public final UnaryCallable<QueryExecutionInputsAndOutputsRequest,LineageSubgraph> queryExecutionInputsAndOutputsCallable()Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.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()) { QueryExecutionInputsAndOutputsRequest request = QueryExecutionInputsAndOutputsRequest.newBuilder() .setExecution( ExecutionName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[EXECUTION]") .toString()) .build(); ApiFuture<LineageSubgraph> future = metadataServiceClient.queryExecutionInputsAndOutputsCallable().futureCall(request); // Do something. LineageSubgraph response = future.get(); } -
createMetadataSchema
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:
parent- Required. The resource name of the MetadataStore where the MetadataSchema should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`metadataSchema- Required. The MetadataSchema to create.metadataSchemaId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createMetadataSchema
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:
parent- Required. The resource name of the MetadataStore where the MetadataSchema should be created. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`metadataSchema- Required. The MetadataSchema to create.metadataSchemaId- 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][0-9]-/`. 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.)- Throws:
ApiException- if the remote call fails
-
createMetadataSchema
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
getMetadataSchema
Retrieves a specific 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()) { MetadataSchemaName name = MetadataSchemaName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[METADATA_SCHEMA]"); MetadataSchema response = metadataServiceClient.getMetadataSchema(name); }- Parameters:
name- Required. The resource name of the MetadataSchema to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}`- Throws:
ApiException- if the remote call fails
-
getMetadataSchema
Retrieves a specific 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 name = MetadataSchemaName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[METADATA_SCHEMA]") .toString(); MetadataSchema response = metadataServiceClient.getMetadataSchema(name); }- Parameters:
name- Required. The resource name of the MetadataSchema to retrieve. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}`- Throws:
ApiException- if the remote call fails
-
getMetadataSchema
Retrieves a specific 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()) { GetMetadataSchemaRequest request = GetMetadataSchemaRequest.newBuilder() .setName( MetadataSchemaName.of( "[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[METADATA_SCHEMA]") .toString()) .build(); MetadataSchema response = metadataServiceClient.getMetadataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getMetadataSchemaCallable
Retrieves a specific 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()) { GetMetadataSchemaRequest request = GetMetadataSchemaRequest.newBuilder() .setName( MetadataSchemaName.of( "[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[METADATA_SCHEMA]") .toString()) .build(); ApiFuture<MetadataSchema> future = metadataServiceClient.getMetadataSchemaCallable().futureCall(request); // Do something. MetadataSchema response = future.get(); } -
listMetadataSchemas
public final MetadataServiceClient.ListMetadataSchemasPagedResponse listMetadataSchemas(MetadataStoreName parent) Lists MetadataSchemas.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]"); for (MetadataSchema element : metadataServiceClient.listMetadataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose MetadataSchemas should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listMetadataSchemas
public final MetadataServiceClient.ListMetadataSchemasPagedResponse listMetadataSchemas(String parent) Lists MetadataSchemas.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(); for (MetadataSchema element : metadataServiceClient.listMetadataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The MetadataStore whose MetadataSchemas should be listed. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}`- Throws:
ApiException- if the remote call fails
-
listMetadataSchemas
public final MetadataServiceClient.ListMetadataSchemasPagedResponse listMetadataSchemas(ListMetadataSchemasRequest request) Lists MetadataSchemas.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()) { ListMetadataSchemasRequest request = ListMetadataSchemasRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (MetadataSchema element : metadataServiceClient.listMetadataSchemas(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listMetadataSchemasPagedCallable
public final UnaryCallable<ListMetadataSchemasRequest,MetadataServiceClient.ListMetadataSchemasPagedResponse> listMetadataSchemasPagedCallable()Lists MetadataSchemas.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()) { ListMetadataSchemasRequest request = ListMetadataSchemasRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<MetadataSchema> future = metadataServiceClient.listMetadataSchemasPagedCallable().futureCall(request); // Do something. for (MetadataSchema element : future.get().iterateAll()) { // doThingsWith(element); } } -
listMetadataSchemasCallable
public final UnaryCallable<ListMetadataSchemasRequest,ListMetadataSchemasResponse> listMetadataSchemasCallable()Lists MetadataSchemas.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()) { ListMetadataSchemasRequest request = ListMetadataSchemasRequest.newBuilder() .setParent( MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListMetadataSchemasResponse response = metadataServiceClient.listMetadataSchemasCallable().call(request); for (MetadataSchema element : response.getMetadataSchemasList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
queryArtifactLineageSubgraph
Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.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 artifact = ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]"); LineageSubgraph response = metadataServiceClient.queryArtifactLineageSubgraph(artifact); }- Parameters:
artifact- Required. The resource name of the Artifact whose Lineage needs to be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`The request may error with FAILED_PRECONDITION if the number of Artifacts, the number of Executions, or the number of Events that would be returned for the Context exceeds 1000.
- Throws:
ApiException- if the remote call fails
-
queryArtifactLineageSubgraph
Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.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 artifact = ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]").toString(); LineageSubgraph response = metadataServiceClient.queryArtifactLineageSubgraph(artifact); }- Parameters:
artifact- Required. The resource name of the Artifact whose Lineage needs to be retrieved as a LineageSubgraph. Format: `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`The request may error with FAILED_PRECONDITION if the number of Artifacts, the number of Executions, or the number of Events that would be returned for the Context exceeds 1000.
- Throws:
ApiException- if the remote call fails
-
queryArtifactLineageSubgraph
public final LineageSubgraph queryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest request) Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.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()) { QueryArtifactLineageSubgraphRequest request = QueryArtifactLineageSubgraphRequest.newBuilder() .setArtifact( ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]") .toString()) .setMaxHops(407750469) .setFilter("filter-1274492040") .build(); LineageSubgraph response = metadataServiceClient.queryArtifactLineageSubgraph(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
queryArtifactLineageSubgraphCallable
public final UnaryCallable<QueryArtifactLineageSubgraphRequest,LineageSubgraph> queryArtifactLineageSubgraphCallable()Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.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()) { QueryArtifactLineageSubgraphRequest request = QueryArtifactLineageSubgraphRequest.newBuilder() .setArtifact( ArtifactName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]", "[ARTIFACT]") .toString()) .setMaxHops(407750469) .setFilter("filter-1274492040") .build(); ApiFuture<LineageSubgraph> future = metadataServiceClient.queryArtifactLineageSubgraphCallable().futureCall(request); // Do something. LineageSubgraph response = future.get(); } -
listLocations
public final MetadataServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : metadataServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,MetadataServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = metadataServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = metadataServiceClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = metadataServiceClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = metadataServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = metadataServiceClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = metadataServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = metadataServiceClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = metadataServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = metadataServiceClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = metadataServiceClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-