Cloud SQL Admin API . connect

Instance Methods

close()

Close httplib2 connections.

generateEphemeralCert(project, instance, body=None, x__xgafv=None)

Generates 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 certificate to authenticate as themselves when connecting to the database.

get(project, instance, readTime=None, x__xgafv=None)

Retrieves connect settings about a Cloud SQL instance.

Method Details

close()
Close httplib2 connections.
generateEphemeralCert(project, instance, body=None, x__xgafv=None)
Generates 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 certificate to authenticate as themselves when connecting to the database.

Args:
  project: string, Project ID of the project that contains the instance. (required)
  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
  body: object, The request body.
    The object takes the form of:

{ # Ephemeral certificate creation request.
  "access_token": "A String", # Optional. Access token to include in the signed certificate.
  "public_key": "A String", # PEM encoded public key to include in the signed certificate.
  "readTime": "A String", # Optional. Optional snapshot read timestamp to trade freshness for performance.
  "validDuration": "A String", # Optional. If set, it will contain the cert valid duration.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Ephemeral certificate creation request.
  "ephemeralCert": { # SslCerts Resource # Generated cert
    "cert": "A String", # PEM representation.
    "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
    "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
    "createTime": "A String", # The time when the certificate was created in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
    "expirationTime": "A String", # The time when the certificate expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
    "instance": "A String", # Name of the database instance.
    "kind": "A String", # This is always `sql#sslCert`.
    "selfLink": "A String", # The URI of this resource.
    "sha1Fingerprint": "A String", # Sha1 Fingerprint.
  },
}
get(project, instance, readTime=None, x__xgafv=None)
Retrieves connect settings about a Cloud SQL instance.

Args:
  project: string, Project ID of the project that contains the instance. (required)
  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
  readTime: string, Optional. Optional snapshot read timestamp to trade freshness for performance.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Connect settings retrieval response.
  "backendType": "A String", # `SECOND_GEN`: Cloud SQL database instance. `EXTERNAL`: A database server that is not managed by Google. This property is read-only; use the `tier` property in the `settings` object to determine the database type.
  "customSubjectAlternativeNames": [ # Custom subject alternative names for the server certificate.
    "A String",
  ],
  "databaseVersion": "A String", # The database engine type and version. The `databaseVersion` field cannot be changed after instance creation. MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default), or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`. SQL Server instances: `SQLSERVER_2017_STANDARD` (default), `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or `SQLSERVER_2019_WEB`.
  "dnsName": "A String", # The dns name of the instance.
  "dnsNames": [ # Output only. The list of DNS names used by this instance.
    { # DNS metadata.
      "connectionType": "A String", # Output only. The connection type of the DNS name.
      "dnsScope": "A String", # Output only. The scope that the DNS name applies to.
      "name": "A String", # The DNS name.
    },
  ],
  "ipAddresses": [ # The assigned IP addresses for the instance.
    { # Database instance IP mapping
      "ipAddress": "A String", # The IP address assigned.
      "timeToRetire": "A String", # The due time for this IP to be retired in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`. This field is only available when the IP is scheduled to be retired.
      "type": "A String", # The type of this IP address. A `PRIMARY` address is a public address that can accept incoming connections. A `PRIVATE` address is a private address that can accept incoming connections. An `OUTGOING` address is the source address of connections originating from the instance, if supported.
    },
  ],
  "kind": "A String", # This is always `sql#connectSettings`.
  "mdxProtocolSupport": [ # Optional. Output only. mdx_protocol_support controls how the client uses metadata exchange when connecting to the instance. The values in the list representing parts of the MDX protocol that are supported by this instance. When the list is empty, the instance does not support MDX, so the client must not send an MDX request. The default is empty.
    "A String",
  ],
  "nodeCount": 42, # The number of read pool nodes in a read pool.
  "nodes": [ # Output only. Entries containing information about each read pool node of the read pool.
    { # Details of a single read pool node of a read pool.
      "dnsName": "A String", # Output only. The DNS name of the read pool node.
      "dnsNames": [ # Output only. The list of DNS names used by this read pool node.
        { # DNS metadata.
          "connectionType": "A String", # Output only. The connection type of the DNS name.
          "dnsScope": "A String", # Output only. The scope that the DNS name applies to.
          "name": "A String", # The DNS name.
        },
      ],
      "ipAddresses": [ # Output only. Mappings containing IP addresses that can be used to connect to the read pool node.
        { # Database instance IP mapping
          "ipAddress": "A String", # The IP address assigned.
          "timeToRetire": "A String", # The due time for this IP to be retired in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`. This field is only available when the IP is scheduled to be retired.
          "type": "A String", # The type of this IP address. A `PRIMARY` address is a public address that can accept incoming connections. A `PRIVATE` address is a private address that can accept incoming connections. An `OUTGOING` address is the source address of connections originating from the instance, if supported.
        },
      ],
      "name": "A String", # Output only. The name of the read pool node. Doesn't include the project ID.
    },
  ],
  "pscEnabled": True or False, # Whether PSC connectivity is enabled for this instance.
  "region": "A String", # The cloud region for the instance. e.g. `us-central1`, `europe-west1`. The region cannot be changed after instance creation.
  "serverCaCert": { # SslCerts Resource # SSL configuration.
    "cert": "A String", # PEM representation.
    "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
    "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
    "createTime": "A String", # The time when the certificate was created in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
    "expirationTime": "A String", # The time when the certificate expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
    "instance": "A String", # Name of the database instance.
    "kind": "A String", # This is always `sql#sslCert`.
    "selfLink": "A String", # The URI of this resource.
    "sha1Fingerprint": "A String", # Sha1 Fingerprint.
  },
  "serverCaMode": "A String", # Specify what type of CA is used for the server certificate.
}