Documentation
¶
Overview ¶
Package cloudsql implements the GCP Cloud SQL Admin REST API as a server.Handler. Real google.golang.org/api/sqladmin/v1 clients configured with a custom endpoint hit this handler the same way they hit sqladmin.googleapis.com.
MVP coverage:
POST /v1/projects/{p}/instances — Insert
GET /v1/projects/{p}/instances — List
GET /v1/projects/{p}/instances/{i} — Get
PATCH /v1/projects/{p}/instances/{i} — Patch
PUT /v1/projects/{p}/instances/{i} — Update
DELETE /v1/projects/{p}/instances/{i} — Delete
POST /v1/projects/{p}/instances/{i}/restart — Restart
POST /v1/projects/{p}/instances/{i}/restoreBackup — Restore from backup
POST /v1/projects/{p}/instances/{i}/backupRuns — Create backup run
GET /v1/projects/{p}/instances/{i}/backupRuns — List backup runs
GET /v1/projects/{p}/instances/{i}/backupRuns/{id} — Get backup run
DELETE /v1/projects/{p}/instances/{i}/backupRuns/{id} — Delete backup run
GET /v1/projects/{p}/operations/{op} — Poll operation (always DONE)
All mutating endpoints return Operation envelopes with status=DONE so SDK pollers terminate on the first response. Start/Stop are emulated via Patch with settings.activationPolicy=ALWAYS|NEVER, matching real Cloud SQL.
The /v1/projects/ prefix is shared with Cloud Functions, Pub/Sub, and Firestore. Matches narrows by the third path segment so dispatch stays unambiguous: it only claims "instances" or "operations" — anything else (locations, topics, subscriptions, databases) falls through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves Cloud SQL Admin REST requests against a relationaldb driver.
func New ¶
func New(db rdsdriver.RelationalDB) *Handler
New returns a Cloud SQL handler backed by db.