Google Cloud Ai Platform V1 Client - Class JobServiceClient (0.20.0)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class JobServiceClient.

Service Description: A service for creating and managing Vertex AI's jobs.

This class is currently experimental and may be subject to changes.

Namespace

Google \ Cloud \ AIPlatform \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed 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 false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the 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.

cancelBatchPredictionJob

Cancels a BatchPredictionJob.

Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetBatchPredictionJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its BatchPredictionJob.state is set to CANCELLED. Any files already outputted by the job are not deleted.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::cancelBatchPredictionJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelBatchPredictionJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\CancelBatchPredictionJobRequest;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;

/**
 * @param string $formattedName The name of the BatchPredictionJob to cancel.
 *                              Format:
 *                              `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
 *                              Please see {@see JobServiceClient::batchPredictionJobName()} for help formatting this field.
 */
function cancel_batch_prediction_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new CancelBatchPredictionJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->cancelBatchPredictionJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::batchPredictionJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[BATCH_PREDICTION_JOB]'
    );

    cancel_batch_prediction_job_sample($formattedName);
}

cancelCustomJob

Cancels a CustomJob.

Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::cancelCustomJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelCustomJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\CancelCustomJobRequest;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;

/**
 * @param string $formattedName The name of the CustomJob to cancel.
 *                              Format:
 *                              `projects/{project}/locations/{location}/customJobs/{custom_job}`
 *                              Please see {@see JobServiceClient::customJobName()} for help formatting this field.
 */
function cancel_custom_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new CancelCustomJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->cancelCustomJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]');

    cancel_custom_job_sample($formattedName);
}

cancelDataLabelingJob

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::cancelDataLabelingJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelDataLabelingJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\CancelDataLabelingJobRequest;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;

/**
 * @param string $formattedName The name of the DataLabelingJob.
 *                              Format:
 *                              `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
 *                              Please see {@see JobServiceClient::dataLabelingJobName()} for help formatting this field.
 */
function cancel_data_labeling_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new CancelDataLabelingJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->cancelDataLabelingJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::dataLabelingJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[DATA_LABELING_JOB]'
    );

    cancel_data_labeling_job_sample($formattedName);
}

cancelHyperparameterTuningJob

Cancels a HyperparameterTuningJob.

Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::cancelHyperparameterTuningJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelHyperparameterTuningJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\CancelHyperparameterTuningJobRequest;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;

/**
 * @param string $formattedName The name of the HyperparameterTuningJob to cancel.
 *                              Format:
 *                              `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
 *                              Please see {@see JobServiceClient::hyperparameterTuningJobName()} for help formatting this field.
 */
function cancel_hyperparameter_tuning_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new CancelHyperparameterTuningJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->cancelHyperparameterTuningJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::hyperparameterTuningJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[HYPERPARAMETER_TUNING_JOB]'
    );

    cancel_hyperparameter_tuning_job_sample($formattedName);
}

cancelNasJob

Cancels a NasJob.

Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::cancelNasJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelNasJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\CancelNasJobRequest;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;

/**
 * @param string $formattedName The name of the NasJob to cancel.
 *                              Format:
 *                              `projects/{project}/locations/{location}/nasJobs/{nas_job}`
 *                              Please see {@see JobServiceClient::nasJobName()} for help formatting this field.
 */
function cancel_nas_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new CancelNasJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->cancelNasJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]');

    cancel_nas_job_sample($formattedName);
}

createBatchPredictionJob

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createBatchPredictionJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateBatchPredictionJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\BatchPredictionJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\BatchPredictionJob;
use Google\Cloud\AIPlatform\V1\BatchPredictionJob\InputConfig;
use Google\Cloud\AIPlatform\V1\BatchPredictionJob\OutputConfig;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateBatchPredictionJobRequest;

/**
 * @param string $formattedParent                                 The resource name of the Location to create the
 *                                                                BatchPredictionJob in. Format: `projects/{project}/locations/{location}`
 *                                                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $batchPredictionJobDisplayName                   The user-defined name of this BatchPredictionJob.
 * @param string $batchPredictionJobInputConfigInstancesFormat    The format in which instances are given, must be one of the
 *                                                                [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model]
 *                                                                [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats].
 * @param string $batchPredictionJobOutputConfigPredictionsFormat The format in which Vertex AI gives the predictions, must be
 *                                                                one of the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model]
 *                                                                [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats].
 */
function create_batch_prediction_job_sample(
    string $formattedParent,
    string $batchPredictionJobDisplayName,
    string $batchPredictionJobInputConfigInstancesFormat,
    string $batchPredictionJobOutputConfigPredictionsFormat
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $batchPredictionJobInputConfig = (new InputConfig())
        ->setInstancesFormat($batchPredictionJobInputConfigInstancesFormat);
    $batchPredictionJobOutputConfig = (new OutputConfig())
        ->setPredictionsFormat($batchPredictionJobOutputConfigPredictionsFormat);
    $batchPredictionJob = (new BatchPredictionJob())
        ->setDisplayName($batchPredictionJobDisplayName)
        ->setInputConfig($batchPredictionJobInputConfig)
        ->setOutputConfig($batchPredictionJobOutputConfig);
    $request = (new CreateBatchPredictionJobRequest())
        ->setParent($formattedParent)
        ->setBatchPredictionJob($batchPredictionJob);

    // Call the API and handle any network failures.
    try {
        /** @var BatchPredictionJob $response */
        $response = $jobServiceClient->createBatchPredictionJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $batchPredictionJobDisplayName = '[DISPLAY_NAME]';
    $batchPredictionJobInputConfigInstancesFormat = '[INSTANCES_FORMAT]';
    $batchPredictionJobOutputConfigPredictionsFormat = '[PREDICTIONS_FORMAT]';

    create_batch_prediction_job_sample(
        $formattedParent,
        $batchPredictionJobDisplayName,
        $batchPredictionJobInputConfigInstancesFormat,
        $batchPredictionJobOutputConfigPredictionsFormat
    );
}

createCustomJob

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createCustomJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateCustomJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\CustomJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateCustomJobRequest;
use Google\Cloud\AIPlatform\V1\CustomJob;
use Google\Cloud\AIPlatform\V1\CustomJobSpec;
use Google\Cloud\AIPlatform\V1\WorkerPoolSpec;

/**
 * @param string $formattedParent      The resource name of the Location to create the CustomJob in.
 *                                     Format: `projects/{project}/locations/{location}`
 *                                     Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $customJobDisplayName The display name of the CustomJob.
 *                                     The name can be up to 128 characters long and can consist of any UTF-8
 *                                     characters.
 */
function create_custom_job_sample(string $formattedParent, string $customJobDisplayName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $customJobJobSpecWorkerPoolSpecs = [new WorkerPoolSpec()];
    $customJobJobSpec = (new CustomJobSpec())
        ->setWorkerPoolSpecs($customJobJobSpecWorkerPoolSpecs);
    $customJob = (new CustomJob())
        ->setDisplayName($customJobDisplayName)
        ->setJobSpec($customJobJobSpec);
    $request = (new CreateCustomJobRequest())
        ->setParent($formattedParent)
        ->setCustomJob($customJob);

    // Call the API and handle any network failures.
    try {
        /** @var CustomJob $response */
        $response = $jobServiceClient->createCustomJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $customJobDisplayName = '[DISPLAY_NAME]';

    create_custom_job_sample($formattedParent, $customJobDisplayName);
}

createDataLabelingJob

Creates a DataLabelingJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createDataLabelingJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateDataLabelingJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\DataLabelingJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateDataLabelingJobRequest;
use Google\Cloud\AIPlatform\V1\DataLabelingJob;
use Google\Protobuf\Value;

/**
 * @param string $formattedParent                         The parent of the DataLabelingJob.
 *                                                        Format: `projects/{project}/locations/{location}`
 *                                                        Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $dataLabelingJobDisplayName              The user-defined name of the DataLabelingJob.
 *                                                        The name can be up to 128 characters long and can consist of any UTF-8
 *                                                        characters.
 *                                                        Display name of a DataLabelingJob.
 * @param string $formattedDataLabelingJobDatasetsElement Dataset resource names. Right now we only support labeling from a
 *                                                        single Dataset. Format:
 *                                                        `projects/{project}/locations/{location}/datasets/{dataset}`
 *                                                        Please see {@see JobServiceClient::datasetName()} for help formatting this field.
 * @param int    $dataLabelingJobLabelerCount             Number of labelers to work on each DataItem.
 * @param string $dataLabelingJobInstructionUri           The Google Cloud Storage location of the instruction pdf. This
 *                                                        pdf is shared with labelers, and provides detailed description on how to
 *                                                        label DataItems in Datasets.
 * @param string $dataLabelingJobInputsSchemaUri          Points to a YAML file stored on Google Cloud Storage describing
 *                                                        the config for a specific type of DataLabelingJob. The schema files that
 *                                                        can be used here are found in the
 *                                                        https://storage.googleapis.com/google-cloud-aiplatform bucket in the
 *                                                        /schema/datalabelingjob/inputs/ folder.
 */
function create_data_labeling_job_sample(
    string $formattedParent,
    string $dataLabelingJobDisplayName,
    string $formattedDataLabelingJobDatasetsElement,
    int $dataLabelingJobLabelerCount,
    string $dataLabelingJobInstructionUri,
    string $dataLabelingJobInputsSchemaUri
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $formattedDataLabelingJobDatasets = [$formattedDataLabelingJobDatasetsElement,];
    $dataLabelingJobInputs = new Value();
    $dataLabelingJob = (new DataLabelingJob())
        ->setDisplayName($dataLabelingJobDisplayName)
        ->setDatasets($formattedDataLabelingJobDatasets)
        ->setLabelerCount($dataLabelingJobLabelerCount)
        ->setInstructionUri($dataLabelingJobInstructionUri)
        ->setInputsSchemaUri($dataLabelingJobInputsSchemaUri)
        ->setInputs($dataLabelingJobInputs);
    $request = (new CreateDataLabelingJobRequest())
        ->setParent($formattedParent)
        ->setDataLabelingJob($dataLabelingJob);

    // Call the API and handle any network failures.
    try {
        /** @var DataLabelingJob $response */
        $response = $jobServiceClient->createDataLabelingJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $dataLabelingJobDisplayName = '[DISPLAY_NAME]';
    $formattedDataLabelingJobDatasetsElement = JobServiceClient::datasetName(
        '[PROJECT]',
        '[LOCATION]',
        '[DATASET]'
    );
    $dataLabelingJobLabelerCount = 0;
    $dataLabelingJobInstructionUri = '[INSTRUCTION_URI]';
    $dataLabelingJobInputsSchemaUri = '[INPUTS_SCHEMA_URI]';

    create_data_labeling_job_sample(
        $formattedParent,
        $dataLabelingJobDisplayName,
        $formattedDataLabelingJobDatasetsElement,
        $dataLabelingJobLabelerCount,
        $dataLabelingJobInstructionUri,
        $dataLabelingJobInputsSchemaUri
    );
}

createHyperparameterTuningJob

Creates a HyperparameterTuningJob

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createHyperparameterTuningJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateHyperparameterTuningJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\HyperparameterTuningJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateHyperparameterTuningJobRequest;
use Google\Cloud\AIPlatform\V1\CustomJobSpec;
use Google\Cloud\AIPlatform\V1\HyperparameterTuningJob;
use Google\Cloud\AIPlatform\V1\StudySpec;
use Google\Cloud\AIPlatform\V1\StudySpec\MetricSpec;
use Google\Cloud\AIPlatform\V1\StudySpec\MetricSpec\GoalType;
use Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec;
use Google\Cloud\AIPlatform\V1\WorkerPoolSpec;

/**
 * @param string $formattedParent                                       The resource name of the Location to create the
 *                                                                      HyperparameterTuningJob in. Format:
 *                                                                      `projects/{project}/locations/{location}`
 *                                                                      Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $hyperparameterTuningJobDisplayName                    The display name of the HyperparameterTuningJob.
 *                                                                      The name can be up to 128 characters long and can consist of any UTF-8
 *                                                                      characters.
 * @param string $hyperparameterTuningJobStudySpecMetricsMetricId       The ID of the metric. Must not contain whitespaces and must be
 *                                                                      unique amongst all MetricSpecs.
 * @param int    $hyperparameterTuningJobStudySpecMetricsGoal           The optimization goal of the metric.
 * @param string $hyperparameterTuningJobStudySpecParametersParameterId The ID of the parameter. Must not contain whitespaces and must
 *                                                                      be unique amongst all ParameterSpecs.
 * @param int    $hyperparameterTuningJobMaxTrialCount                  The desired total number of Trials.
 * @param int    $hyperparameterTuningJobParallelTrialCount             The desired number of Trials to run in parallel.
 */
function create_hyperparameter_tuning_job_sample(
    string $formattedParent,
    string $hyperparameterTuningJobDisplayName,
    string $hyperparameterTuningJobStudySpecMetricsMetricId,
    int $hyperparameterTuningJobStudySpecMetricsGoal,
    string $hyperparameterTuningJobStudySpecParametersParameterId,
    int $hyperparameterTuningJobMaxTrialCount,
    int $hyperparameterTuningJobParallelTrialCount
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $metricSpec = (new MetricSpec())
        ->setMetricId($hyperparameterTuningJobStudySpecMetricsMetricId)
        ->setGoal($hyperparameterTuningJobStudySpecMetricsGoal);
    $hyperparameterTuningJobStudySpecMetrics = [$metricSpec,];
    $parameterSpec = (new ParameterSpec())
        ->setParameterId($hyperparameterTuningJobStudySpecParametersParameterId);
    $hyperparameterTuningJobStudySpecParameters = [$parameterSpec,];
    $hyperparameterTuningJobStudySpec = (new StudySpec())
        ->setMetrics($hyperparameterTuningJobStudySpecMetrics)
        ->setParameters($hyperparameterTuningJobStudySpecParameters);
    $hyperparameterTuningJobTrialJobSpecWorkerPoolSpecs = [new WorkerPoolSpec()];
    $hyperparameterTuningJobTrialJobSpec = (new CustomJobSpec())
        ->setWorkerPoolSpecs($hyperparameterTuningJobTrialJobSpecWorkerPoolSpecs);
    $hyperparameterTuningJob = (new HyperparameterTuningJob())
        ->setDisplayName($hyperparameterTuningJobDisplayName)
        ->setStudySpec($hyperparameterTuningJobStudySpec)
        ->setMaxTrialCount($hyperparameterTuningJobMaxTrialCount)
        ->setParallelTrialCount($hyperparameterTuningJobParallelTrialCount)
        ->setTrialJobSpec($hyperparameterTuningJobTrialJobSpec);
    $request = (new CreateHyperparameterTuningJobRequest())
        ->setParent($formattedParent)
        ->setHyperparameterTuningJob($hyperparameterTuningJob);

    // Call the API and handle any network failures.
    try {
        /** @var HyperparameterTuningJob $response */
        $response = $jobServiceClient->createHyperparameterTuningJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $hyperparameterTuningJobDisplayName = '[DISPLAY_NAME]';
    $hyperparameterTuningJobStudySpecMetricsMetricId = '[METRIC_ID]';
    $hyperparameterTuningJobStudySpecMetricsGoal = GoalType::GOAL_TYPE_UNSPECIFIED;
    $hyperparameterTuningJobStudySpecParametersParameterId = '[PARAMETER_ID]';
    $hyperparameterTuningJobMaxTrialCount = 0;
    $hyperparameterTuningJobParallelTrialCount = 0;

    create_hyperparameter_tuning_job_sample(
        $formattedParent,
        $hyperparameterTuningJobDisplayName,
        $hyperparameterTuningJobStudySpecMetricsMetricId,
        $hyperparameterTuningJobStudySpecMetricsGoal,
        $hyperparameterTuningJobStudySpecParametersParameterId,
        $hyperparameterTuningJobMaxTrialCount,
        $hyperparameterTuningJobParallelTrialCount
    );
}

createModelDeploymentMonitoringJob

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateModelDeploymentMonitoringJobRequest;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringObjectiveConfig;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringScheduleConfig;
use Google\Cloud\AIPlatform\V1\SamplingStrategy;
use Google\Protobuf\Duration;

/**
 * @param string $formattedParent                               The parent of the ModelDeploymentMonitoringJob.
 *                                                              Format: `projects/{project}/locations/{location}`
 *                                                              Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $modelDeploymentMonitoringJobDisplayName       The user-defined name of the ModelDeploymentMonitoringJob.
 *                                                              The name can be up to 128 characters long and can consist of any UTF-8
 *                                                              characters.
 *                                                              Display name of a ModelDeploymentMonitoringJob.
 * @param string $formattedModelDeploymentMonitoringJobEndpoint Endpoint resource name.
 *                                                              Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
 *                                                              Please see {@see JobServiceClient::endpointName()} for help formatting this field.
 */
function create_model_deployment_monitoring_job_sample(
    string $formattedParent,
    string $modelDeploymentMonitoringJobDisplayName,
    string $formattedModelDeploymentMonitoringJobEndpoint
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = [
        new ModelDeploymentMonitoringObjectiveConfig()
    ];
    $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration();
    $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = (new ModelDeploymentMonitoringScheduleConfig())
        ->setMonitorInterval(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfigMonitorInterval
        );
    $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy();
    $modelDeploymentMonitoringJob = (new ModelDeploymentMonitoringJob())
        ->setDisplayName($modelDeploymentMonitoringJobDisplayName)
        ->setEndpoint($formattedModelDeploymentMonitoringJobEndpoint)
        ->setModelDeploymentMonitoringObjectiveConfigs(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs
        )
        ->setModelDeploymentMonitoringScheduleConfig(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig
        )
        ->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy);
    $request = (new CreateModelDeploymentMonitoringJobRequest())
        ->setParent($formattedParent)
        ->setModelDeploymentMonitoringJob($modelDeploymentMonitoringJob);

    // Call the API and handle any network failures.
    try {
        /** @var ModelDeploymentMonitoringJob $response */
        $response = $jobServiceClient->createModelDeploymentMonitoringJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $modelDeploymentMonitoringJobDisplayName = '[DISPLAY_NAME]';
    $formattedModelDeploymentMonitoringJobEndpoint = JobServiceClient::endpointName(
        '[PROJECT]',
        '[LOCATION]',
        '[ENDPOINT]'
    );

    create_model_deployment_monitoring_job_sample(
        $formattedParent,
        $modelDeploymentMonitoringJobDisplayName,
        $formattedModelDeploymentMonitoringJobEndpoint
    );
}

createNasJob

Creates a NasJob

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createNasJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateNasJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\NasJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CreateNasJobRequest;
use Google\Cloud\AIPlatform\V1\NasJob;
use Google\Cloud\AIPlatform\V1\NasJobSpec;

/**
 * @param string $formattedParent   The resource name of the Location to create the NasJob in.
 *                                  Format: `projects/{project}/locations/{location}`
 *                                  Please see {@see JobServiceClient::locationName()} for help formatting this field.
 * @param string $nasJobDisplayName The display name of the NasJob.
 *                                  The name can be up to 128 characters long and can consist of any UTF-8
 *                                  characters.
 */
function create_nas_job_sample(string $formattedParent, string $nasJobDisplayName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $nasJobNasJobSpec = new NasJobSpec();
    $nasJob = (new NasJob())
        ->setDisplayName($nasJobDisplayName)
        ->setNasJobSpec($nasJobNasJobSpec);
    $request = (new CreateNasJobRequest())
        ->setParent($formattedParent)
        ->setNasJob($nasJob);

    // Call the API and handle any network failures.
    try {
        /** @var NasJob $response */
        $response = $jobServiceClient->createNasJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $nasJobDisplayName = '[DISPLAY_NAME]';

    create_nas_job_sample($formattedParent, $nasJobDisplayName);
}

deleteBatchPredictionJob

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteBatchPredictionJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteBatchPredictionJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteBatchPredictionJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the BatchPredictionJob resource to be deleted.
 *                              Format:
 *                              `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
 *                              Please see {@see JobServiceClient::batchPredictionJobName()} for help formatting this field.
 */
function delete_batch_prediction_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteBatchPredictionJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteBatchPredictionJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::batchPredictionJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[BATCH_PREDICTION_JOB]'
    );

    delete_batch_prediction_job_sample($formattedName);
}

deleteCustomJob

Deletes a CustomJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteCustomJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteCustomJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteCustomJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the CustomJob resource to be deleted.
 *                              Format:
 *                              `projects/{project}/locations/{location}/customJobs/{custom_job}`
 *                              Please see {@see JobServiceClient::customJobName()} for help formatting this field.
 */
function delete_custom_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteCustomJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteCustomJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]');

    delete_custom_job_sample($formattedName);
}

deleteDataLabelingJob

Deletes a DataLabelingJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteDataLabelingJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteDataLabelingJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteDataLabelingJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the DataLabelingJob to be deleted.
 *                              Format:
 *                              `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
 *                              Please see {@see JobServiceClient::dataLabelingJobName()} for help formatting this field.
 */
function delete_data_labeling_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteDataLabelingJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteDataLabelingJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::dataLabelingJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[DATA_LABELING_JOB]'
    );

    delete_data_labeling_job_sample($formattedName);
}

deleteHyperparameterTuningJob

Deletes a HyperparameterTuningJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteHyperparameterTuningJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteHyperparameterTuningJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteHyperparameterTuningJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the HyperparameterTuningJob resource to be deleted.
 *                              Format:
 *                              `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
 *                              Please see {@see JobServiceClient::hyperparameterTuningJobName()} for help formatting this field.
 */
function delete_hyperparameter_tuning_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteHyperparameterTuningJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteHyperparameterTuningJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::hyperparameterTuningJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[HYPERPARAMETER_TUNING_JOB]'
    );

    delete_hyperparameter_tuning_job_sample($formattedName);
}

deleteModelDeploymentMonitoringJob

Deletes a ModelDeploymentMonitoringJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteModelDeploymentMonitoringJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the model monitoring job to delete.
 *                              Format:
 *                              `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
 *                              Please see {@see JobServiceClient::modelDeploymentMonitoringJobName()} for help formatting this field.
 */
function delete_model_deployment_monitoring_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteModelDeploymentMonitoringJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteModelDeploymentMonitoringJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::modelDeploymentMonitoringJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[MODEL_DEPLOYMENT_MONITORING_JOB]'
    );

    delete_model_deployment_monitoring_job_sample($formattedName);
}

deleteNasJob

Deletes a NasJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteNasJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteNasJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteNasJobRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the NasJob resource to be deleted.
 *                              Format:
 *                              `projects/{project}/locations/{location}/nasJobs/{nas_job}`
 *                              Please see {@see JobServiceClient::nasJobName()} for help formatting this field.
 */
function delete_nas_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new DeleteNasJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->deleteNasJob($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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]');

    delete_nas_job_sample($formattedName);
}

getBatchPredictionJob

Gets a BatchPredictionJob

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getBatchPredictionJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetBatchPredictionJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\BatchPredictionJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\BatchPredictionJob;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\GetBatchPredictionJobRequest;

/**
 * @param string $formattedName The name of the BatchPredictionJob resource.
 *                              Format:
 *                              `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
 *                              Please see {@see JobServiceClient::batchPredictionJobName()} for help formatting this field.
 */
function get_batch_prediction_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetBatchPredictionJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var BatchPredictionJob $response */
        $response = $jobServiceClient->getBatchPredictionJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::batchPredictionJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[BATCH_PREDICTION_JOB]'
    );

    get_batch_prediction_job_sample($formattedName);
}

getCustomJob

Gets a CustomJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getCustomJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetCustomJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\CustomJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CustomJob;
use Google\Cloud\AIPlatform\V1\GetCustomJobRequest;

/**
 * @param string $formattedName The name of the CustomJob resource.
 *                              Format:
 *                              `projects/{project}/locations/{location}/customJobs/{custom_job}`
 *                              Please see {@see JobServiceClient::customJobName()} for help formatting this field.
 */
function get_custom_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetCustomJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CustomJob $response */
        $response = $jobServiceClient->getCustomJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::customJobName('[PROJECT]', '[LOCATION]', '[CUSTOM_JOB]');

    get_custom_job_sample($formattedName);
}

getDataLabelingJob

Gets a DataLabelingJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getDataLabelingJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetDataLabelingJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\DataLabelingJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DataLabelingJob;
use Google\Cloud\AIPlatform\V1\GetDataLabelingJobRequest;

/**
 * @param string $formattedName The name of the DataLabelingJob.
 *                              Format:
 *                              `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
 *                              Please see {@see JobServiceClient::dataLabelingJobName()} for help formatting this field.
 */
function get_data_labeling_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetDataLabelingJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var DataLabelingJob $response */
        $response = $jobServiceClient->getDataLabelingJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::dataLabelingJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[DATA_LABELING_JOB]'
    );

    get_data_labeling_job_sample($formattedName);
}

getHyperparameterTuningJob

Gets a HyperparameterTuningJob

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getHyperparameterTuningJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetHyperparameterTuningJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\HyperparameterTuningJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\GetHyperparameterTuningJobRequest;
use Google\Cloud\AIPlatform\V1\HyperparameterTuningJob;

/**
 * @param string $formattedName The name of the HyperparameterTuningJob resource.
 *                              Format:
 *                              `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
 *                              Please see {@see JobServiceClient::hyperparameterTuningJobName()} for help formatting this field.
 */
function get_hyperparameter_tuning_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetHyperparameterTuningJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var HyperparameterTuningJob $response */
        $response = $jobServiceClient->getHyperparameterTuningJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::hyperparameterTuningJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[HYPERPARAMETER_TUNING_JOB]'
    );

    get_hyperparameter_tuning_job_sample($formattedName);
}

getModelDeploymentMonitoringJob

Gets a ModelDeploymentMonitoringJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\GetModelDeploymentMonitoringJobRequest;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob;

/**
 * @param string $formattedName The resource name of the ModelDeploymentMonitoringJob.
 *                              Format:
 *                              `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
 *                              Please see {@see JobServiceClient::modelDeploymentMonitoringJobName()} for help formatting this field.
 */
function get_model_deployment_monitoring_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetModelDeploymentMonitoringJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var ModelDeploymentMonitoringJob $response */
        $response = $jobServiceClient->getModelDeploymentMonitoringJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::modelDeploymentMonitoringJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[MODEL_DEPLOYMENT_MONITORING_JOB]'
    );

    get_model_deployment_monitoring_job_sample($formattedName);
}

getNasJob

Gets a NasJob

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getNasJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetNasJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\NasJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\GetNasJobRequest;
use Google\Cloud\AIPlatform\V1\NasJob;

/**
 * @param string $formattedName The name of the NasJob resource.
 *                              Format:
 *                              `projects/{project}/locations/{location}/nasJobs/{nas_job}`
 *                              Please see {@see JobServiceClient::nasJobName()} for help formatting this field.
 */
function get_nas_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetNasJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var NasJob $response */
        $response = $jobServiceClient->getNasJob($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]');

    get_nas_job_sample($formattedName);
}

getNasTrialDetail

Gets a NasTrialDetail.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getNasTrialDetailAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetNasTrialDetailRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\AIPlatform\V1\NasTrialDetail
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\GetNasTrialDetailRequest;
use Google\Cloud\AIPlatform\V1\NasTrialDetail;

/**
 * @param string $formattedName The name of the NasTrialDetail resource.
 *                              Format:
 *                              `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}`
 *                              Please see {@see JobServiceClient::nasTrialDetailName()} for help formatting this field.
 */
function get_nas_trial_detail_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetNasTrialDetailRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var NasTrialDetail $response */
        $response = $jobServiceClient->getNasTrialDetail($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::nasTrialDetailName(
        '[PROJECT]',
        '[LOCATION]',
        '[NAS_JOB]',
        '[NAS_TRIAL_DETAIL]'
    );

    get_nas_trial_detail_sample($formattedName);
}

listBatchPredictionJobs

Lists BatchPredictionJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listBatchPredictionJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\BatchPredictionJob;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsRequest;

/**
 * @param string $formattedParent The resource name of the Location to list the BatchPredictionJobs
 *                                from. Format: `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_batch_prediction_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListBatchPredictionJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listBatchPredictionJobs($request);

        /** @var BatchPredictionJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_batch_prediction_jobs_sample($formattedParent);
}

listCustomJobs

Lists CustomJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listCustomJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListCustomJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\CustomJob;
use Google\Cloud\AIPlatform\V1\ListCustomJobsRequest;

/**
 * @param string $formattedParent The resource name of the Location to list the CustomJobs from.
 *                                Format: `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_custom_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListCustomJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listCustomJobs($request);

        /** @var CustomJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_custom_jobs_sample($formattedParent);
}

listDataLabelingJobs

Lists DataLabelingJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listDataLabelingJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListDataLabelingJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\DataLabelingJob;
use Google\Cloud\AIPlatform\V1\ListDataLabelingJobsRequest;

/**
 * @param string $formattedParent The parent of the DataLabelingJob.
 *                                Format: `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_data_labeling_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListDataLabelingJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listDataLabelingJobs($request);

        /** @var DataLabelingJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_data_labeling_jobs_sample($formattedParent);
}

listHyperparameterTuningJobs

Lists HyperparameterTuningJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listHyperparameterTuningJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\HyperparameterTuningJob;
use Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsRequest;

/**
 * @param string $formattedParent The resource name of the Location to list the
 *                                HyperparameterTuningJobs from. Format:
 *                                `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_hyperparameter_tuning_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListHyperparameterTuningJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listHyperparameterTuningJobs($request);

        /** @var HyperparameterTuningJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_hyperparameter_tuning_jobs_sample($formattedParent);
}

listModelDeploymentMonitoringJobs

Lists ModelDeploymentMonitoringJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listModelDeploymentMonitoringJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsRequest;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob;

/**
 * @param string $formattedParent The parent of the ModelDeploymentMonitoringJob.
 *                                Format: `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_model_deployment_monitoring_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListModelDeploymentMonitoringJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listModelDeploymentMonitoringJobs($request);

        /** @var ModelDeploymentMonitoringJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_model_deployment_monitoring_jobs_sample($formattedParent);
}

listNasJobs

Lists NasJobs in a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listNasJobsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListNasJobsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ListNasJobsRequest;
use Google\Cloud\AIPlatform\V1\NasJob;

/**
 * @param string $formattedParent The resource name of the Location to list the NasJobs
 *                                from. Format: `projects/{project}/locations/{location}`
 *                                Please see {@see JobServiceClient::locationName()} for help formatting this field.
 */
function list_nas_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListNasJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listNasJobs($request);

        /** @var NasJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_nas_jobs_sample($formattedParent);
}

listNasTrialDetails

List top NasTrialDetails of a NasJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listNasTrialDetailsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListNasTrialDetailsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ListNasTrialDetailsRequest;
use Google\Cloud\AIPlatform\V1\NasTrialDetail;

/**
 * @param string $formattedParent The name of the NasJob resource.
 *                                Format:
 *                                `projects/{project}/locations/{location}/nasJobs/{nas_job}`
 *                                Please see {@see JobServiceClient::nasJobName()} for help formatting this field.
 */
function list_nas_trial_details_sample(string $formattedParent): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ListNasTrialDetailsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->listNasTrialDetails($request);

        /** @var NasTrialDetail $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::nasJobName('[PROJECT]', '[LOCATION]', '[NAS_JOB]');

    list_nas_trial_details_sample($formattedParent);
}

pauseModelDeploymentMonitoringJob

Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to cancel the job. Will mark ModelDeploymentMonitoringJob.state to 'PAUSED'.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::pauseModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PauseModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\PauseModelDeploymentMonitoringJobRequest;

/**
 * @param string $formattedName The resource name of the ModelDeploymentMonitoringJob to pause.
 *                              Format:
 *                              `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
 *                              Please see {@see JobServiceClient::modelDeploymentMonitoringJobName()} for help formatting this field.
 */
function pause_model_deployment_monitoring_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new PauseModelDeploymentMonitoringJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->pauseModelDeploymentMonitoringJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::modelDeploymentMonitoringJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[MODEL_DEPLOYMENT_MONITORING_JOB]'
    );

    pause_model_deployment_monitoring_job_sample($formattedName);
}

resumeModelDeploymentMonitoringJob

Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A deleted ModelDeploymentMonitoringJob can't be resumed.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::resumeModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ResumeModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ResumeModelDeploymentMonitoringJobRequest;

/**
 * @param string $formattedName The resource name of the ModelDeploymentMonitoringJob to resume.
 *                              Format:
 *                              `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
 *                              Please see {@see JobServiceClient::modelDeploymentMonitoringJobName()} for help formatting this field.
 */
function resume_model_deployment_monitoring_job_sample(string $formattedName): void
{
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new ResumeModelDeploymentMonitoringJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $jobServiceClient->resumeModelDeploymentMonitoringJob($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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 = JobServiceClient::modelDeploymentMonitoringJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[MODEL_DEPLOYMENT_MONITORING_JOB]'
    );

    resume_model_deployment_monitoring_job_sample($formattedName);
}

searchModelDeploymentMonitoringStatsAnomalies

Searches Model Monitoring Statistics generated within a given time window.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::searchModelDeploymentMonitoringStatsAnomaliesAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ModelMonitoringStatsAnomalies;
use Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest;
use Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest\StatsAnomaliesObjective;

/**
 * @param string $formattedModelDeploymentMonitoringJob ModelDeploymentMonitoring Job resource name.
 *                                                      Format:
 *                                                      `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
 *                                                      Please see {@see JobServiceClient::modelDeploymentMonitoringJobName()} for help formatting this field.
 * @param string $deployedModelId                       The DeployedModel ID of the
 *                                                      [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id].
 */
function search_model_deployment_monitoring_stats_anomalies_sample(
    string $formattedModelDeploymentMonitoringJob,
    string $deployedModelId
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $objectives = [new StatsAnomaliesObjective()];
    $request = (new SearchModelDeploymentMonitoringStatsAnomaliesRequest())
        ->setModelDeploymentMonitoringJob($formattedModelDeploymentMonitoringJob)
        ->setDeployedModelId($deployedModelId)
        ->setObjectives($objectives);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->searchModelDeploymentMonitoringStatsAnomalies($request);

        /** @var ModelMonitoringStatsAnomalies $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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
{
    $formattedModelDeploymentMonitoringJob = JobServiceClient::modelDeploymentMonitoringJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[MODEL_DEPLOYMENT_MONITORING_JOB]'
    );
    $deployedModelId = '[DEPLOYED_MODEL_ID]';

    search_model_deployment_monitoring_stats_anomalies_sample(
        $formattedModelDeploymentMonitoringJob,
        $deployedModelId
    );
}

updateModelDeploymentMonitoringJob

Updates a ModelDeploymentMonitoringJob.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::updateModelDeploymentMonitoringJobAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateModelDeploymentMonitoringJobRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringJob;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringObjectiveConfig;
use Google\Cloud\AIPlatform\V1\ModelDeploymentMonitoringScheduleConfig;
use Google\Cloud\AIPlatform\V1\SamplingStrategy;
use Google\Cloud\AIPlatform\V1\UpdateModelDeploymentMonitoringJobRequest;
use Google\Protobuf\Duration;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $modelDeploymentMonitoringJobDisplayName       The user-defined name of the ModelDeploymentMonitoringJob.
 *                                                              The name can be up to 128 characters long and can consist of any UTF-8
 *                                                              characters.
 *                                                              Display name of a ModelDeploymentMonitoringJob.
 * @param string $formattedModelDeploymentMonitoringJobEndpoint Endpoint resource name.
 *                                                              Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
 *                                                              Please see {@see JobServiceClient::endpointName()} for help formatting this field.
 */
function update_model_deployment_monitoring_job_sample(
    string $modelDeploymentMonitoringJobDisplayName,
    string $formattedModelDeploymentMonitoringJobEndpoint
): void {
    // Create a client.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs = [
        new ModelDeploymentMonitoringObjectiveConfig()
    ];
    $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfigMonitorInterval = new Duration();
    $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig = (new ModelDeploymentMonitoringScheduleConfig())
        ->setMonitorInterval(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfigMonitorInterval
        );
    $modelDeploymentMonitoringJobLoggingSamplingStrategy = new SamplingStrategy();
    $modelDeploymentMonitoringJob = (new ModelDeploymentMonitoringJob())
        ->setDisplayName($modelDeploymentMonitoringJobDisplayName)
        ->setEndpoint($formattedModelDeploymentMonitoringJobEndpoint)
        ->setModelDeploymentMonitoringObjectiveConfigs(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringObjectiveConfigs
        )
        ->setModelDeploymentMonitoringScheduleConfig(
            $modelDeploymentMonitoringJobModelDeploymentMonitoringScheduleConfig
        )
        ->setLoggingSamplingStrategy($modelDeploymentMonitoringJobLoggingSamplingStrategy);
    $updateMask = new FieldMask();
    $request = (new UpdateModelDeploymentMonitoringJobRequest())
        ->setModelDeploymentMonitoringJob($modelDeploymentMonitoringJob)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $jobServiceClient->updateModelDeploymentMonitoringJob($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var ModelDeploymentMonitoringJob $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());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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
{
    $modelDeploymentMonitoringJobDisplayName = '[DISPLAY_NAME]';
    $formattedModelDeploymentMonitoringJobEndpoint = JobServiceClient::endpointName(
        '[PROJECT]',
        '[LOCATION]',
        '[ENDPOINT]'
    );

    update_model_deployment_monitoring_job_sample(
        $modelDeploymentMonitoringJobDisplayName,
        $formattedModelDeploymentMonitoringJobEndpoint
    );
}

getLocation

Gets information about a location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getLocationAsync() .

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
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.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $jobServiceClient->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.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
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.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $jobServiceClient->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.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
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.
    $jobServiceClient = new JobServiceClient();

    // Prepare the request message.
    $request = (new GetIamPolicyRequest())
        ->setResource($resource);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $jobServiceClient->getIamPolicy($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
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.
    $jobServiceClient = new JobServiceClient();

    // 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 = $jobServiceClient->setIamPolicy($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

A request to house fields associated with the call.

callOptions 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
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\JobServiceClient;
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.
    $jobServiceClient = new JobServiceClient();

    // 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 = $jobServiceClient->testIamPermissions($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * 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);
}

cancelBatchPredictionJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelBatchPredictionJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

cancelCustomJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelCustomJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

cancelDataLabelingJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelDataLabelingJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

cancelHyperparameterTuningJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelHyperparameterTuningJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

cancelNasJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CancelNasJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createBatchPredictionJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateBatchPredictionJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCustomJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateCustomJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createDataLabelingJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateDataLabelingJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createHyperparameterTuningJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateHyperparameterTuningJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createNasJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateNasJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteBatchPredictionJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteBatchPredictionJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteCustomJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteCustomJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDataLabelingJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteDataLabelingJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteHyperparameterTuningJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteHyperparameterTuningJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteNasJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteNasJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getBatchPredictionJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetBatchPredictionJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCustomJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetCustomJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDataLabelingJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetDataLabelingJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getHyperparameterTuningJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetHyperparameterTuningJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getNasJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetNasJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getNasTrialDetailAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetNasTrialDetailRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listBatchPredictionJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListBatchPredictionJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCustomJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListCustomJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDataLabelingJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListDataLabelingJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listHyperparameterTuningJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListHyperparameterTuningJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listModelDeploymentMonitoringJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListModelDeploymentMonitoringJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listNasJobsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListNasJobsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listNasTrialDetailsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListNasTrialDetailsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

pauseModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PauseModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

resumeModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ResumeModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

searchModelDeploymentMonitoringStatsAnomaliesAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\SearchModelDeploymentMonitoringStatsAnomaliesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateModelDeploymentMonitoringJobAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateModelDeploymentMonitoringJobRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

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

Returns
TypeDescription
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::batchPredictionJobName

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

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

static::contextName

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

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

static::customJobName

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

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

static::dataLabelingJobName

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

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

static::datasetName

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

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

static::endpointName

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

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

static::hyperparameterTuningJobName

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

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

static::locationName

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

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

static::modelName

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

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

static::modelDeploymentMonitoringJobName

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

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

static::nasJobName

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

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

static::nasTrialDetailName

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

Parameters
NameDescription
project string
location string
nasJob string
nasTrialDetail string
Returns
TypeDescription
stringThe formatted nas_trial_detail resource.

static::networkName

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

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

static::projectLocationEndpointName

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

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

static::projectLocationPublisherModelName

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

Parameters
NameDescription
project string
location string
publisher string
model string
Returns
TypeDescription
stringThe formatted project_location_publisher_model resource.

static::tensorboardName

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

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

static::trialName

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

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

static::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

  • batchPredictionJob: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}
  • context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}
  • customJob: projects/{project}/locations/{location}/customJobs/{custom_job}
  • dataLabelingJob: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}
  • dataset: projects/{project}/locations/{location}/datasets/{dataset}
  • endpoint: projects/{project}/locations/{location}/endpoints/{endpoint}
  • hyperparameterTuningJob: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}
  • location: projects/{project}/locations/{location}
  • model: projects/{project}/locations/{location}/models/{model}
  • modelDeploymentMonitoringJob: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}
  • nasJob: projects/{project}/locations/{location}/nasJobs/{nas_job}
  • nasTrialDetail: projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}
  • network: projects/{project}/global/networks/{network}
  • projectLocationEndpoint: projects/{project}/locations/{location}/endpoints/{endpoint}
  • projectLocationPublisherModel: projects/{project}/locations/{location}/publishers/{publisher}/models/{model}
  • tensorboard: projects/{project}/locations/{location}/tensorboards/{tensorboard}
  • trial: projects/{project}/locations/{location}/studies/{study}/trials/{trial}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

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