Method: projects.locations.models.copy

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 Model.metadata content to be region-agnostic, as well as making sure that any resources (e.g. files) it depends on remain accessible.

HTTP request

POST https://{service-endpoint}/v1/{parent}/models:copy

Where {service-endpoint} is one of the supported service endpoints.

Path parameters

Parameters
parent

string

Required. The resource name of the Location into which to copy the Model. Format: projects/{project}/locations/{location}

Request body

The request body contains data with the following structure:

JSON representation
{
  "sourceModel": string,
  "encryptionSpec": {
    object (EncryptionSpec)
  },

  // Union field destination_model can be only one of the following:
  "modelId": string,
  "parentModel": string
  // End of list of possible types for union field destination_model.
}
Fields
sourceModel

string

Required. The resource name of the Model to copy. That Model must be in the same Project. Format: projects/{project}/locations/{location}/models/{model}

encryptionSpec

object (EncryptionSpec)

Customer-managed encryption key options. If this is set, then the Model copy will be encrypted with the provided encryption key.

Union field destination_model. If both fields are unset, a new Model will be created with a generated ID. destination_model can be only one of the following:
modelId

string

Optional. Copy sourceModel 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.

parentModel

string

Optional. Specify this field to copy sourceModel into this existing Model as a new version. Format: projects/{project}/locations/{location}/models/{model}

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • aiplatform.models.upload

For more information, see the IAM documentation.