Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Instances: clone

Requires authorization

Creates a Cloud SQL instance as a clone of a source instance. Try it now .

The source instance must have automated backups and binary logging enabled for the clone operation to succeed.

Request

HTTP request

POST https://www.googleapis.com/sql/v1beta3/projects/project/instances/clone

Parameters

Parameter name Value Description
Path parameters
project string Project ID of the source as well as the clone Cloud SQL instance.

Authorization

This request requires authorization with the following scope ( read more about authentication and authorization ).

Scope
https://www.googleapis.com/auth/sqlservice.admin

Request body

In the request body, supply data with the following structure:

{
  "cloneContext": {
    "kind": "sql#cloneContext",
    "sourceInstanceName": string,
    "destinationInstanceName": string,
    "binLogCoordinates": {
      "kind": "sql#binLogCoordinates",
      "binLogFileName": string,
      "binLogPosition": long
    }
  }
}
Property name Value Description Notes
cloneContext nested object Contains details about the clone operation.
cloneContext. kind string This is always sql#cloneContext .
cloneContext. sourceInstanceName string Name of the Cloud SQL instance to be cloned.
cloneContext. destinationInstanceName string Name of the Cloud SQL instance to be created as a clone.
cloneContext. binLogCoordinates nested object Binary log coordinates, if specified, indentify the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates.
cloneContext.binLogCoordinates. kind string This is always sql#binLogCoordinates .
cloneContext.binLogCoordinates. binLogFileName string Name of the binary log file for a Cloud SQL instance.
cloneContext.binLogCoordinates. binLogPosition long Position (offset) within the binary log file.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "sql#instancesClone",
  "operation": string
}
Property name Value Description Notes
kind string This is always sql#instancesClone .
operation string An unique identifier for the operation associated with the cloned instance. You can use this identifier to retrieve the Operations resource, which has information about the operation.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.