class Google::Cloud::Spanner::Database::BackupInfo

Public Class Methods

from_grpc(grpc) click to toggle source

@private Creates a new Database::BackupInfo instance from a `Google::Cloud::Spanner::Admin::Database::V1::BackupInfo`.

# File lib/google/cloud/spanner/database/backup_info.rb, line 107
def self.from_grpc grpc
  new grpc
end
new(grpc) click to toggle source

@private Creates a new Database::BackupInfo instance.

# File lib/google/cloud/spanner/database/backup_info.rb, line 23
def initialize grpc
  @grpc = grpc
end

Public Instance Methods

backup_id() click to toggle source

The unique identifier for the backup. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 44
def backup_id
  @grpc.backup.split("/")[5]
end
create_time() click to toggle source

The timestamp indicating the creation of the backup. @return [Time]

# File lib/google/cloud/spanner/database/backup_info.rb, line 89
def create_time
  Convert.timestamp_to_time @grpc.create_time
end
instance_id() click to toggle source

The unique identifier for the instance. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 37
def instance_id
  @grpc.backup.split("/")[3]
end
path() click to toggle source

The full path for the backup. Values are of the form `projects/<project>/instances/<instance>/backups/<backup_id>`. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 52
def path
  @grpc.backup
end
project_id() click to toggle source

The unique identifier for the project. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 30
def project_id
  @grpc.backup.split("/")[1]
end
source_database_id() click to toggle source

Name of the database the backup was created from. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 59
def source_database_id
  @grpc.source_database.split("/")[5]
end
source_database_instance_id() click to toggle source

The unique identifier for the source database instance. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 73
def source_database_instance_id
  @grpc.backup.split("/")[3]
end
source_database_path() click to toggle source

The full path for the source database the backup was created from. Values are of the form `projects/<project>/instances/<instance>/database/<database_id>`. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 82
def source_database_path
  @grpc.source_database
end
source_database_project_id() click to toggle source

The unique identifier for the source database project. @return [String]

# File lib/google/cloud/spanner/database/backup_info.rb, line 66
def source_database_project_id
  @grpc.backup.split("/")[1]
end
version_time() click to toggle source

The backup contains an externally consistent copy of `source_database` at the timestamp specified by the `version_time` received. If no `version_time` was given during the creation of the backup, the `version_time` will be the same as the `create_time`. @return [Time]

# File lib/google/cloud/spanner/database/backup_info.rb, line 100
def version_time
  Convert.timestamp_to_time @grpc.version_time
end