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.



954
955
956
# File 'lib/google/apis/spanner_v1/classes.rb', line 954

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)


918
919
920
# File 'lib/google/apis/spanner_v1/classes.rb', line 918

def create_time
  @create_time
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)


927
928
929
# File 'lib/google/apis/spanner_v1/classes.rb', line 927

def earliest_version_time
  @earliest_version_time
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)


935
936
937
# File 'lib/google/apis/spanner_v1/classes.rb', line 935

def name
  @name
end

#restore_infoGoogle::Apis::SpannerV1::RestoreInfo

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



940
941
942
# File 'lib/google/apis/spanner_v1/classes.rb', line 940

def restore_info
  @restore_info
end

#stateString

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

Returns:

  • (String)


945
946
947
# File 'lib/google/apis/spanner_v1/classes.rb', line 945

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)


952
953
954
# File 'lib/google/apis/spanner_v1/classes.rb', line 952

def version_retention_period
  @version_retention_period
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



959
960
961
962
963
964
965
966
# File 'lib/google/apis/spanner_v1/classes.rb', line 959

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @earliest_version_time = args[:earliest_version_time] if args.key?(:earliest_version_time)
  @name = args[:name] if args.key?(:name)
  @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