Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class MetadataServiceClient.
Service Description: Service for reading and writing metadata entries.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->addContextArtifactsAndExecutions($formattedContext);
} finally {
$metadataServiceClient->close();
}
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 parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Methods
artifactName
Formats a string containing the fully-qualified path to represent a artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
metadataStore |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted artifact resource. |
contextName
Formats a string containing the fully-qualified path to represent a context resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
metadataStore |
string
|
context |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted context resource. |
executionName
Formats a string containing the fully-qualified path to represent a execution resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
metadataStore |
string
|
execution |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted execution resource. |
locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted location resource. |
metadataSchemaName
Formats a string containing the fully-qualified path to represent a metadata_schema resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
metadataStore |
string
|
metadataSchema |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted metadata_schema resource. |
metadataStoreName
Formats a string containing the fully-qualified path to represent a metadata_store resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
metadataStore |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted metadata_store resource. |
parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- artifact: projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}
- context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}
- execution: projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}
- location: projects/{project}/locations/{location}
- metadataSchema: projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}
- metadataStore: projects/{project}/locations/{location}/metadataStores/{metadata_store}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array | An associative array from name component IDs to component values. |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\ApiCore\LongRunning\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed {@see} object or {@see} object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see {@see} . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the {@see} and {@see} methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
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.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->addContextArtifactsAndExecutions($formattedContext);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
context |
string
Required. The resource name of the Context that the Artifacts and Executions belong to. Format: |
optionalArgs |
array
Optional. |
↳ artifacts |
string[]
The resource names of the Artifacts to attribute to the Context. Format: |
↳ executions |
string[]
The resource names of the Executions to associate with the Context. Format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse |
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:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->addContextChildren($formattedContext);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
context |
string
Required. The resource name of the parent Context. Format: |
optionalArgs |
array
Optional. |
↳ childContexts |
string[]
The resource names of the child Contexts. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddContextChildrenResponse |
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:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedExecution = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]');
$response = $metadataServiceClient->addExecutionEvents($formattedExecution);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
execution |
string
Required. The resource name of the Execution that the Events connect Artifacts with. Format: |
optionalArgs |
array
Optional. |
↳ events |
Event[]
The Events to create and add. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse |
createArtifact
Creates an Artifact associated with a MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$artifact = new Artifact();
$response = $metadataServiceClient->createArtifact($formattedParent, $artifact);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The resource name of the MetadataStore where the Artifact should be created. Format: |
artifact |
Google\Cloud\AIPlatform\V1\Artifact
Required. The Artifact to create. |
optionalArgs |
array
Optional. |
↳ artifactId |
string
The {artifact} portion of the resource name with the format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
createContext
Creates a Context associated with a MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$context = new Context();
$response = $metadataServiceClient->createContext($formattedParent, $context);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The resource name of the MetadataStore where the Context should be created. Format: |
context |
Google\Cloud\AIPlatform\V1\Context
Required. The Context to create. |
optionalArgs |
array
Optional. |
↳ contextId |
string
The {context} portion of the resource name with the format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
createExecution
Creates an Execution associated with a MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$execution = new Execution();
$response = $metadataServiceClient->createExecution($formattedParent, $execution);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The resource name of the MetadataStore where the Execution should be created. Format: |
execution |
Google\Cloud\AIPlatform\V1\Execution
Required. The Execution to create. |
optionalArgs |
array
Optional. |
↳ executionId |
string
The {execution} portion of the resource name with the format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
createMetadataSchema
Creates a MetadataSchema.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$metadataSchema = new MetadataSchema();
$response = $metadataServiceClient->createMetadataSchema($formattedParent, $metadataSchema);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The resource name of the MetadataStore where the MetadataSchema should be created. Format: |
metadataSchema |
Google\Cloud\AIPlatform\V1\MetadataSchema
Required. The MetadataSchema to create. |
optionalArgs |
array
Optional. |
↳ metadataSchemaId |
string
The {metadata_schema} portion of the resource name with the format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataSchema |
createMetadataStore
Initializes a MetadataStore, including allocation of resources.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->locationName('[PROJECT]', '[LOCATION]');
$metadataStore = new MetadataStore();
$operationResponse = $metadataServiceClient->createMetadataStore($formattedParent, $metadataStore);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->createMetadataStore($formattedParent, $metadataStore);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'createMetadataStore');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The resource name of the Location where the MetadataStore should be created. Format: |
metadataStore |
Google\Cloud\AIPlatform\V1\MetadataStore
Required. The MetadataStore to create. |
optionalArgs |
array
Optional. |
↳ metadataStoreId |
string
The {metadatastore} portion of the resource name with the format: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
deleteArtifact
Deletes an Artifact.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]');
$operationResponse = $metadataServiceClient->deleteArtifact($formattedName);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->deleteArtifact($formattedName);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteArtifact');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Artifact to delete. Format: |
optionalArgs |
array
Optional. |
↳ etag |
string
Optional. The etag of the Artifact to delete. If this is provided, it must match the server's etag. Otherwise, the request will fail with a FAILED_PRECONDITION. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
deleteContext
Deletes a stored Context.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$operationResponse = $metadataServiceClient->deleteContext($formattedName);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->deleteContext($formattedName);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteContext');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Context to delete. Format: |
optionalArgs |
array
Optional. |
↳ force |
bool
The force deletion semantics is still undefined. Users should not use this field. |
↳ etag |
string
Optional. The etag of the Context to delete. If this is provided, it must match the server's etag. Otherwise, the request will fail with a FAILED_PRECONDITION. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
deleteExecution
Deletes an Execution.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]');
$operationResponse = $metadataServiceClient->deleteExecution($formattedName);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->deleteExecution($formattedName);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteExecution');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Execution to delete. Format: |
optionalArgs |
array
Optional. |
↳ etag |
string
Optional. The etag of the Execution to delete. If this is provided, it must match the server's etag. Otherwise, the request will fail with a FAILED_PRECONDITION. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
deleteMetadataStore
Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$operationResponse = $metadataServiceClient->deleteMetadataStore($formattedName);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->deleteMetadataStore($formattedName);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'deleteMetadataStore');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
// operation succeeded and returns no value
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the MetadataStore to delete. Format: |
optionalArgs |
array
Optional. |
↳ force |
bool
Deprecated: Field is no longer supported. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
getArtifact
Retrieves a specific Artifact.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]');
$response = $metadataServiceClient->getArtifact($formattedName);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Artifact to retrieve. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
getContext
Retrieves a specific Context.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->getContext($formattedName);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Context to retrieve. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
getExecution
Retrieves a specific Execution.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]');
$response = $metadataServiceClient->getExecution($formattedName);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the Execution to retrieve. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
getMetadataSchema
Retrieves a specific MetadataSchema.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->metadataSchemaName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[METADATA_SCHEMA]');
$response = $metadataServiceClient->getMetadataSchema($formattedName);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the MetadataSchema to retrieve. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataSchema |
getMetadataStore
Retrieves a specific MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedName = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$response = $metadataServiceClient->getMetadataStore($formattedName);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The resource name of the MetadataStore to retrieve. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataStore |
listArtifacts
Lists Artifacts in the MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listArtifacts($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listArtifacts($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The MetadataStore whose Artifacts should be listed. Format: |
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ filter |
string
Filter specifying the boolean condition for the Artifacts to satisfy in order to be part of the result set. The syntax to define filter query is based on https://google.aip.dev/160. The supported set of filters include the following: * Attribute filtering: For example: |
↳ orderBy |
string
How the list of messages is ordered. Specify the values to order by and an ordering operation. The default sorting order is ascending. To specify descending order for a field, users append a " desc" suffix; for example: "foo desc, bar". Subfields are specified with a |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listContexts
Lists Contexts on the MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listContexts($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listContexts($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The MetadataStore whose Contexts should be listed. Format: |
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ filter |
string
Filter specifying the boolean condition for the Contexts to satisfy in order to be part of the result set. The syntax to define filter query is based on https://google.aip.dev/160. Following are the supported set of filters: * Attribute filtering: For example: |
↳ orderBy |
string
How the list of messages is ordered. Specify the values to order by and an ordering operation. The default sorting order is ascending. To specify descending order for a field, users append a " desc" suffix; for example: "foo desc, bar". Subfields are specified with a |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listExecutions
Lists Executions in the MetadataStore.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listExecutions($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listExecutions($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The MetadataStore whose Executions should be listed. Format: |
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ filter |
string
Filter specifying the boolean condition for the Executions to satisfy in order to be part of the result set. The syntax to define filter query is based on https://google.aip.dev/160. Following are the supported set of filters: * Attribute filtering: For example: |
↳ orderBy |
string
How the list of messages is ordered. Specify the values to order by and an ordering operation. The default sorting order is ascending. To specify descending order for a field, users append a " desc" suffix; for example: "foo desc, bar". Subfields are specified with a |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listMetadataSchemas
Lists MetadataSchemas.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listMetadataSchemas($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listMetadataSchemas($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The MetadataStore whose MetadataSchemas should be listed. Format: |
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ filter |
string
A query to filter available MetadataSchemas for matching results. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listMetadataStores
Lists MetadataStores for a Location.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->locationName('[PROJECT]', '[LOCATION]');
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listMetadataStores($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listMetadataStores($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The Location whose MetadataStores should be listed. Format: |
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
purgeArtifacts
Purges Artifacts.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$filter = 'filter';
$operationResponse = $metadataServiceClient->purgeArtifacts($formattedParent, $filter);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->purgeArtifacts($formattedParent, $filter);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeArtifacts');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The metadata store to purge Artifacts from. Format: |
filter |
string
Required. A required filter matching the Artifacts to be purged. E.g., |
optionalArgs |
array
Optional. |
↳ force |
bool
Optional. Flag to indicate to actually perform the purge. If |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
purgeContexts
Purges Contexts.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$filter = 'filter';
$operationResponse = $metadataServiceClient->purgeContexts($formattedParent, $filter);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->purgeContexts($formattedParent, $filter);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeContexts');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The metadata store to purge Contexts from. Format: |
filter |
string
Required. A required filter matching the Contexts to be purged. E.g., |
optionalArgs |
array
Optional. |
↳ force |
bool
Optional. Flag to indicate to actually perform the purge. If |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
purgeExecutions
Purges Executions.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedParent = $metadataServiceClient->metadataStoreName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]');
$filter = 'filter';
$operationResponse = $metadataServiceClient->purgeExecutions($formattedParent, $filter);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $metadataServiceClient->purgeExecutions($formattedParent, $filter);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $metadataServiceClient->resumeOperation($operationName, 'purgeExecutions');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The metadata store to purge Executions from. Format: |
filter |
string
Required. A required filter matching the Executions to be purged. E.g., |
optionalArgs |
array
Optional. |
↳ force |
bool
Optional. Flag to indicate to actually perform the purge. If |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
queryArtifactLineageSubgraph
Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedArtifact = $metadataServiceClient->artifactName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[ARTIFACT]');
$response = $metadataServiceClient->queryArtifactLineageSubgraph($formattedArtifact);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
artifact |
string
Required. The resource name of the Artifact whose Lineage needs to be retrieved as a LineageSubgraph. Format: |
optionalArgs |
array
Optional. |
↳ maxHops |
int
Specifies the size of the lineage graph in terms of number of hops from the specified artifact. Negative Value: INVALID_ARGUMENT error is returned 0: Only input artifact is returned. No value: Transitive closure is performed to return the complete graph. |
↳ filter |
string
Filter specifying the boolean condition for the Artifacts to satisfy in order to be part of the Lineage Subgraph. The syntax to define filter query is based on https://google.aip.dev/160. The supported set of filters include the following: * Attribute filtering: For example: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
queryContextLineageSubgraph
Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->queryContextLineageSubgraph($formattedContext);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
context |
string
Required. The resource name of the Context whose Artifacts and Executions should be retrieved as a LineageSubgraph. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
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:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedExecution = $metadataServiceClient->executionName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[EXECUTION]');
$response = $metadataServiceClient->queryExecutionInputsAndOutputs($formattedExecution);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
execution |
string
Required. The resource name of the Execution whose input and output Artifacts should be retrieved as a LineageSubgraph. Format: |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
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.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$formattedContext = $metadataServiceClient->contextName('[PROJECT]', '[LOCATION]', '[METADATA_STORE]', '[CONTEXT]');
$response = $metadataServiceClient->removeContextChildren($formattedContext);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
context |
string
Required. The resource name of the parent Context. Format: |
optionalArgs |
array
Optional. |
↳ childContexts |
string[]
The resource names of the child Contexts. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse |
updateArtifact
Updates a stored Artifact.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$artifact = new Artifact();
$response = $metadataServiceClient->updateArtifact($artifact);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
artifact |
Google\Cloud\AIPlatform\V1\Artifact
Required. The Artifact containing updates. The Artifact's Artifact.name field is used to identify the Artifact to be updated. Format: |
optionalArgs |
array
Optional. |
↳ updateMask |
FieldMask
Optional. A FieldMask indicating which fields should be updated. Functionality of this field is not yet supported. |
↳ allowMissing |
bool
If set to true, and the Artifact is not found, a new Artifact is created. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
updateContext
Updates a stored Context.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$context = new Context();
$response = $metadataServiceClient->updateContext($context);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
context |
Google\Cloud\AIPlatform\V1\Context
Required. The Context containing updates. The Context's Context.name field is used to identify the Context to be updated. Format: |
optionalArgs |
array
Optional. |
↳ updateMask |
FieldMask
Optional. A FieldMask indicating which fields should be updated. Functionality of this field is not yet supported. |
↳ allowMissing |
bool
If set to true, and the Context is not found, a new Context is created. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
updateExecution
Updates a stored Execution.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$execution = new Execution();
$response = $metadataServiceClient->updateExecution($execution);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
execution |
Google\Cloud\AIPlatform\V1\Execution
Required. The Execution containing updates. The Execution's Execution.name field is used to identify the Execution to be updated. Format: |
optionalArgs |
array
Optional. |
↳ updateMask |
FieldMask
Optional. A FieldMask indicating which fields should be updated. Functionality of this field is not yet supported. |
↳ allowMissing |
bool
If set to true, and the Execution is not found, a new Execution is created. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
getLocation
Gets information about a location.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$response = $metadataServiceClient->getLocation();
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
optionalArgs |
array
Optional. |
↳ name |
string
Resource name for the location. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
listLocations
Lists information about the supported locations for this service.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
// Iterate over pages of elements
$pagedResponse = $metadataServiceClient->listLocations();
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $metadataServiceClient->listLocations();
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
optionalArgs |
array
Optional. |
↳ name |
string
The resource that owns the locations collection, if applicable. |
↳ filter |
string
The standard list filter. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
getIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$resource = 'resource';
$response = $metadataServiceClient->getIamPolicy($resource);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
resource |
string
REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
optionalArgs |
array
Optional. |
↳ options |
GetPolicyOptions
OPTIONAL: A |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
setIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$resource = 'resource';
$policy = new Policy();
$response = $metadataServiceClient->setIamPolicy($resource, $policy);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
resource |
string
REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy |
Google\Cloud\Iam\V1\Policy
REQUIRED: The complete policy to be applied to the |
optionalArgs |
array
Optional. |
↳ updateMask |
FieldMask
OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
testIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND
error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
Sample code:
$metadataServiceClient = new MetadataServiceClient();
try {
$resource = 'resource';
$permissions = [];
$response = $metadataServiceClient->testIamPermissions($resource, $permissions);
} finally {
$metadataServiceClient->close();
}
Parameters | |
---|---|
Name | Description |
resource |
string
REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions |
string[]
The set of permissions to check for the |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a {@see} object, or an associative array of retry settings parameters. See the documentation on {@see} for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
Constants
SERVICE_NAME
Value: 'google.cloud.aiplatform.v1.MetadataService'
The name of the service.
SERVICE_ADDRESS
Value: 'aiplatform.googleapis.com'
The default address of the service.
DEFAULT_SERVICE_PORT
Value: 443
The default port of the service.
CODEGEN_NAME
Value: 'gapic'
The name of the code generator, to be included in the agent header.