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 Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper 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 Google\ApiCore\CredentialsWrapper::build() . |
↳ 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 Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() 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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest;
use Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
/**
* @param string $formattedContext The resource name of the Context that the Artifacts and
* Executions belong to. Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
* Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function add_context_artifacts_and_executions_sample(string $formattedContext): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new AddContextArtifactsAndExecutionsRequest())
->setContext($formattedContext);
// Call the API and handle any network failures.
try {
/** @var AddContextArtifactsAndExecutionsResponse $response */
$response = $metadataServiceClient->addContextArtifactsAndExecutions($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedContext = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
add_context_artifacts_and_executions_sample($formattedContext);
}
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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddContextChildrenResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddContextChildrenRequest;
use Google\Cloud\AIPlatform\V1\AddContextChildrenResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
/**
* @param string $formattedContext The resource name of the parent Context.
*
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
* Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function add_context_children_sample(string $formattedContext): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new AddContextChildrenRequest())
->setContext($formattedContext);
// Call the API and handle any network failures.
try {
/** @var AddContextChildrenResponse $response */
$response = $metadataServiceClient->addContextChildren($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedContext = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
add_context_children_sample($formattedContext);
}
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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest;
use Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
/**
* @param string $formattedExecution The resource name of the Execution that the Events connect
* Artifacts with.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
* Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
*/
function add_execution_events_sample(string $formattedExecution): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new AddExecutionEventsRequest())
->setExecution($formattedExecution);
// Call the API and handle any network failures.
try {
/** @var AddExecutionEventsResponse $response */
$response = $metadataServiceClient->addExecutionEvents($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedExecution = MetadataServiceClient::executionName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[EXECUTION]'
);
add_execution_events_sample($formattedExecution);
}
createArtifact
Creates an Artifact associated with a MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateArtifactRequest;
/**
* @param string $formattedParent The resource name of the MetadataStore where the Artifact should
* be created.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function create_artifact_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$artifact = new Artifact();
$request = (new CreateArtifactRequest())
->setParent($formattedParent)
->setArtifact($artifact);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $metadataServiceClient->createArtifact($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
create_artifact_sample($formattedParent);
}
createContext
Creates a Context associated with a MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\CreateContextRequest;
/**
* @param string $formattedParent The resource name of the MetadataStore where the Context should
* be created. Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function create_context_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$context = new Context();
$request = (new CreateContextRequest())
->setParent($formattedParent)
->setContext($context);
// Call the API and handle any network failures.
try {
/** @var Context $response */
$response = $metadataServiceClient->createContext($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
create_context_sample($formattedParent);
}
createExecution
Creates an Execution associated with a MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateExecutionRequest;
use Google\Cloud\AIPlatform\V1\Execution;
/**
* @param string $formattedParent The resource name of the MetadataStore where the Execution should
* be created.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function create_execution_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$execution = new Execution();
$request = (new CreateExecutionRequest())
->setParent($formattedParent)
->setExecution($execution);
// Call the API and handle any network failures.
try {
/** @var Execution $response */
$response = $metadataServiceClient->createExecution($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
create_execution_sample($formattedParent);
}
createMetadataSchema
Creates a MetadataSchema.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataSchema |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;
/**
* @param string $formattedParent The resource name of the MetadataStore where the MetadataSchema
* should be created. Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
* @param string $metadataSchemaSchema The raw YAML string representation of the MetadataSchema. The
* combination of [MetadataSchema.version] and the schema name given by
* `title` in [MetadataSchema.schema] must be unique within a MetadataStore.
*
* The schema is defined as an OpenAPI 3.0.2
* [MetadataSchema
* Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject)
*/
function create_metadata_schema_sample(
string $formattedParent,
string $metadataSchemaSchema
): void {
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$metadataSchema = (new MetadataSchema())
->setSchema($metadataSchemaSchema);
$request = (new CreateMetadataSchemaRequest())
->setParent($formattedParent)
->setMetadataSchema($metadataSchema);
// Call the API and handle any network failures.
try {
/** @var MetadataSchema $response */
$response = $metadataServiceClient->createMetadataSchema($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
$metadataSchemaSchema = '[SCHEMA]';
create_metadata_schema_sample($formattedParent, $metadataSchemaSchema);
}
createMetadataStore
Initializes a MetadataStore, including allocation of resources.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateMetadataStoreRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the Location where the MetadataStore should
* be created.
* Format: `projects/{project}/locations/{location}/`
* Please see {@see MetadataServiceClient::locationName()} for help formatting this field.
*/
function create_metadata_store_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$metadataStore = new MetadataStore();
$request = (new CreateMetadataStoreRequest())
->setParent($formattedParent)
->setMetadataStore($metadataStore);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->createMetadataStore($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var MetadataStore $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::locationName('[PROJECT]', '[LOCATION]');
create_metadata_store_sample($formattedParent);
}
deleteArtifact
Deletes an Artifact.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteArtifactRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the Artifact to delete.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
* Please see {@see MetadataServiceClient::artifactName()} for help formatting this field.
*/
function delete_artifact_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new DeleteArtifactRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->deleteArtifact($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::artifactName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[ARTIFACT]'
);
delete_artifact_sample($formattedName);
}
deleteContext
Deletes a stored Context.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteContextRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the Context to delete.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
* Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function delete_context_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new DeleteContextRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->deleteContext($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
delete_context_sample($formattedName);
}
deleteExecution
Deletes an Execution.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteExecutionRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the Execution to delete.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
* Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
*/
function delete_execution_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new DeleteExecutionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->deleteExecution($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::executionName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[EXECUTION]'
);
delete_execution_sample($formattedName);
}
deleteMetadataStore
Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the MetadataStore to delete.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function delete_metadata_store_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new DeleteMetadataStoreRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->deleteMetadataStore($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
delete_metadata_store_sample($formattedName);
}
getArtifact
Retrieves a specific Artifact.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetArtifactRequest;
/**
* @param string $formattedName The resource name of the Artifact to retrieve.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
* Please see {@see MetadataServiceClient::artifactName()} for help formatting this field.
*/
function get_artifact_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetArtifactRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $metadataServiceClient->getArtifact($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::artifactName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[ARTIFACT]'
);
get_artifact_sample($formattedName);
}
getContext
Retrieves a specific Context.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\GetContextRequest;
/**
* @param string $formattedName The resource name of the Context to retrieve.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
* Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function get_context_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetContextRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Context $response */
$response = $metadataServiceClient->getContext($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
get_context_sample($formattedName);
}
getExecution
Retrieves a specific Execution.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\GetExecutionRequest;
/**
* @param string $formattedName The resource name of the Execution to retrieve.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
* Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
*/
function get_execution_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetExecutionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Execution $response */
$response = $metadataServiceClient->getExecution($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::executionName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[EXECUTION]'
);
get_execution_sample($formattedName);
}
getMetadataSchema
Retrieves a specific MetadataSchema.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataSchema |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;
/**
* @param string $formattedName The resource name of the MetadataSchema to retrieve.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}`
* Please see {@see MetadataServiceClient::metadataSchemaName()} for help formatting this field.
*/
function get_metadata_schema_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetMetadataSchemaRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var MetadataSchema $response */
$response = $metadataServiceClient->getMetadataSchema($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::metadataSchemaName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[METADATA_SCHEMA]'
);
get_metadata_schema_sample($formattedName);
}
getMetadataStore
Retrieves a specific MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\MetadataStore |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;
/**
* @param string $formattedName The resource name of the MetadataStore to retrieve.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function get_metadata_store_sample(string $formattedName): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetMetadataStoreRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var MetadataStore $response */
$response = $metadataServiceClient->getMetadataStore($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
get_metadata_store_sample($formattedName);
}
listArtifacts
Lists Artifacts in the MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListArtifactsRequest;
/**
* @param string $formattedParent The MetadataStore whose Artifacts should be listed.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function list_artifacts_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new ListArtifactsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listArtifacts($request);
/** @var Artifact $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
list_artifacts_sample($formattedParent);
}
listContexts
Lists Contexts on the MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\ListContextsRequest;
/**
* @param string $formattedParent The MetadataStore whose Contexts should be listed.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function list_contexts_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new ListContextsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listContexts($request);
/** @var Context $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
list_contexts_sample($formattedParent);
}
listExecutions
Lists Executions in the MetadataStore.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\ListExecutionsRequest;
/**
* @param string $formattedParent The MetadataStore whose Executions should be listed.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function list_executions_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new ListExecutionsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listExecutions($request);
/** @var Execution $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
list_executions_sample($formattedParent);
}
listMetadataSchemas
Lists MetadataSchemas.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;
/**
* @param string $formattedParent The MetadataStore whose MetadataSchemas should be listed.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
*/
function list_metadata_schemas_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new ListMetadataSchemasRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listMetadataSchemas($request);
/** @var MetadataSchema $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
list_metadata_schemas_sample($formattedParent);
}
listMetadataStores
Lists MetadataStores for a Location.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;
/**
* @param string $formattedParent The Location whose MetadataStores should be listed.
* Format:
* `projects/{project}/locations/{location}`
* Please see {@see MetadataServiceClient::locationName()} for help formatting this field.
*/
function list_metadata_stores_sample(string $formattedParent): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new ListMetadataStoresRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listMetadataStores($request);
/** @var MetadataStore $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_metadata_stores_sample($formattedParent);
}
purgeArtifacts
Purges Artifacts.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest;
use Google\Cloud\AIPlatform\V1\PurgeArtifactsResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The metadata store to purge Artifacts from.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
* @param string $filter A required filter matching the Artifacts to be purged.
* E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
*/
function purge_artifacts_sample(string $formattedParent, string $filter): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new PurgeArtifactsRequest())
->setParent($formattedParent)
->setFilter($filter);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->purgeArtifacts($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PurgeArtifactsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
$filter = '[FILTER]';
purge_artifacts_sample($formattedParent, $filter);
}
purgeContexts
Purges Contexts.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeContextsRequest;
use Google\Cloud\AIPlatform\V1\PurgeContextsResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The metadata store to purge Contexts from.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
* @param string $filter A required filter matching the Contexts to be purged.
* E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
*/
function purge_contexts_sample(string $formattedParent, string $filter): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new PurgeContextsRequest())
->setParent($formattedParent)
->setFilter($filter);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->purgeContexts($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PurgeContextsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
$filter = '[FILTER]';
purge_contexts_sample($formattedParent, $filter);
}
purgeExecutions
Purges Executions.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest;
use Google\Cloud\AIPlatform\V1\PurgeExecutionsResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The metadata store to purge Executions from.
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
* Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
* @param string $filter A required filter matching the Executions to be purged.
* E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
*/
function purge_executions_sample(string $formattedParent, string $filter): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new PurgeExecutionsRequest())
->setParent($formattedParent)
->setFilter($filter);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $metadataServiceClient->purgeExecutions($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PurgeExecutionsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MetadataServiceClient::metadataStoreName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]'
);
$filter = '[FILTER]';
purge_executions_sample($formattedParent, $filter);
}
queryArtifactLineageSubgraph
Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.
Parameters | |
---|---|
Name | Description |
artifact |
string
Required. The resource name of the Artifact whose Lineage needs to be
retrieved as a LineageSubgraph. Format:
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: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest;
/**
* @param string $formattedArtifact 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. Please see
* {@see MetadataServiceClient::artifactName()} for help formatting this field.
*/
function query_artifact_lineage_subgraph_sample(string $formattedArtifact): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new QueryArtifactLineageSubgraphRequest())
->setArtifact($formattedArtifact);
// Call the API and handle any network failures.
try {
/** @var LineageSubgraph $response */
$response = $metadataServiceClient->queryArtifactLineageSubgraph($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedArtifact = MetadataServiceClient::artifactName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[ARTIFACT]'
);
query_artifact_lineage_subgraph_sample($formattedArtifact);
}
queryContextLineageSubgraph
Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.
Parameters | |
---|---|
Name | Description |
context |
string
Required. The resource name of the Context whose Artifacts and Executions
should be retrieved as a LineageSubgraph.
Format:
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest;
/**
* @param string $formattedContext 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. Please see
* {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function query_context_lineage_subgraph_sample(string $formattedContext): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new QueryContextLineageSubgraphRequest())
->setContext($formattedContext);
// Call the API and handle any network failures.
try {
/** @var LineageSubgraph $response */
$response = $metadataServiceClient->queryContextLineageSubgraph($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedContext = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
query_context_lineage_subgraph_sample($formattedContext);
}
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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\LineageSubgraph |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest;
/**
* @param string $formattedExecution 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}`
* Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
*/
function query_execution_inputs_and_outputs_sample(string $formattedExecution): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new QueryExecutionInputsAndOutputsRequest())
->setExecution($formattedExecution);
// Call the API and handle any network failures.
try {
/** @var LineageSubgraph $response */
$response = $metadataServiceClient->queryExecutionInputsAndOutputs($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedExecution = MetadataServiceClient::executionName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[EXECUTION]'
);
query_execution_inputs_and_outputs_sample($formattedExecution);
}
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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest;
use Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse;
/**
* @param string $formattedContext The resource name of the parent Context.
*
* Format:
* `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
* Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
*/
function remove_context_children_sample(string $formattedContext): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new RemoveContextChildrenRequest())
->setContext($formattedContext);
// Call the API and handle any network failures.
try {
/** @var RemoveContextChildrenResponse $response */
$response = $metadataServiceClient->removeContextChildren($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedContext = MetadataServiceClient::contextName(
'[PROJECT]',
'[LOCATION]',
'[METADATA_STORE]',
'[CONTEXT]'
);
remove_context_children_sample($formattedContext);
}
updateArtifact
Updates a stored Artifact.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Artifact |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\UpdateArtifactRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_artifact_sample(): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$artifact = new Artifact();
$request = (new UpdateArtifactRequest())
->setArtifact($artifact);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $metadataServiceClient->updateArtifact($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateContext
Updates a stored Context.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Context |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\UpdateContextRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_context_sample(): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$context = new Context();
$request = (new UpdateContextRequest())
->setContext($context);
// Call the API and handle any network failures.
try {
/** @var Context $response */
$response = $metadataServiceClient->updateContext($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateExecution
Updates a stored Execution.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\AIPlatform\V1\Execution |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\UpdateExecutionRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_execution_sample(): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$execution = new Execution();
$request = (new UpdateExecutionRequest())
->setExecution($execution);
// Call the API and handle any network failures.
try {
/** @var Execution $response */
$response = $metadataServiceClient->updateExecution($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getLocation
Gets information about a location.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function get_location_sample(): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $metadataServiceClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function list_locations_sample(): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $metadataServiceClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
/**
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $metadataServiceClient->getIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
get_iam_policy_sample($resource);
}
setIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
/**
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
function set_iam_policy_sample(string $resource): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$policy = new Policy();
$request = (new SetIamPolicyRequest())
->setResource($resource)
->setPolicy($policy);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $metadataServiceClient->setIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
set_iam_policy_sample($resource);
}
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.
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 Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
/**
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string $permissionsElement 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](https://cloud.google.com/iam/docs/overview#permissions).
*/
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
// Create a client.
$metadataServiceClient = new MetadataServiceClient();
// Prepare the request message.
$permissions = [$permissionsElement,];
$request = (new TestIamPermissionsRequest())
->setResource($resource)
->setPermissions($permissions);
// Call the API and handle any network failures.
try {
/** @var TestIamPermissionsResponse $response */
$response = $metadataServiceClient->testIamPermissions($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
$permissionsElement = '[PERMISSIONS]';
test_iam_permissions_sample($resource, $permissionsElement);
}
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.