Method: instances.clone Stay organized with collections Save and categorize content based on your preferences.
- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- InstancesCloneRequest
- CloneContext
- BinLogCoordinates
- Examples
- Try it!
Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
HTTP request
POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/clone
The URL usesgRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID of the source as well as the clone Cloud SQL instance. |
instance |
The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. |
Request body
The request body contains an instance ofInstancesCloneRequest
.
Response body
If successful, the response body contains an instance ofOperation
.
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/sqlservice.admin
For more information, see theAuthentication Overview.
InstancesCloneRequest
Database instance clone request.
JSON representation |
---|
{"cloneContext":{object ( |
Fields | |
---|---|
cloneContext |
Contains details about the clone operation. |
CloneContext
Database instance clone context.
JSON representation |
---|
{"kind":string,"pitrTimestampMs":string,"destinationInstanceName":string,"binLogCoordinates":{object ( |
Fields | |
---|---|
kind |
This is always |
pitrTimestampMs |
Reserved for future use. |
destinationInstanceName |
Name of the Cloud SQL instance to be created as a clone. |
binLogCoordinates |
Binary log coordinates, if specified, identify the position up to which the source instance is cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates. |
pointInTime |
Timestamp, if specified, identifies the time to which the source instance is cloned. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
allocatedIpRange |
The name of the allocated ip range for the private ip Cloud SQL instance. For example: "google-managed-services-default". If set, the cloned instance ip will be created in the allocated range. The range name must comply withRFC 1035. Specifically, the name must be 1-63 characters long and match the regular expressiona-z?. Reserved for future use. |
databaseNames[] |
(SQL Server only) instances.clone only the specified databases from the source instance. instances.clone all databases if empty. |
BinLogCoordinates
Binary log coordinates.
JSON representation |
---|
{"binLogFileName":string,"binLogPosition":string,"kind":string} |
Fields | |
---|---|
binLogFileName |
Name of the binary log file for a Cloud SQL instance. |
binLogPosition |
Position (offset) within the binary log file. |
kind |
This is always |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-30 UTC.