Class: Google::Apis::SpannerV1::Database

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

A Cloud Spanner database.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Database

Returns a new instance of Database.



2121
2122
2123
# File 'lib/google/apis/spanner_v1/classes.rb', line 2121

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#create_timeString

Output only. If exists, the time at which the database creation started. Corresponds to the JSON property createTime

Returns:

  • (String)


2035
2036
2037
# File 'lib/google/apis/spanner_v1/classes.rb', line 2035

def create_time
  @create_time
end

#database_dialectString

Output only. The dialect of the Cloud Spanner Database. Corresponds to the JSON property databaseDialect

Returns:

  • (String)


2040
2041
2042
# File 'lib/google/apis/spanner_v1/classes.rb', line 2040

def database_dialect
  @database_dialect
end

#default_leaderString

Output only. The read-write region which contains the database'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. Corresponds to the JSON property defaultLeader

Returns:

  • (String)


2048
2049
2050
# File 'lib/google/apis/spanner_v1/classes.rb', line 2048

def default_leader
  @default_leader
end

#earliest_version_timeString

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. Corresponds to the JSON property earliestVersionTime

Returns:

  • (String)


2057
2058
2059
# File 'lib/google/apis/spanner_v1/classes.rb', line 2057

def earliest_version_time
  @earliest_version_time
end

#enable_drop_protectionBoolean Also known as: enable_drop_protection?

Optional. Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion. Corresponds to the JSON property enableDropProtection

Returns:

  • (Boolean)


2065
2066
2067
# File 'lib/google/apis/spanner_v1/classes.rb', line 2065

def enable_drop_protection
  @enable_drop_protection
end

#encryption_configGoogle::Apis::SpannerV1::EncryptionConfig

Encryption configuration for a Cloud Spanner database. Corresponds to the JSON property encryptionConfig



2071
2072
2073
# File 'lib/google/apis/spanner_v1/classes.rb', line 2071

def encryption_config
  @encryption_config
end

#encryption_infoArray<Google::Apis::SpannerV1::EncryptionInfo>

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 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. Corresponds to the JSON property encryptionInfo



2082
2083
2084
# File 'lib/google/apis/spanner_v1/classes.rb', line 2082

def encryption_info
  @encryption_info
end

#nameString

Required. The name of the database. Values are of the form projects// instances//databases/, where `is as specified in theCREATE DATABASE statement. This name can be passed to other API methods to identify the database. Corresponds to the JSON propertyname`

Returns:

  • (String)


2090
2091
2092
# File 'lib/google/apis/spanner_v1/classes.rb', line 2090

def name
  @name
end

#quorum_infoGoogle::Apis::SpannerV1::QuorumInfo

Information about the dual-region quorum. Corresponds to the JSON property quorumInfo



2095
2096
2097
# File 'lib/google/apis/spanner_v1/classes.rb', line 2095

def quorum_info
  @quorum_info
end

#reconcilingBoolean Also known as: reconciling?

Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database. Corresponds to the JSON property reconciling

Returns:

  • (Boolean)


2101
2102
2103
# File 'lib/google/apis/spanner_v1/classes.rb', line 2101

def reconciling
  @reconciling
end

#restore_infoGoogle::Apis::SpannerV1::RestoreInfo

Information about the database restore. Corresponds to the JSON property restoreInfo



2107
2108
2109
# File 'lib/google/apis/spanner_v1/classes.rb', line 2107

def restore_info
  @restore_info
end

#stateString

Output only. The current database state. Corresponds to the JSON property state

Returns:

  • (String)


2112
2113
2114
# File 'lib/google/apis/spanner_v1/classes.rb', line 2112

def state
  @state
end

#version_retention_periodString

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. Corresponds to the JSON property versionRetentionPeriod

Returns:

  • (String)


2119
2120
2121
# File 'lib/google/apis/spanner_v1/classes.rb', line 2119

def version_retention_period
  @version_retention_period
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
# File 'lib/google/apis/spanner_v1/classes.rb', line 2126

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @database_dialect = args[:database_dialect] if args.key?(:database_dialect)
  @default_leader = args[:default_leader] if args.key?(:default_leader)
  @earliest_version_time = args[:earliest_version_time] if args.key?(:earliest_version_time)
  @enable_drop_protection = args[:enable_drop_protection] if args.key?(:enable_drop_protection)
  @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
  @encryption_info = args[:encryption_info] if args.key?(:encryption_info)
  @name = args[:name] if args.key?(:name)
  @quorum_info = args[:quorum_info] if args.key?(:quorum_info)
  @reconciling = args[:reconciling] if args.key?(:reconciling)
  @restore_info = args[:restore_info] if args.key?(:restore_info)
  @state = args[:state] if args.key?(:state)
  @version_retention_period = args[:version_retention_period] if args.key?(:version_retention_period)
end