Method: projects.locations.agents.restore

Restores the specified agent from a binary file.

Replaces the current agent with a new one. Note that all existing resources in agent (e.g. intents, entity types, flows) will be removed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Note: You should always train a flow prior to sending it queries. See the training documentation.

HTTP request

POST https://{endpoint}/v3beta1/{name=projects/*/locations/*/agents/*}:restore

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

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The name of the agent to restore into. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>.

Authorization requires the following IAM permission on the specified resource name:

  • dialogflow.agents.restore

Request body

The request body contains data with the following structure:

JSON representation
{
  "restoreOption": enum (RestoreOption),

  // Union field agent can be only one of the following:
  "agentUri": string,
  "agentContent": string,
  "gitSource": {
    object (GitSource)
  }
  // End of list of possible types for union field agent.
}
Fields
restoreOption

enum (RestoreOption)

Agent restore mode. If not specified, KEEP is assumed.

Union field agent. Required. The agent to restore. agent can be only one of the following:
agentUri

string

The Google Cloud Storage URI to restore agent from. The format of this URI must be gs://<bucket-name>/<object-name>.

Dialogflow performs a read operation for the Cloud Storage object on the caller's behalf, so your request authentication must have read permissions for the object. For more information, see Dialogflow access control.

agentContent

string (bytes format)

Uncompressed raw byte content for agent.

A base64-encoded string.

gitSource

object (GitSource)

Setting for restoring from a git branch

Response body

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

Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authentication Overview.

GitSource

Settings for restoring from a git branch

JSON representation
{
  "trackingBranch": string
}
Fields
trackingBranch

string

tracking branch for the git pull

RestoreOption

Restore option.

Enums
RESTORE_OPTION_UNSPECIFIED Unspecified. Treated as KEEP.
KEEP Always respect the settings from the exported agent file. It may cause a restoration failure if some settings (e.g. model type) are not supported in the target agent.
FALLBACK Fallback to default settings if some settings are not supported in the target agent.