Google Cloud Ai Platform V1 Client - Class MetadataServiceClient (0.10.0)

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
NameDescription
project string
location string
metadataStore string
artifact string
Returns
TypeDescription
stringThe formatted artifact resource.

contextName

Formats a string containing the fully-qualified path to represent a context resource.

Parameters
NameDescription
project string
location string
metadataStore string
context string
Returns
TypeDescription
stringThe formatted context resource.

executionName

Formats a string containing the fully-qualified path to represent a execution resource.

Parameters
NameDescription
project string
location string
metadataStore string
execution string
Returns
TypeDescription
stringThe formatted execution resource.

locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

metadataSchemaName

Formats a string containing the fully-qualified path to represent a metadata_schema resource.

Parameters
NameDescription
project string
location string
metadataStore string
metadataSchema string
Returns
TypeDescription
stringThe formatted metadata_schema resource.

metadataStoreName

Formats a string containing the fully-qualified path to represent a metadata_store resource.

Parameters
NameDescription
project string
location string
metadataStore string
Returns
TypeDescription
stringThe 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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
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
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

__construct

Constructor.

Parameters
NameDescription
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 false.

↳ 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 rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated {@see} object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ 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
NameDescription
context string

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

optionalArgs array

Optional.

↳ artifacts string[]

The resource names of the Artifacts to attribute to the Context. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

↳ executions string[]

The resource names of the Executions to associate with the Context. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

↳ 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
TypeDescription
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
NameDescription
context string

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

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
TypeDescription
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
NameDescription
execution string

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

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
TypeDescription
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
NameDescription
parent string

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

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: 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.)

↳ 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
TypeDescription
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
NameDescription
parent string

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

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: 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.)

↳ 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
TypeDescription
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
NameDescription
parent string

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

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: 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.)

↳ 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
TypeDescription
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
NameDescription
parent string

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

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: 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.)

↳ 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
TypeDescription
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
NameDescription
parent string

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

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: 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.)

↳ 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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
name string

Required. The resource name of the MetadataSchema to retrieve. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}

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
TypeDescription
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
NameDescription
name string

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

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
TypeDescription
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
NameDescription
parent string

Required. The MetadataStore whose Artifacts should be listed. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

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: display_name = "test". Supported fields include: name, display_name, uri, state, schema_title, create_time, and update_time. Time fields, such as create_time and update_time, require values specified in RFC-3339 format. For example: create_time = "2020-11-19T11:30:00-04:00" * Metadata field: To filter on metadata fields use traversal operation as follows: metadata.<field_name>.<type_value>. For example: metadata.field_1.number_value = 10.0 * Context based filtering: To filter Artifacts based on the contexts to which they belong, use the function operator with the full resource name in_context(<context-name>). For example: in_context("projects/<project_number>/locations/<location>/metadataStores/<metadatastore_name>/contexts/<context-id>") Each of the above supported filter types can be combined together using logical operators (AND & OR). Maximum nested expression depth allowed is 5. For example: display_name = "test" AND metadata.field1.bool_value = true.

↳ 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 . character, such as foo.bar. see https://google.aip.dev/132#ordering for more details.

↳ 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
TypeDescription
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
NameDescription
parent string

Required. The MetadataStore whose Contexts should be listed. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

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: display_name = "test". Supported fields include: name, display_name, schema_title, create_time, and update_time. Time fields, such as create_time and update_time, require values specified in RFC-3339 format. For example: create_time = "2020-11-19T11:30:00-04:00". * Metadata field: To filter on metadata fields use traversal operation as follows: metadata.<field_name>.<type_value>. For example: metadata.field_1.number_value = 10.0. * Parent Child filtering: To filter Contexts based on parent-child relationship use the HAS operator as follows: parent_contexts: "projects/<project_number>/locations/<location>/metadataStores/<metadatastore_name>/contexts/<context_id>" child_contexts: "projects/<project_number>/locations/<location>/metadataStores/<metadatastore_name>/contexts/<context_id>" Each of the above supported filters can be combined together using logical operators (AND & OR). Maximum nested expression depth allowed is 5. For example: display_name = "test" AND metadata.field1.bool_value = true.

↳ 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 . character, such as foo.bar. see https://google.aip.dev/132#ordering for more details.

↳ 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
TypeDescription
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
NameDescription
parent string

Required. The MetadataStore whose Executions should be listed. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

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: display_name = "test". Supported fields include: name, display_name, state, schema_title, create_time, and update_time. Time fields, such as create_time and update_time, require values specified in RFC-3339 format. For example: create_time = "2020-11-19T11:30:00-04:00". * Metadata field: To filter on metadata fields use traversal operation as follows: metadata.<field_name>.<type_value> For example: metadata.field_1.number_value = 10.0 * Context based filtering: To filter Executions based on the contexts to which they belong use the function operator with the full resource name: in_context(<context-name>). For example: in_context("projects/<project_number>/locations/<location>/metadataStores/<metadatastore_name>/contexts/<context-id>") Each of the above supported filters can be combined together using logical operators (AND & OR). Maximum nested expression depth allowed is 5. For example: display_name = "test" AND metadata.field1.bool_value = true.

↳ 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 . character, such as foo.bar. see https://google.aip.dev/132#ordering for more details.

↳ 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
TypeDescription
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
NameDescription
parent string

Required. The MetadataStore whose MetadataSchemas should be listed. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

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
TypeDescription
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
NameDescription
parent string

Required. The Location whose MetadataStores should be listed. Format: projects/{project}/locations/{location}

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
TypeDescription
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
NameDescription
parent string

Required. The metadata store to purge Artifacts from. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

filter string

Required. A required filter matching the Artifacts to be purged. E.g., update_time <= 2020-11-19T11:30:00-04:00.

optionalArgs array

Optional.

↳ force bool

Optional. Flag to indicate to actually perform the purge. If force is set to false, the method will return a sample of Artifact names that would be deleted.

↳ 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
TypeDescription
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
NameDescription
parent string

Required. The metadata store to purge Contexts from. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

filter string

Required. A required filter matching the Contexts to be purged. E.g., update_time <= 2020-11-19T11:30:00-04:00.

optionalArgs array

Optional.

↳ force bool

Optional. Flag to indicate to actually perform the purge. If force is set to false, the method will return a sample of Context names that would be deleted.

↳ 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
TypeDescription
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
NameDescription
parent string

Required. The metadata store to purge Executions from. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore}

filter string

Required. A required filter matching the Executions to be purged. E.g., update_time <= 2020-11-19T11:30:00-04:00.

optionalArgs array

Optional.

↳ force bool

Optional. Flag to indicate to actually perform the purge. If force is set to false, the method will return a sample of Execution names that would be deleted.

↳ 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
TypeDescription
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
NameDescription
artifact string

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.

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: display_name = "test" Supported fields include: name, display_name, uri, state, schema_title, create_time, and update_time. Time fields, such as create_time and update_time, require values specified in RFC-3339 format. For example: create_time = "2020-11-19T11:30:00-04:00" * Metadata field: To filter on metadata fields use traversal operation as follows: metadata.<field_name>.<type_value>. For example: metadata.field_1.number_value = 10.0 Each of the above supported filter types can be combined together using logical operators (AND & OR). Maximum nested expression depth allowed is 5. For example: display_name = "test" AND metadata.field1.bool_value = true.

↳ 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
TypeDescription
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
NameDescription
context string

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.

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
TypeDescription
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
NameDescription
execution string

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}

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
TypeDescription
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
NameDescription
context string

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

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
TypeDescription
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
NameDescription
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: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}

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
TypeDescription
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
NameDescription
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: projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}

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
TypeDescription
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
NameDescription
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: projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}

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
TypeDescription
Google\Cloud\AIPlatform\V1\Execution

getLocation

Gets information about a location.

Sample code:

$metadataServiceClient = new MetadataServiceClient();
try {
    $response = $metadataServiceClient->getLocation();
} finally {
    $metadataServiceClient->close();
}
Parameters
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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 GetPolicyOptions object for specifying options to GetIamPolicy.

↳ 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
TypeDescription
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
NameDescription
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 resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

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: paths: "bindings, etag"

↳ 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
TypeDescription
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
NameDescription
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 resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

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
TypeDescription
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.