Skip to content

Commit b348ebe

Browse files
feat(spanner): update the api
#### spanner:v1 The following keys were added: - resources.projects.resources.instances.resources.databases.methods.patch (Total Keys: 15) - schemas.Database.properties.enableDropProtection.type (Total Keys: 1) - schemas.Database.properties.reconciling (Total Keys: 2) - schemas.UpdateDatabaseMetadata (Total Keys: 6) - schemas.UpdateDatabaseRequest (Total Keys: 5)
1 parent b4d9749 commit b348ebe

File tree

2 files changed

+166
-1
lines changed

2 files changed

+166
-1
lines changed

docs/dyn/spanner_v1.projects.instances.databases.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ <h2>Instance Methods</h2>
116116
<p class="toc_element">
117117
<code><a href="#list_next">list_next()</a></code></p>
118118
<p class="firstline">Retrieves the next page of results.</p>
119+
<p class="toc_element">
120+
<code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
121+
<p class="firstline">Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns `NOT_FOUND`. While the operation is pending: * The database's reconciling field is set to true. * Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set, the updates are reverted, and the operation terminates with a `CANCELLED` status. * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation is done (returns successfully or with error). * Reading the database via the API continues to give the pre-request values. Upon completion of the returned operation: * The new values are in effect and readable via the API. * The database's reconciling field becomes false. The returned long-running operation will have a name of the format `projects//instances//databases//operations/` and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful.</p>
119122
<p class="toc_element">
120123
<code><a href="#restore">restore(parent, body=None, x__xgafv=None)</a></code></p>
121124
<p class="firstline">Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.</p>
@@ -221,6 +224,7 @@ <h3>Method Details</h3>
221224
&quot;databaseDialect&quot;: &quot;A String&quot;, # Output only. The dialect of the Cloud Spanner Database.
222225
&quot;defaultLeader&quot;: &quot;A String&quot;, # Output only. The read-write region which contains the database&#x27;s leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
223226
&quot;earliestVersionTime&quot;: &quot;A String&quot;, # Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
227+
&quot;enableDropProtection&quot;: True or False, # Whether drop protection is enabled for this database. Defaults to false, if not set.
224228
&quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
225229
&quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
226230
},
@@ -240,6 +244,7 @@ <h3>Method Details</h3>
240244
},
241245
],
242246
&quot;name&quot;: &quot;A String&quot;, # Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
247+
&quot;reconciling&quot;: True or False, # Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.
243248
&quot;restoreInfo&quot;: { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information about the restore source.
244249
&quot;backupInfo&quot;: { # Information about a backup. # Information about the backup used to restore the database. The backup may no longer exist.
245250
&quot;backup&quot;: &quot;A String&quot;, # Name of the backup.
@@ -547,6 +552,7 @@ <h3>Method Details</h3>
547552
&quot;databaseDialect&quot;: &quot;A String&quot;, # Output only. The dialect of the Cloud Spanner Database.
548553
&quot;defaultLeader&quot;: &quot;A String&quot;, # Output only. The read-write region which contains the database&#x27;s leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
549554
&quot;earliestVersionTime&quot;: &quot;A String&quot;, # Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
555+
&quot;enableDropProtection&quot;: True or False, # Whether drop protection is enabled for this database. Defaults to false, if not set.
550556
&quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
551557
&quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
552558
},
@@ -566,6 +572,7 @@ <h3>Method Details</h3>
566572
},
567573
],
568574
&quot;name&quot;: &quot;A String&quot;, # Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
575+
&quot;reconciling&quot;: True or False, # Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.
569576
&quot;restoreInfo&quot;: { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information about the restore source.
570577
&quot;backupInfo&quot;: { # Information about a backup. # Information about the backup used to restore the database. The backup may no longer exist.
571578
&quot;backup&quot;: &quot;A String&quot;, # Name of the backup.
@@ -597,6 +604,84 @@ <h3>Method Details</h3>
597604
</pre>
598605
</div>
599606

607+
<div class="method">
608+
<code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
609+
<pre>Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns `NOT_FOUND`. While the operation is pending: * The database&#x27;s reconciling field is set to true. * Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata&#x27;s cancel_time is set, the updates are reverted, and the operation terminates with a `CANCELLED` status. * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation is done (returns successfully or with error). * Reading the database via the API continues to give the pre-request values. Upon completion of the returned operation: * The new values are in effect and readable via the API. * The database&#x27;s reconciling field becomes false. The returned long-running operation will have a name of the format `projects//instances//databases//operations/` and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful.
610+
611+
Args:
612+
name: string, Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database. (required)
613+
body: object, The request body.
614+
The object takes the form of:
615+
616+
{ # A Cloud Spanner database.
617+
&quot;createTime&quot;: &quot;A String&quot;, # Output only. If exists, the time at which the database creation started.
618+
&quot;databaseDialect&quot;: &quot;A String&quot;, # Output only. The dialect of the Cloud Spanner Database.
619+
&quot;defaultLeader&quot;: &quot;A String&quot;, # Output only. The read-write region which contains the database&#x27;s leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
620+
&quot;earliestVersionTime&quot;: &quot;A String&quot;, # Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
621+
&quot;enableDropProtection&quot;: True or False, # Whether drop protection is enabled for this database. Defaults to false, if not set.
622+
&quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
623+
&quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
624+
},
625+
&quot;encryptionInfo&quot;: [ # Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The `encryption_status&#x27; field inside of each `EncryptionInfo` is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
626+
{ # Encryption information for a Cloud Spanner database or backup.
627+
&quot;encryptionStatus&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Output only. If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
628+
&quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
629+
&quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
630+
{
631+
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
632+
},
633+
],
634+
&quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
635+
},
636+
&quot;encryptionType&quot;: &quot;A String&quot;, # Output only. The type of encryption.
637+
&quot;kmsKeyVersion&quot;: &quot;A String&quot;, # Output only. A Cloud KMS key version that is being used to protect the database or backup.
638+
},
639+
],
640+
&quot;name&quot;: &quot;A String&quot;, # Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
641+
&quot;reconciling&quot;: True or False, # Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.
642+
&quot;restoreInfo&quot;: { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information about the restore source.
643+
&quot;backupInfo&quot;: { # Information about a backup. # Information about the backup used to restore the database. The backup may no longer exist.
644+
&quot;backup&quot;: &quot;A String&quot;, # Name of the backup.
645+
&quot;createTime&quot;: &quot;A String&quot;, # The time the CreateBackup request was received.
646+
&quot;sourceDatabase&quot;: &quot;A String&quot;, # Name of the database the backup was created from.
647+
&quot;versionTime&quot;: &quot;A String&quot;, # The backup contains an externally consistent copy of `source_database` at the timestamp specified by `version_time`. If the CreateBackup request did not specify `version_time`, the `version_time` of the backup is equivalent to the `create_time`.
648+
},
649+
&quot;sourceType&quot;: &quot;A String&quot;, # The type of the restore source.
650+
},
651+
&quot;state&quot;: &quot;A String&quot;, # Output only. The current database state.
652+
&quot;versionRetentionPeriod&quot;: &quot;A String&quot;, # Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
653+
}
654+
655+
updateMask: string, Required. The list of fields to update. Currently, only `enable_drop_protection` field can be updated.
656+
x__xgafv: string, V1 error format.
657+
Allowed values
658+
1 - v1 error format
659+
2 - v2 error format
660+
661+
Returns:
662+
An object of the form:
663+
664+
{ # This resource represents a long-running operation that is the result of a network API call.
665+
&quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
666+
&quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
667+
&quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
668+
&quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
669+
{
670+
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
671+
},
672+
],
673+
&quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
674+
},
675+
&quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
676+
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
677+
},
678+
&quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
679+
&quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
680+
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
681+
},
682+
}</pre>
683+
</div>
684+
600685
<div class="method">
601686
<code class="details" id="restore">restore(parent, body=None, x__xgafv=None)</code>
602687
<pre>Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.

0 commit comments

Comments
 (0)