Google

Cloud SQL Admin API

Cloud SQL Admin API

Data & analytics#openapi#analytics#media

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Cloud SQL Admin API

Endpoints 83

Backups

  • GETLists all backups associated with the project./v1/:parent/backups?filter=string&pageSize=0&pageToken=stringLists all backups associated with the project.
  • POSTCreates a backup for a Cloud SQL instance/v1/:parent/backupsCreates a backup for a Cloud SQL instance. This API can be used only to create on-demand backups.
  • PATCHUpdates the retention period and description of the backup/v1/:name?updateMask=stringUpdates the retention period and description of the backup. You can use this API to update final backups only.

blueGreenDeployments

  • GETRetrieves a blue-green deployment resource under a given project and location./v1/:name?view=BLUE_GREEN_DEPLOYMENT_VIEW_UNSPECIFIEDRetrieves a blue-green deployment resource under a given project and location.
  • DELETEDeletes a blue-green deployment./v1/:name?deleteOldSource=trueDeletes a blue-green deployment.
  • GETLists blue-green deployments under a given project./v1/:parent/blueGreenDeployments?filter=string&orderBy=string&pageSize=0&pageToken=stringLists blue-green deployments under a given project.
  • POSTCreates a blue-green deployment under a given project and location./v1/:parent/blueGreenDeployments?blueGreenDeploymentId=stringCreates a blue-green deployment under a given project and location.
  • POSTSwitches over to green instance for a blue-green deployment./v1/:name:switchoverSwitches over to green instance for a blue-green deployment.

backupRuns

  • GETRetrieves a resource containing information about a backup run./v1/projects/:project/instances/:instance/backupRuns/:idRetrieves a resource containing information about a backup run.
  • DELETEDeletes the backup taken by a backup run./v1/projects/:project/instances/:instance/backupRuns/:idDeletes the backup taken by a backup run.
  • GETLists all backup runs associated with the project or a given instance and configuration in the reverse chronological…/v1/projects/:project/instances/:instance/backupRuns?maxResults=0&pageToken=stringLists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.
  • POSTCreates a new backup run on demand./v1/projects/:project/instances/:instance/backupRunsCreates a new backup run on demand.

connect

  • POSTGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to…/v1/projects/:project/instances/:instance:generateEphemeralCertGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the…
  • GETRetrieves connect settings about a Cloud SQL instance./v1/projects/:project/instances/:instance/connectSettings?readTime=stringRetrieves connect settings about a Cloud SQL instance.
  • GETRetrieves connect settings about a Cloud SQL instance using the instance DNS name./v1/locations/:location/dns/:dnsName:resolveConnectSettingsRetrieves connect settings about a Cloud SQL instance using the instance DNS name.

databases

  • GETRetrieves a resource containing information about a database inside a Cloud SQL instance./v1/projects/:project/instances/:instance/databases/:database?location=stringRetrieves a resource containing information about a database inside a Cloud SQL instance.
  • PUTUpdates a resource containing information about a database inside a Cloud SQL instance./v1/projects/:project/instances/:instance/databases/:database?location=stringUpdates a resource containing information about a database inside a Cloud SQL instance.
  • DELETEDeletes a database from a Cloud SQL instance./v1/projects/:project/instances/:instance/databases/:database?location=stringDeletes a database from a Cloud SQL instance.
  • PATCHPartially updates a resource containing information about a database inside a Cloud SQL instance/v1/projects/:project/instances/:instance/databases/:database?location=stringPartially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
  • GETLists databases in the specified Cloud SQL instance./v1/projects/:project/instances/:instance/databases?location=stringLists databases in the specified Cloud SQL instance.
  • POSTInserts a resource containing information about a database inside a Cloud SQL instance/v1/projects/:project/instances/:instance/databases?location=stringInserts a resource containing information about a database inside a Cloud SQL instance. Note: You can't modify the default character set and collation.

flags

  • GETLists all available database flags for Cloud SQL instances./v1/flags?databaseVersion=string&flagScope=SQL_FLAG_SCOPE_UNSPECIFIEDLists all available database flags for Cloud SQL instances.

instances

  • GETLists all versions of EntraID certificates for the specified instance/v1/projects/:project/instances/:instance/listEntraIdCertificates?location=stringLists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently…
  • GETLists all versions of server certificates and certificate authorities (CAs) for the specified instance/v1/projects/:project/instances/:instance/listServerCertificates?location=stringLists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the…
  • POSTRotates the server certificate version to one previously added with the addEntraIdCertificate method./v1/projects/:project/instances/:instance/rotateEntraIdCertificate?location=stringRotates the server certificate version to one previously added with the addEntraIdCertificate method.
  • POSTRotates the server certificate version to one previously added with the addServerCertificate method/v1/projects/:project/instances/:instance/rotateServerCertificate?location=stringRotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service…
  • POSTAcquire a lease for the setup of SQL Server Reporting Services (SSRS)./v1/projects/:project/instances/:instance/acquireSsrsLease?location=stringAcquire a lease for the setup of SQL Server Reporting Services (SSRS).
  • POSTAdds a new Entra ID certificate for the specified instance/v1/projects/:project/instances/:instance/addEntraIdCertificate?location=stringAdds a new Entra ID certificate for the specified instance. If an Entra ID certificate was previously added but never used in a certificate rotation, this…
  • POSTAdds a new trusted Certificate Authority (CA) version for the specified instance/v1/projects/:project/instances/:instance/addServerCa?location=stringAdds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was…
  • POSTAdd a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS)…/v1/projects/:project/instances/:instance/addServerCertificate?location=stringAdd a new trusted server certificate version for the specified instance using Certificate Authority Service (CAS) server CA. Required to prepare for a…
  • POSTCreates a Cloud SQL instance as a clone of the source instance/v1/projects/:project/instances/:instance/clone?location=stringCreates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
  • GETRetrieves a resource containing information about a Cloud SQL instance./v1/projects/:project/instances/:instance?location=stringRetrieves a resource containing information about a Cloud SQL instance.
  • PUTUpdates settings of a Cloud SQL instance/v1/projects/:project/instances/:instance?location=stringUpdates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
  • DELETEDeletes a Cloud SQL instance./v1/projects/:project/instances/:instance?enableFinalBackup=true&finalBackupDescription=string&finalBackupExpiryTime=string&finalBackupTtlDays=string&location=stringDeletes a Cloud SQL instance.
  • PATCHPartially updates settings of a Cloud SQL instance by merging the request with the current configuration/v1/projects/:project/instances/:instance?location=string&reconcilePscNetworking=true&reconcilePscNetworkingForce=truePartially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
  • POSTDemotes an existing standalone instance to be a Cloud SQL read replica for an external database server./v1/projects/:project/instances/:instance/demote?location=stringDemotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
  • POSTDemotes the stand-alone instance to be a Cloud SQL read replica for an external database server./v1/projects/:project/instances/:instance/demoteMaster?location=stringDemotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
  • POSTExecute SQL statements./v1/projects/:project/instances/:instance/executeSql?location=stringExecute SQL statements.
  • POSTExports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file./v1/projects/:project/instances/:instance/export?location=stringExports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
  • POSTInitiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the…/v1/projects/:project/instances/:instance/failover?location=stringInitiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to…
  • POSTImports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage./v1/projects/:project/instances/:instance/import?location=stringImports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
  • GETLists instances under a given project./v1/projects/:project/instances?filter=string&location=string&maxResults=0&pageToken=stringLists instances under a given project.
  • POSTCreates a new Cloud SQL instance./v1/projects/:project/instances?location=stringCreates a new Cloud SQL instance.
  • GETLists all of the trusted Certificate Authorities (CAs) for the specified instance/v1/projects/:project/instances/:instance/listServerCas?location=stringLists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the…
  • POSTPoint in time restore for an instance managed by Google Cloud Backup and Disaster Recovery./v1/:parent:pointInTimeRestorePoint in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.
  • POSTExecute MVU Pre-checks/v1/projects/:project/instances/:instance/preCheckMajorVersionUpgrade?location=stringExecute MVU Pre-checks
  • POSTPromotes the read replica instance to be an independent Cloud SQL primary instance/v1/projects/:project/instances/:instance/promoteReplica?failover=true&location=stringPromotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.
  • POSTReencrypt CMEK instance with latest key version./v1/projects/:project/instances/:instance/reencrypt?location=stringReencrypt CMEK instance with latest key version.
  • POSTRelease a lease for the setup of SQL Server Reporting Services (SSRS)./v1/projects/:project/instances/:instance/releaseSsrsLease?location=stringRelease a lease for the setup of SQL Server Reporting Services (SSRS).
  • POSTDeletes all client certificates and generates a new server SSL certificate for the instance./v1/projects/:project/instances/:instance/resetSslConfig?location=string&mode=RESET_SSL_MODE_UNSPECIFIEDDeletes all client certificates and generates a new server SSL certificate for the instance.
  • POSTRestarts a Cloud SQL instance./v1/projects/:project/instances/:instance/restart?location=stringRestarts a Cloud SQL instance.
  • POSTRestores a backup of a Cloud SQL instance/v1/projects/:project/instances/:instance/restoreBackup?location=stringRestores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
  • POSTRotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the…/v1/projects/:project/instances/:instance/rotateServerCa?location=stringRotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have…
  • POSTStarts the replication in the read replica instance./v1/projects/:project/instances/:instance/startReplica?location=stringStarts the replication in the read replica instance.
  • POSTStops the replication in the read replica instance./v1/projects/:project/instances/:instance/stopReplica?location=stringStops the replication in the read replica instance.
  • POSTSwitches over from the primary instance to the DR replica instance./v1/projects/:project/instances/:instance/switchover?dbTimeout=string&location=stringSwitches over from the primary instance to the DR replica instance.
  • POSTTruncate MySQL general and slow query log tables MySQL only./v1/projects/:project/instances/:instance/truncateLog?location=stringTruncate MySQL general and slow query log tables MySQL only.

operations

  • POSTCancels an instance operation that has been performed on an instance./v1/projects/:project/operations/:operation/cancel?location=stringCancels an instance operation that has been performed on an instance.
  • GETRetrieves an instance operation that has been performed on an instance./v1/projects/:project/operations/:operation?location=stringRetrieves an instance operation that has been performed on an instance.
  • GETLists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological…/v1/projects/:project/operations?instance=string&location=string&maxResults=0&pageToken=stringLists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.

projects.instances

  • GETGet Disk Shrink Config for a given instance./v1/projects/:project/instances/:instance/getDiskShrinkConfig?location=stringGet Disk Shrink Config for a given instance.
  • GETGet Latest Recovery Time for a given instance./v1/projects/:project/instances/:instance/getLatestRecoveryTime?location=string&sourceInstanceDeletionTime=stringGet Latest Recovery Time for a given instance.
  • POSTPerform Disk Shrink on primary instance./v1/projects/:project/instances/:instance/performDiskShrink?location=stringPerform Disk Shrink on primary instance.
  • POSTReschedules the maintenance on the given instance./v1/projects/:project/instances/:instance/rescheduleMaintenance?location=stringReschedules the maintenance on the given instance.
  • POSTReset Replica Size to primary instance disk size./v1/projects/:project/instances/:instance/resetReplicaSizeReset Replica Size to primary instance disk size.
  • POSTStart External primary instance migration./v1/projects/:project/instances/:instance/startExternalSyncStart External primary instance migration.
  • POSTVerify External primary instance external sync settings./v1/projects/:project/instances/:instance/verifyExternalSyncSettingsVerify External primary instance external sync settings.

sslCerts

  • POSTGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to…/v1/projects/:project/instances/:instance/createEphemeral?location=stringGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the…
  • GETRetrieves a particular SSL certificate/v1/projects/:project/instances/:instance/sslCerts/:sha1FingerprintRetrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial…
  • DELETEDeletes the SSL certificate/v1/projects/:project/instances/:instance/sslCerts/:sha1FingerprintDeletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.
  • GETLists all of the current SSL certificates for the instance./v1/projects/:project/instances/:instance/sslCertsLists all of the current SSL certificates for the instance.
  • POSTCreates an SSL certificate and returns it along with the private key and server certificate authority/v1/projects/:project/instances/:instance/sslCertsCreates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the…

tiers

  • GETLists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`/v1/projects/:project/tiersLists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For more information, see https://cloud.google.com/sql/pricing.

users

  • GETLists users in the specified Cloud SQL instance./v1/projects/:project/instances/:instance/users?location=stringLists users in the specified Cloud SQL instance.
  • PUTUpdates an existing user in a Cloud SQL instance./v1/projects/:project/instances/:instance/users?databaseRoles=string&host=string&location=string&name=string&revokeExistingRoles=true&revokeExistingServerRoles=true&serverRoles=stringUpdates an existing user in a Cloud SQL instance.
  • POSTCreates a new user in a Cloud SQL instance./v1/projects/:project/instances/:instance/users?location=stringCreates a new user in a Cloud SQL instance.
  • DELETEDeletes a user from a Cloud SQL instance./v1/projects/:project/instances/:instance/users?host=string&location=string&name=stringDeletes a user from a Cloud SQL instance.
  • GETRetrieves a resource containing information about a user./v1/projects/:project/instances/:instance/users/:name?host=string&location=stringRetrieves a resource containing information about a user.

workloadCaptures

  • GETLists all captured workloads associated with the instance./v1/projects/:project/instances/:instance/workloadCapturesLists all captured workloads associated with the instance.
  • POSTStarts capturing the SQL queries, transactions, and other operations executed on the primary instance/v1/projects/:project/instances/:instance/workloadCaptures:startStarts capturing the SQL queries, transactions, and other operations executed on the primary instance. This traffic is securely stored and forms a "captured…
  • POSTStarts executing a captured workload on a separate Cloud SQL instance provisioned for workload replay/v1/projects/:project/instances/:instance/workloadCaptures/:workloadId:startReplayStarts executing a captured workload on a separate Cloud SQL instance provisioned for workload replay. This target instance simulates the production…
  • POSTStops capturing the query traffic and related operations executed on the primary instance./v1/projects/:project/instances/:instance/workloadCaptures:stopStops capturing the query traffic and related operations executed on the primary instance.
  • POSTStops an active workload replay on the target Cloud SQL replay instance./v1/projects/:project/instances/:instance/workloadCaptures:stopReplayStops an active workload replay on the target Cloud SQL replay instance.

API details

Base URL
https://sqladmin.googleapis.com
Authentication
OAuth 2.0 (authorization code flow) with 2 scopes
An API key in the key query parameter
Operations
83 operations on 64 pathsPOST 46GET 25DELETE 6PUT 3PATCH 3
Main resources
instances 35projects.instances 7databases 6blueGreenDeployments 5sslCerts 5users 5workloadCaptures 5backupRuns 4Backups 3connect 3
Response formats
application/json
Description format
Google API Discovery, API version v1

How to test the Cloud SQL Admin API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Cloud SQL Admin API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 2 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Lists all backups associated with the project.” (GET /v1/:parent/backups?filter=string&pageSize=0&pageToken=string), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Cloud SQL Admin API?

Cloud SQL Admin API It is listed under Data & analytics and has 83 endpoints.

Who publishes the Cloud SQL Admin API?

It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Cloud SQL Admin API?

Requests go to https://sqladmin.googleapis.com. Endpoint paths are added to this base URL.

How do I authenticate with the Cloud SQL Admin API?

It accepts 2 methods: OAuth 2.0 (authorization code flow) with 2 scopes; an API key in the key query parameter.

How many endpoints does the Cloud SQL Admin API have?

83 operations on 64 paths (46 POST, 25 GET, 6 DELETE, 3 PUT, 3 PATCH). The largest groups are instances, projects.instances, databases, blueGreenDeployments.

Is forking the Cloud SQL Admin API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.