Class v1.ModelServiceClient (6.2.0)

A service for managing Vertex AI's machine learning Models. v1

Package

@google-cloud/aiplatform

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of ModelServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new ModelServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

modelServiceStub

modelServiceStub?: Promise<{
        [name: string]: Function;
    }>;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

annotationPath(project, location, dataset, dataItem, annotation)

annotationPath(project: string, location: string, dataset: string, dataItem: string, annotation: string): string;

Return a fully-qualified annotation resource name string.

Parameters
Name Description
project string
location string
dataset string
dataItem string
annotation string
Returns
Type Description
string

{string} Resource name string.

annotationSpecPath(project, location, dataset, annotationSpec)

annotationSpecPath(project: string, location: string, dataset: string, annotationSpec: string): string;

Return a fully-qualified annotationSpec resource name string.

Parameters
Name Description
project string
location string
dataset string
annotationSpec string
Returns
Type Description
string

{string} Resource name string.

artifactPath(project, location, metadataStore, artifact)

artifactPath(project: string, location: string, metadataStore: string, artifact: string): string;

Return a fully-qualified artifact resource name string.

Parameters
Name Description
project string
location string
metadataStore string
artifact string
Returns
Type Description
string

{string} Resource name string.

batchImportEvaluatedAnnotations(request, options)

batchImportEvaluatedAnnotations(request?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse,
        protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | undefined,
        {} | undefined
    ]>;

Imports a list of externally generated EvaluatedAnnotations.

Parameters
Name Description
request IBatchImportEvaluatedAnnotationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BatchImportEvaluatedAnnotationsResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent ModelEvaluationSlice resource.
   *  Format:
   *  `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Evaluated annotations resource to be imported.
   */
  // const evaluatedAnnotations = [1,2,3,4]

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callBatchImportEvaluatedAnnotations() {
    // Construct request
    const request = {
      parent,
      evaluatedAnnotations,
    };

    // Run request
    const response = await aiplatformClient.batchImportEvaluatedAnnotations(request);
    console.log(response);
  }

  callBatchImportEvaluatedAnnotations();

batchImportEvaluatedAnnotations(request, options, callback)

batchImportEvaluatedAnnotations(request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchImportEvaluatedAnnotationsRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchImportEvaluatedAnnotations(request, callback)

batchImportEvaluatedAnnotations(request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchImportEvaluatedAnnotationsRequest
callback Callback<protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchImportModelEvaluationSlices(request, options)

batchImportModelEvaluationSlices(request?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse,
        protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | undefined,
        {} | undefined
    ]>;

Imports a list of externally generated ModelEvaluationSlice.

Parameters
Name Description
request IBatchImportModelEvaluationSlicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BatchImportModelEvaluationSlicesResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent ModelEvaluation resource.
   *  Format:
   *  `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Model evaluation slice resource to be imported.
   */
  // const modelEvaluationSlices = [1,2,3,4]

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callBatchImportModelEvaluationSlices() {
    // Construct request
    const request = {
      parent,
      modelEvaluationSlices,
    };

    // Run request
    const response = await aiplatformClient.batchImportModelEvaluationSlices(request);
    console.log(response);
  }

  callBatchImportModelEvaluationSlices();

batchImportModelEvaluationSlices(request, options, callback)

batchImportModelEvaluationSlices(request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchImportModelEvaluationSlicesRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchImportModelEvaluationSlices(request, callback)

batchImportModelEvaluationSlices(request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchImportModelEvaluationSlicesRequest
callback Callback<protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchPredictionJobPath(project, location, batchPredictionJob)

batchPredictionJobPath(project: string, location: string, batchPredictionJob: string): string;

Return a fully-qualified batchPredictionJob resource name string.

Parameters
Name Description
project string
location string
batchPredictionJob string
Returns
Type Description
string

{string} Resource name string.

cachedContentPath(project, location, cachedContent)

cachedContentPath(project: string, location: string, cachedContent: string): string;

Return a fully-qualified cachedContent resource name string.

Parameters
Name Description
project string
location string
cachedContent string
Returns
Type Description
string

{string} Resource name string.

cancelOperation(request, optionsOrCallback, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkCopyModelProgress(name)

checkCopyModelProgress(name: string): Promise<LROperation<protos.google.cloud.aiplatform.v1.CopyModelResponse, protos.google.cloud.aiplatform.v1.CopyModelOperationMetadata>>;

Check the status of the long running operation returned by copyModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.aiplatform.v1.CopyModelResponse, protos.google.cloud.aiplatform.v1.CopyModelOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Copy source_model into a new Model with this ID. The ID will
   *  become the final component of the model resource name.
   *  This value may be up to 63 characters, and valid characters are
   *  `[a-z0-9_-]`. The first character cannot be a number or hyphen.
   */
  // const modelId = 'abc123'
  /**
   *  Optional. Specify this field to copy source_model into this existing
   *  Model as a new version. Format:
   *  `projects/{project}/locations/{location}/models/{model}`
   */
  // const parentModel = 'abc123'
  /**
   *  Required. The resource name of the Location into which to copy the Model.
   *  Format: `projects/{project}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The resource name of the Model to copy. That Model must be in the
   *  same Project. Format:
   *  `projects/{project}/locations/{location}/models/{model}`
   */
  // const sourceModel = 'abc123'
  /**
   *  Customer-managed encryption key options. If this is set,
   *  then the Model copy will be encrypted with the provided encryption key.
   */
  // const encryptionSpec = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callCopyModel() {
    // Construct request
    const request = {
      parent,
      sourceModel,
    };

    // Run request
    const [operation] = await aiplatformClient.copyModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCopyModel();

checkDeleteModelProgress(name)

checkDeleteModelProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.aiplatform.v1.DeleteOperationMetadata>>;

Check the status of the long running operation returned by deleteModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.aiplatform.v1.DeleteOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Model resource to be deleted.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callDeleteModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await aiplatformClient.deleteModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteModel();

checkDeleteModelVersionProgress(name)

checkDeleteModelVersionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.aiplatform.v1.DeleteOperationMetadata>>;

Check the status of the long running operation returned by deleteModelVersion().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.aiplatform.v1.DeleteOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the model version to be deleted, with a version ID
   *  explicitly included.
   *  Example: `projects/{project}/locations/{location}/models/{model}@1234`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callDeleteModelVersion() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await aiplatformClient.deleteModelVersion(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteModelVersion();

checkExportModelProgress(name)

checkExportModelProgress(name: string): Promise<LROperation<protos.google.cloud.aiplatform.v1.ExportModelResponse, protos.google.cloud.aiplatform.v1.ExportModelOperationMetadata>>;

Check the status of the long running operation returned by exportModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.aiplatform.v1.ExportModelResponse, protos.google.cloud.aiplatform.v1.ExportModelOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Model to export.
   *  The resource name may contain version id or version alias to specify the
   *  version, if no version is specified, the default version will be exported.
   */
  // const name = 'abc123'
  /**
   *  Required. The desired output location and configuration.
   */
  // const outputConfig = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callExportModel() {
    // Construct request
    const request = {
      name,
      outputConfig,
    };

    // Run request
    const [operation] = await aiplatformClient.exportModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportModel();

checkUpdateExplanationDatasetProgress(name)

checkUpdateExplanationDatasetProgress(name: string): Promise<LROperation<protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse, protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata>>;

Check the status of the long running operation returned by updateExplanationDataset().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse, protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Model to update.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   */
  // const model = 'abc123'
  /**
   *  The example config containing the location of the dataset.
   */
  // const examples = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callUpdateExplanationDataset() {
    // Construct request
    const request = {
      model,
    };

    // Run request
    const [operation] = await aiplatformClient.updateExplanationDataset(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateExplanationDataset();

checkUploadModelProgress(name)

checkUploadModelProgress(name: string): Promise<LROperation<protos.google.cloud.aiplatform.v1.UploadModelResponse, protos.google.cloud.aiplatform.v1.UploadModelOperationMetadata>>;

Check the status of the long running operation returned by uploadModel().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.aiplatform.v1.UploadModelResponse, protos.google.cloud.aiplatform.v1.UploadModelOperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Location into which to upload the Model.
   *  Format: `projects/{project}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Optional. The resource name of the model into which to upload the version.
   *  Only specify this field when uploading a new version.
   */
  // const parentModel = 'abc123'
  /**
   *  Optional. The ID to use for the uploaded Model, which will become the final
   *  component of the model resource name.
   *  This value may be up to 63 characters, and valid characters are
   *  `[a-z0-9_-]`. The first character cannot be a number or hyphen.
   */
  // const modelId = 'abc123'
  /**
   *  Required. The Model to create.
   */
  // const model = {}
  /**
   *  Optional. The user-provided custom service account to use to do the model
   *  upload. If empty, Vertex AI Service
   *  Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
   *  will be used to access resources needed to upload the model. This account
   *  must belong to the target project where the model is uploaded to, i.e., the
   *  project specified in the `parent` field of this request and have necessary
   *  read permissions (to Google Cloud Storage, Artifact Registry, etc.).
   */
  // const serviceAccount = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callUploadModel() {
    // Construct request
    const request = {
      parent,
      model,
    };

    // Run request
    const [operation] = await aiplatformClient.uploadModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUploadModel();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

contextPath(project, location, metadataStore, context)

contextPath(project: string, location: string, metadataStore: string, context: string): string;

Return a fully-qualified context resource name string.

Parameters
Name Description
project string
location string
metadataStore string
context string
Returns
Type Description
string

{string} Resource name string.

copyModel(request, options)

copyModel(request?: protos.google.cloud.aiplatform.v1.ICopyModelRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Copies an already existing Vertex AI Model into the specified Location. The source Model must exist in the same Project. When copying custom Models, the users themselves are responsible for content to be region-agnostic, as well as making sure that any resources (e.g. files) it depends on remain accessible.

Parameters
Name Description
request ICopyModelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Copy source_model into a new Model with this ID. The ID will
   *  become the final component of the model resource name.
   *  This value may be up to 63 characters, and valid characters are
   *  `[a-z0-9_-]`. The first character cannot be a number or hyphen.
   */
  // const modelId = 'abc123'
  /**
   *  Optional. Specify this field to copy source_model into this existing
   *  Model as a new version. Format:
   *  `projects/{project}/locations/{location}/models/{model}`
   */
  // const parentModel = 'abc123'
  /**
   *  Required. The resource name of the Location into which to copy the Model.
   *  Format: `projects/{project}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The resource name of the Model to copy. That Model must be in the
   *  same Project. Format:
   *  `projects/{project}/locations/{location}/models/{model}`
   */
  // const sourceModel = 'abc123'
  /**
   *  Customer-managed encryption key options. If this is set,
   *  then the Model copy will be encrypted with the provided encryption key.
   */
  // const encryptionSpec = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callCopyModel() {
    // Construct request
    const request = {
      parent,
      sourceModel,
    };

    // Run request
    const [operation] = await aiplatformClient.copyModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCopyModel();

copyModel(request, options, callback)

copyModel(request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICopyModelRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

copyModel(request, callback)

copyModel(request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, callback: Callback<LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICopyModelRequest
callback Callback<LROperation<protos.google.cloud.aiplatform.v1.ICopyModelResponse, protos.google.cloud.aiplatform.v1.ICopyModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

customJobPath(project, location, customJob)

customJobPath(project: string, location: string, customJob: string): string;

Return a fully-qualified customJob resource name string.

Parameters
Name Description
project string
location string
customJob string
Returns
Type Description
string

{string} Resource name string.

dataItemPath(project, location, dataset, dataItem)

dataItemPath(project: string, location: string, dataset: string, dataItem: string): string;

Return a fully-qualified dataItem resource name string.

Parameters
Name Description
project string
location string
dataset string
dataItem string
Returns
Type Description
string

{string} Resource name string.

dataLabelingJobPath(project, location, dataLabelingJob)

dataLabelingJobPath(project: string, location: string, dataLabelingJob: string): string;

Return a fully-qualified dataLabelingJob resource name string.

Parameters
Name Description
project string
location string
dataLabelingJob string
Returns
Type Description
string

{string} Resource name string.

datasetPath(project, location, dataset)

datasetPath(project: string, location: string, dataset: string): string;

Return a fully-qualified dataset resource name string.

Parameters
Name Description
project string
location string
dataset string
Returns
Type Description
string

{string} Resource name string.

datasetVersionPath(project, location, dataset, datasetVersion)

datasetVersionPath(project: string, location: string, dataset: string, datasetVersion: string): string;

Return a fully-qualified datasetVersion resource name string.

Parameters
Name Description
project string
location string
dataset string
datasetVersion string
Returns
Type Description
string

{string} Resource name string.

deleteModel(request, options)

deleteModel(request?: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a Model.

A model cannot be deleted if any Endpoint resource has a based on the model in its field.

Parameters
Name Description
request IDeleteModelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Model resource to be deleted.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callDeleteModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await aiplatformClient.deleteModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteModel();

deleteModel(request, options, callback)

deleteModel(request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteModelRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteModel(request, callback)

deleteModel(request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteModelRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteModelVersion(request, options)

deleteModelVersion(request?: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a Model version.

Model version can only be deleted if there are no created from it. Deleting the only version in the Model is not allowed. Use for deleting the Model instead.

Parameters
Name Description
request IDeleteModelVersionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the model version to be deleted, with a version ID
   *  explicitly included.
   *  Example: `projects/{project}/locations/{location}/models/{model}@1234`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callDeleteModelVersion() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await aiplatformClient.deleteModelVersion(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteModelVersion();

deleteModelVersion(request, options, callback)

deleteModelVersion(request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteModelVersionRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteModelVersion(request, callback)

deleteModelVersion(request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteModelVersionRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteOperation(request, optionsOrCallback, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request DeleteOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deploymentResourcePoolPath(project, location, deploymentResourcePool)

deploymentResourcePoolPath(project: string, location: string, deploymentResourcePool: string): string;

Return a fully-qualified deploymentResourcePool resource name string.

Parameters
Name Description
project string
location string
deploymentResourcePool string
Returns
Type Description
string

{string} Resource name string.

entityTypePath(project, location, featurestore, entityType)

entityTypePath(project: string, location: string, featurestore: string, entityType: string): string;

Return a fully-qualified entityType resource name string.

Parameters
Name Description
project string
location string
featurestore string
entityType string
Returns
Type Description
string

{string} Resource name string.

executionPath(project, location, metadataStore, execution)

executionPath(project: string, location: string, metadataStore: string, execution: string): string;

Return a fully-qualified execution resource name string.

Parameters
Name Description
project string
location string
metadataStore string
execution string
Returns
Type Description
string

{string} Resource name string.

exportModel(request, options)

exportModel(request?: protos.google.cloud.aiplatform.v1.IExportModelRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Exports a trained, exportable Model to a location specified by the user. A Model is considered to be exportable if it has at least one [supported export format][google.cloud.aiplatform.v1.Model.supported_export_formats].

Parameters
Name Description
request IExportModelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Model to export.
   *  The resource name may contain version id or version alias to specify the
   *  version, if no version is specified, the default version will be exported.
   */
  // const name = 'abc123'
  /**
   *  Required. The desired output location and configuration.
   */
  // const outputConfig = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callExportModel() {
    // Construct request
    const request = {
      name,
      outputConfig,
    };

    // Run request
    const [operation] = await aiplatformClient.exportModel(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportModel();

exportModel(request, options, callback)

exportModel(request: protos.google.cloud.aiplatform.v1.IExportModelRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IExportModelRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

exportModel(request, callback)

exportModel(request: protos.google.cloud.aiplatform.v1.IExportModelRequest, callback: Callback<LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IExportModelRequest
callback Callback<LROperation<protos.google.cloud.aiplatform.v1.IExportModelResponse, protos.google.cloud.aiplatform.v1.IExportModelOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

featureGroupPath(project, location, featureGroup)

featureGroupPath(project: string, location: string, featureGroup: string): string;

Return a fully-qualified featureGroup resource name string.

Parameters
Name Description
project string
location string
featureGroup string
Returns
Type Description
string

{string} Resource name string.

featureOnlineStorePath(project, location, featureOnlineStore)

featureOnlineStorePath(project: string, location: string, featureOnlineStore: string): string;

Return a fully-qualified featureOnlineStore resource name string.

Parameters
Name Description
project string
location string
featureOnlineStore string
Returns
Type Description
string

{string} Resource name string.

featurestorePath(project, location, featurestore)

featurestorePath(project: string, location: string, featurestore: string): string;

Return a fully-qualified featurestore resource name string.

Parameters
Name Description
project string
location string
featurestore string
Returns
Type Description
string

{string} Resource name string.

featureViewPath(project, location, featureOnlineStore, featureView)

featureViewPath(project: string, location: string, featureOnlineStore: string, featureView: string): string;

Return a fully-qualified featureView resource name string.

Parameters
Name Description
project string
location string
featureOnlineStore string
featureView string
Returns
Type Description
string

{string} Resource name string.

featureViewSyncPath(project, location, featureOnlineStore, featureView)

featureViewSyncPath(project: string, location: string, featureOnlineStore: string, featureView: string): string;

Return a fully-qualified featureViewSync resource name string.

Parameters
Name Description
project string
location string
featureOnlineStore string
featureView string
Returns
Type Description
string

{string} Resource name string.

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
Name Description
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type Description
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
Name Description
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
Promise<google.cloud.location.ILocation>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

const [response] = await client.getLocation(request);

getModel(request, options)

getModel(request?: protos.google.cloud.aiplatform.v1.IGetModelRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModel,
        protos.google.cloud.aiplatform.v1.IGetModelRequest | undefined,
        {} | undefined
    ]>;

Gets a Model.

Parameters
Name Description
request IGetModelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModel, protos.google.cloud.aiplatform.v1.IGetModelRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Model resource.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   *  In order to retrieve a specific version of the model, also provide
   *  the version ID or version alias.
   *    Example: `projects/{project}/locations/{location}/models/{model}@2`
   *               or
   *             `projects/{project}/locations/{location}/models/{model}@golden`
   *  If no version ID or alias is specified, the "default" version will be
   *  returned. The "default" version alias is created for the first version of
   *  the model, and can be moved to other versions later on. There will be
   *  exactly one default version.
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callGetModel() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await aiplatformClient.getModel(request);
    console.log(response);
  }

  callGetModel();

getModel(request, options, callback)

getModel(request: protos.google.cloud.aiplatform.v1.IGetModelRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IModel, protos.google.cloud.aiplatform.v1.IGetModelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IModel, protos.google.cloud.aiplatform.v1.IGetModelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getModel(request, callback)

getModel(request: protos.google.cloud.aiplatform.v1.IGetModelRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IModel, protos.google.cloud.aiplatform.v1.IGetModelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelRequest
callback Callback<protos.google.cloud.aiplatform.v1.IModel, protos.google.cloud.aiplatform.v1.IGetModelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getModelEvaluation(request, options)

getModelEvaluation(request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelEvaluation,
        protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | undefined,
        {} | undefined
    ]>;

Gets a ModelEvaluation.

Parameters
Name Description
request IGetModelEvaluationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the ModelEvaluation resource.
   *  Format:
   *  `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callGetModelEvaluation() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await aiplatformClient.getModelEvaluation(request);
    console.log(response);
  }

  callGetModelEvaluation();

getModelEvaluation(request, options, callback)

getModelEvaluation(request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelEvaluationRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getModelEvaluation(request, callback)

getModelEvaluation(request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelEvaluationRequest
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getModelEvaluationSlice(request, options)

getModelEvaluationSlice(request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelEvaluationSlice,
        protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | undefined,
        {} | undefined
    ]>;

Gets a ModelEvaluationSlice.

Parameters
Name Description
request IGetModelEvaluationSliceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the ModelEvaluationSlice resource.
   *  Format:
   *  `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
   */
  // const name = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callGetModelEvaluationSlice() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await aiplatformClient.getModelEvaluationSlice(request);
    console.log(response);
  }

  callGetModelEvaluationSlice();

getModelEvaluationSlice(request, options, callback)

getModelEvaluationSlice(request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelEvaluationSliceRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getModelEvaluationSlice(request, callback)

getModelEvaluationSlice(request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetModelEvaluationSliceRequest
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getOperation(request, optionsOrCallback, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
Name Description
request GetOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

hyperparameterTuningJobPath(project, location, hyperparameterTuningJob)

hyperparameterTuningJobPath(project: string, location: string, hyperparameterTuningJob: string): string;

Return a fully-qualified hyperparameterTuningJob resource name string.

Parameters
Name Description
project string
location string
hyperparameterTuningJob string
Returns
Type Description
string

{string} Resource name string.

importModelEvaluation(request, options)

importModelEvaluation(request?: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelEvaluation,
        protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | undefined,
        {} | undefined
    ]>;

Imports an externally generated ModelEvaluation.

Parameters
Name Description
request IImportModelEvaluationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent model resource.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Model evaluation resource to be imported.
   */
  // const modelEvaluation = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callImportModelEvaluation() {
    // Construct request
    const request = {
      parent,
      modelEvaluation,
    };

    // Run request
    const response = await aiplatformClient.importModelEvaluation(request);
    console.log(response);
  }

  callImportModelEvaluation();

importModelEvaluation(request, options, callback)

importModelEvaluation(request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, options: CallOptions, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IImportModelEvaluationRequest
options CallOptions
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

importModelEvaluation(request, callback)

importModelEvaluation(request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, callback: Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IImportModelEvaluationRequest
callback Callback<protos.google.cloud.aiplatform.v1.IModelEvaluation, protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

indexEndpointPath(project, location, indexEndpoint)

indexEndpointPath(project: string, location: string, indexEndpoint: string): string;

Return a fully-qualified indexEndpoint resource name string.

Parameters
Name Description
project string
location string
indexEndpoint string
Returns
Type Description
string

{string} Resource name string.

indexPath(project, location, index)

indexPath(project: string, location: string, index: string): string;

Return a fully-qualified index resource name string.

Parameters
Name Description
project string
location string
index string
Returns
Type Description
string

{string} Resource name string.

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type Description
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<google.cloud.location.ILocation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

listModelEvaluations(request, options)

listModelEvaluations(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelEvaluation[],
        protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest | null,
        protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse
    ]>;

Lists ModelEvaluations in a Model.

Parameters
Name Description
request IListModelEvaluationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelEvaluation[], protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest | null, protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listModelEvaluationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelEvaluations(request, options, callback)

listModelEvaluations(request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluation>): void;
Parameters
Name Description
request IListModelEvaluationsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluation>
Returns
Type Description
void

listModelEvaluations(request, callback)

listModelEvaluations(request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluation>): void;
Parameters
Name Description
request IListModelEvaluationsRequest
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluation>
Returns
Type Description
void

listModelEvaluationsAsync(request, options)

listModelEvaluationsAsync(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.aiplatform.v1.IModelEvaluation>;

Equivalent to listModelEvaluations, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListModelEvaluationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.aiplatform.v1.IModelEvaluation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Model to list the ModelEvaluations from.
   *  Format: `projects/{project}/locations/{location}/models/{model}`
   */
  // const parent = 'abc123'
  /**
   *  The standard list filter.
   */
  // const filter = 'abc123'
  /**
   *  The standard list page size.
   */
  // const pageSize = 1234
  /**
   *  The standard list page token.
   *  Typically obtained via
   *  ListModelEvaluationsResponse.next_page_token google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token 
   *  of the previous
   *  ModelService.ListModelEvaluations google.cloud.aiplatform.v1.ModelService.ListModelEvaluations 
   *  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Mask specifying which fields to read.
   */
  // const readMask = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callListModelEvaluations() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = aiplatformClient.listModelEvaluationsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListModelEvaluations();

listModelEvaluationSlices(request, options)

listModelEvaluationSlices(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[],
        protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest | null,
        protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse
    ]>;

Lists ModelEvaluationSlices in a ModelEvaluation.

Parameters
Name Description
request IListModelEvaluationSlicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[], protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest | null, protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listModelEvaluationSlicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelEvaluationSlices(request, options, callback)

listModelEvaluationSlices(request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void;
Parameters
Name Description
request IListModelEvaluationSlicesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>
Returns
Type Description
void

listModelEvaluationSlices(request, callback)

listModelEvaluationSlices(request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void;
Parameters
Name Description
request IListModelEvaluationSlicesRequest
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>
Returns
Type Description
void

listModelEvaluationSlicesAsync(request, options)

listModelEvaluationSlicesAsync(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>;

Equivalent to listModelEvaluationSlices, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListModelEvaluationSlicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the ModelEvaluation to list the
   *  ModelEvaluationSlices from. Format:
   *  `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
   */
  // const parent = 'abc123'
  /**
   *  The standard list filter.
   *    * `slice.dimension` - for =.
   */
  // const filter = 'abc123'
  /**
   *  The standard list page size.
   */
  // const pageSize = 1234
  /**
   *  The standard list page token.
   *  Typically obtained via
   *  ListModelEvaluationSlicesResponse.next_page_token google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token 
   *  of the previous
   *  ModelService.ListModelEvaluationSlices google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices 
   *  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Mask specifying which fields to read.
   */
  // const readMask = {}

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callListModelEvaluationSlices() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = aiplatformClient.listModelEvaluationSlicesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListModelEvaluationSlices();

listModelEvaluationSlicesStream(request, options)

listModelEvaluationSlicesStream(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, options?: CallOptions): Transform;

Equivalent to listModelEvaluationSlices, but returns a NodeJS Stream object.

Parameters
Name Description
request IListModelEvaluationSlicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listModelEvaluationSlicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelEvaluationsStream(request, options)

listModelEvaluationsStream(request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, options?: CallOptions): Transform;

Equivalent to listModelEvaluations, but returns a NodeJS Stream object.

Parameters
Name Description
request IListModelEvaluationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listModelEvaluationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModels(request, options)

listModels(request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModel[],
        protos.google.cloud.aiplatform.v1.IListModelsRequest | null,
        protos.google.cloud.aiplatform.v1.IListModelsResponse
    ]>;

Lists Models in a Location.

Parameters
Name Description
request IListModelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModel[], protos.google.cloud.aiplatform.v1.IListModelsRequest | null, protos.google.cloud.aiplatform.v1.IListModelsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listModelsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModels(request, options, callback)

listModels(request: protos.google.cloud.aiplatform.v1.IListModelsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelsRequest, protos.google.cloud.aiplatform.v1.IListModelsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>): void;
Parameters
Name Description
request IListModelsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelsRequest, protos.google.cloud.aiplatform.v1.IListModelsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>
Returns
Type Description
void

listModels(request, callback)

listModels(request: protos.google.cloud.aiplatform.v1.IListModelsRequest, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelsRequest, protos.google.cloud.aiplatform.v1.IListModelsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>): void;
Parameters
Name Description
request IListModelsRequest
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelsRequest, protos.google.cloud.aiplatform.v1.IListModelsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>
Returns
Type Description
void

listModelsAsync(request, options)

listModelsAsync(request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.aiplatform.v1.IModel>;

Equivalent to listModels, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListModelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.aiplatform.v1.IModel>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Location to list the Models from.
   *  Format: `projects/{project}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  An expression for filtering the results of the request. For field names
   *  both snake_case and camelCase are supported.
   *    * `model` supports = and !=. `model` represents the Model ID,
   *      i.e. the last segment of the Model's resource
   *      name google.cloud.aiplatform.v1.Model.name.
   *    * `display_name` supports = and !=
   *    * `labels` supports general map functions that is:
   *      * `labels.key=value` - key:value equality
   *      * `labels.key:* or labels:key - key existence
   *      * A key including a space must be quoted. `labels."a key"`.
   *    * `base_model_name` only supports =
   *  Some examples:
   *    * `model=1234`
   *    * `displayName="myDisplayName"`
   *    * `labels.myKey="myValue"`
   *    * `baseModelName="text-bison"`
   */
  // const filter = 'abc123'
  /**
   *  The standard list page size.
   */
  // const pageSize = 1234
  /**
   *  The standard list page token.
   *  Typically obtained via
   *  ListModelsResponse.next_page_token google.cloud.aiplatform.v1.ListModelsResponse.next_page_token 
   *  of the previous
   *  ModelService.ListModels google.cloud.aiplatform.v1.ModelService.ListModels 
   *  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Mask specifying which fields to read.
   */
  // const readMask = {}
  /**
   *  A comma-separated list of fields to order by, sorted in ascending order.
   *  Use "desc" after a field name for descending.
   *  Supported fields:
   *    * `display_name`
   *    * `create_time`
   *    * `update_time`
   *  Example: `display_name, create_time desc`.
   */
  // const orderBy = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callListModels() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = aiplatformClient.listModelsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListModels();

listModelsStream(request, options)

listModelsStream(request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, options?: CallOptions): Transform;

Equivalent to listModels, but returns a NodeJS Stream object.

Parameters
Name Description
request IListModelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listModelsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelVersionCheckpoints(request, options)

listModelVersionCheckpoints(request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[],
        protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest | null,
        protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse
    ]>;

Lists checkpoints of the specified model version.

Parameters
Name Description
request IListModelVersionCheckpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[], protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest | null, protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of ModelVersionCheckpoint. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listModelVersionCheckpointsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelVersionCheckpoints(request, options, callback)

listModelVersionCheckpoints(request: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>): void;
Parameters
Name Description
request IListModelVersionCheckpointsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>
Returns
Type Description
void

listModelVersionCheckpoints(request, callback)

listModelVersionCheckpoints(request: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>): void;
Parameters
Name Description
request IListModelVersionCheckpointsRequest
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>
Returns
Type Description
void

listModelVersionCheckpointsAsync(request, options)

listModelVersionCheckpointsAsync(request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>;

Equivalent to listModelVersionCheckpoints, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListModelVersionCheckpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ModelVersionCheckpoint. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the model version to list checkpoints for.
   *  `projects/{project}/locations/{location}/models/{model}@{version}`
   *  Example: `projects/{project}/locations/{location}/models/{model}@2`
   *  or
   *  `projects/{project}/locations/{location}/models/{model}@golden`
   *  If no version ID or alias is specified, the latest version will be
   *  used.
   */
  // const name = 'abc123'
  /**
   *  Optional. The standard list page size.
   */
  // const pageSize = 1234
  /**
   *  Optional. The standard list page token.
   *  Typically obtained via
   *  next_page_token google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token 
   *  of the previous
   *  ListModelVersionCheckpoints google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints 
   *  call.
   */
  // const pageToken = 'abc123'

  // Imports the Aiplatform library
  const {ModelServiceClient} = require('@google-cloud/aiplatform').v1;

  // Instantiates a client
  const aiplatformClient = new ModelServiceClient();

  async function callListModelVersionCheckpoints() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const iterable = aiplatformClient.listModelVersionCheckpointsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListModelVersionCheckpoints();

listModelVersionCheckpointsStream(request, options)

listModelVersionCheckpointsStream(request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, options?: CallOptions): Transform;

Equivalent to listModelVersionCheckpoints, but returns a NodeJS Stream object.

Parameters
Name Description
request IListModelVersionCheckpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing ModelVersionCheckpoint on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listModelVersionCheckpointsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelVersions(request, options)

listModelVersions(request?: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.aiplatform.v1.IModel[],
        protos.google.cloud.aiplatform.v1.IListModelVersionsRequest | null,
        protos.google.cloud.aiplatform.v1.IListModelVersionsResponse
    ]>;

Lists versions of the specified model.

Parameters
Name Description
request IListModelVersionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.aiplatform.v1.IModel[], protos.google.cloud.aiplatform.v1.IListModelVersionsRequest | null, protos.google.cloud.aiplatform.v1.IListModelVersionsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listModelVersionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listModelVersions(request, options, callback)

listModelVersions(request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>): void;
Parameters
Name Description
request IListModelVersionsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>
Returns
Type Description
void

listModelVersions(request, callback)

listModelVersions(request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, callback: PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>): void;
Parameters
Name Description
request IListModelVersionsRequest
callback PaginationCallback<protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, protos.google.cloud.aiplatform.v1.IListModelVersionsResponse | null | undefined, protos.google.cloud.aiplatform.v1.IModel>