• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="sqladmin_v1beta4.html">Cloud SQL Admin API</a> . <a href="sqladmin_v1beta4.sslCerts.html">sslCerts</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#createEphemeral">createEphemeral(project, instance, body)</a></code></p>
79<p class="firstline">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.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(project, instance, sha1Fingerprint)</a></code></p>
82<p class="firstline">Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.</p>
83<p class="toc_element">
84  <code><a href="#get">get(project, instance, sha1Fingerprint)</a></code></p>
85<p class="firstline">Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.</p>
86<p class="toc_element">
87  <code><a href="#insert">insert(project, instance, body)</a></code></p>
88<p class="firstline">Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.</p>
89<p class="toc_element">
90  <code><a href="#list">list(project, instance)</a></code></p>
91<p class="firstline">Lists all of the current SSL certificates for the instance.</p>
92<h3>Method Details</h3>
93<div class="method">
94    <code class="details" id="createEphemeral">createEphemeral(project, instance, body)</code>
95  <pre>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.
96
97Args:
98  project: string, Project ID of the Cloud SQL project. (required)
99  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
100  body: object, The request body. (required)
101    The object takes the form of:
102
103{ # SslCerts create ephemeral certificate request.
104    "public_key": "A String", # PEM encoded public key to include in the signed certificate.
105  }
106
107
108Returns:
109  An object of the form:
110
111    { # SslCerts Resource
112    "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
113    "kind": "sql#sslCert", # This is always sql#sslCert.
114    "sha1Fingerprint": "A String", # Sha1 Fingerprint.
115    "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
116    "instance": "A String", # Name of the database instance.
117    "cert": "A String", # PEM representation.
118    "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
119    "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
120    "selfLink": "A String", # The URI of this resource.
121  }</pre>
122</div>
123
124<div class="method">
125    <code class="details" id="delete">delete(project, instance, sha1Fingerprint)</code>
126  <pre>Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.
127
128Args:
129  project: string, Project ID of the project that contains the instance. (required)
130  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
131  sha1Fingerprint: string, Sha1 FingerPrint. (required)
132
133Returns:
134  An object of the form:
135
136    { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
137    "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
138    "importContext": { # Database instance import context. # The context for import operation, if applicable.
139      "kind": "sql#importContext", # This is always sql#importContext.
140      "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
141      "fileType": "A String", # The file type for the specified uri.
142          # SQL: The file contains SQL statements.
143          # CSV: The file contains CSV data.
144      "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
145      "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
146      "csvImportOptions": { # Options for importing data as CSV.
147        "table": "A String", # The table to which CSV data is imported.
148        "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
149          "A String",
150        ],
151      },
152    },
153    "kind": "sql#operation", # This is always sql#operation.
154    "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
155    "exportContext": { # Database instance export context. # The context for export operation, if applicable.
156      "kind": "sql#exportContext", # This is always sql#exportContext.
157      "fileType": "A String", # The file type for the specified uri.
158          # SQL: The file contains SQL statements.
159          # CSV: The file contains CSV data.
160      "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
161      "csvExportOptions": { # Options for exporting data as CSV.
162        "selectQuery": "A String", # The select query used to extract the data.
163      },
164      "databases": [ # Databases to be exported.
165          # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
166          # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
167        "A String",
168      ],
169      "sqlExportOptions": { # Options for exporting data as SQL statements.
170        "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
171          "A String",
172        ],
173        "mysqlExportOptions": { # Options for exporting from MySQL.
174          "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
175        },
176        "schemaOnly": True or False, # Export only schemas.
177      },
178    },
179    "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
180    "targetProject": "A String", # The project ID of the target instance related to this operation.
181    "targetId": "A String", # Name of the database instance related to this operation.
182    "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
183    "targetLink": "A String",
184    "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
185    "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
186      "kind": "sql#operationErrors", # This is always sql#operationErrors.
187      "errors": [ # The list of errors encountered while processing this operation.
188        { # Database instance operation error.
189          "kind": "sql#operationError", # This is always sql#operationError.
190          "code": "A String", # Identifies the specific error that occurred.
191          "message": "A String", # Additional information about the error encountered.
192        },
193      ],
194    },
195    "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
196    "selfLink": "A String", # The URI of this resource.
197    "user": "A String", # The email address of the user who initiated this operation.
198  }</pre>
199</div>
200
201<div class="method">
202    <code class="details" id="get">get(project, instance, sha1Fingerprint)</code>
203  <pre>Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.
204
205Args:
206  project: string, Project ID of the project that contains the instance. (required)
207  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
208  sha1Fingerprint: string, Sha1 FingerPrint. (required)
209
210Returns:
211  An object of the form:
212
213    { # SslCerts Resource
214    "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
215    "kind": "sql#sslCert", # This is always sql#sslCert.
216    "sha1Fingerprint": "A String", # Sha1 Fingerprint.
217    "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
218    "instance": "A String", # Name of the database instance.
219    "cert": "A String", # PEM representation.
220    "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
221    "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
222    "selfLink": "A String", # The URI of this resource.
223  }</pre>
224</div>
225
226<div class="method">
227    <code class="details" id="insert">insert(project, instance, body)</code>
228  <pre>Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.
229
230Args:
231  project: string, Project ID of the project that contains the instance. (required)
232  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
233  body: object, The request body. (required)
234    The object takes the form of:
235
236{ # SslCerts insert request.
237    "commonName": "A String", # User supplied name. Must be a distinct name from the other certificates for this instance.
238  }
239
240
241Returns:
242  An object of the form:
243
244    { # SslCert insert response.
245    "kind": "sql#sslCertsInsert", # This is always sql#sslCertsInsert.
246    "clientCert": { # SslCertDetail. # The new client certificate and private key. For First Generation instances, the new certificate does not take effect until the instance is restarted.
247      "certPrivateKey": "A String", # The private key for the client cert, in pem format. Keep private in order to protect your security.
248      "certInfo": { # SslCerts Resource # The public information about the cert.
249        "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
250        "kind": "sql#sslCert", # This is always sql#sslCert.
251        "sha1Fingerprint": "A String", # Sha1 Fingerprint.
252        "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
253        "instance": "A String", # Name of the database instance.
254        "cert": "A String", # PEM representation.
255        "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
256        "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
257        "selfLink": "A String", # The URI of this resource.
258      },
259    },
260    "operation": { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. # The operation to track the ssl certs insert request.
261      "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
262      "importContext": { # Database instance import context. # The context for import operation, if applicable.
263        "kind": "sql#importContext", # This is always sql#importContext.
264        "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
265        "fileType": "A String", # The file type for the specified uri.
266            # SQL: The file contains SQL statements.
267            # CSV: The file contains CSV data.
268        "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
269        "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
270        "csvImportOptions": { # Options for importing data as CSV.
271          "table": "A String", # The table to which CSV data is imported.
272          "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
273            "A String",
274          ],
275        },
276      },
277      "kind": "sql#operation", # This is always sql#operation.
278      "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
279      "exportContext": { # Database instance export context. # The context for export operation, if applicable.
280        "kind": "sql#exportContext", # This is always sql#exportContext.
281        "fileType": "A String", # The file type for the specified uri.
282            # SQL: The file contains SQL statements.
283            # CSV: The file contains CSV data.
284        "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
285        "csvExportOptions": { # Options for exporting data as CSV.
286          "selectQuery": "A String", # The select query used to extract the data.
287        },
288        "databases": [ # Databases to be exported.
289            # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
290            # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
291          "A String",
292        ],
293        "sqlExportOptions": { # Options for exporting data as SQL statements.
294          "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
295            "A String",
296          ],
297          "mysqlExportOptions": { # Options for exporting from MySQL.
298            "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
299          },
300          "schemaOnly": True or False, # Export only schemas.
301        },
302      },
303      "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
304      "targetProject": "A String", # The project ID of the target instance related to this operation.
305      "targetId": "A String", # Name of the database instance related to this operation.
306      "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
307      "targetLink": "A String",
308      "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
309      "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
310        "kind": "sql#operationErrors", # This is always sql#operationErrors.
311        "errors": [ # The list of errors encountered while processing this operation.
312          { # Database instance operation error.
313            "kind": "sql#operationError", # This is always sql#operationError.
314            "code": "A String", # Identifies the specific error that occurred.
315            "message": "A String", # Additional information about the error encountered.
316          },
317        ],
318      },
319      "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
320      "selfLink": "A String", # The URI of this resource.
321      "user": "A String", # The email address of the user who initiated this operation.
322    },
323    "serverCaCert": { # SslCerts Resource # The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource.
324      "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
325      "kind": "sql#sslCert", # This is always sql#sslCert.
326      "sha1Fingerprint": "A String", # Sha1 Fingerprint.
327      "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
328      "instance": "A String", # Name of the database instance.
329      "cert": "A String", # PEM representation.
330      "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
331      "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
332      "selfLink": "A String", # The URI of this resource.
333    },
334  }</pre>
335</div>
336
337<div class="method">
338    <code class="details" id="list">list(project, instance)</code>
339  <pre>Lists all of the current SSL certificates for the instance.
340
341Args:
342  project: string, Project ID of the project that contains the instance. (required)
343  instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
344
345Returns:
346  An object of the form:
347
348    { # SslCerts list response.
349    "items": [ # List of client certificates for the instance.
350      { # SslCerts Resource
351        "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
352        "kind": "sql#sslCert", # This is always sql#sslCert.
353        "sha1Fingerprint": "A String", # Sha1 Fingerprint.
354        "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
355        "instance": "A String", # Name of the database instance.
356        "cert": "A String", # PEM representation.
357        "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
358        "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
359        "selfLink": "A String", # The URI of this resource.
360      },
361    ],
362    "kind": "sql#sslCertsList", # This is always sql#sslCertsList.
363  }</pre>
364</div>
365
366</body></html>