Class: Google::Apis::SecretmanagerV1beta2::Secret

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

Overview

A Secret is a logical secret whose value and versions can be accessed. A Secret is made up of zero or more SecretVersions that represent the secret data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Secret

Returns a new instance of Secret.



1138
1139
1140
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1138

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

Instance Attribute Details

#annotationsHash<String,String>

Optional. Custom metadata about the secret. Annotations are distinct from various forms of labels. Annotations exist to allow client tools to store their own state information without requiring a database. Annotation keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols. The total size of annotation keys and values must be less than 16KiB. Corresponds to the JSON property annotations

Returns:

  • (Hash<String,String>)


1047
1048
1049
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1047

def annotations
  @annotations
end

#create_timeString

Output only. The time at which the Secret was created. Corresponds to the JSON property createTime

Returns:

  • (String)


1052
1053
1054
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1052

def create_time
  @create_time
end

#customer_managed_encryptionGoogle::Apis::SecretmanagerV1beta2::CustomerManagedEncryption

Configuration for encrypting secret payloads using customer-managed encryption keys (CMEK). Corresponds to the JSON property customerManagedEncryption



1058
1059
1060
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1058

def customer_managed_encryption
  @customer_managed_encryption
end

#etagString

Optional. Etag of the currently stored Secret. Corresponds to the JSON property etag

Returns:

  • (String)


1063
1064
1065
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1063

def etag
  @etag
end

#expire_timeString

Optional. Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent on input. Corresponds to the JSON property expireTime

Returns:

  • (String)


1069
1070
1071
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1069

def expire_time
  @expire_time
end

#labelsHash<String,String>

The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \pLl\pLo0,62 Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\pLl\p Lo\pN_-]0,63`No more than 64 labels can be assigned to a given resource. Corresponds to the JSON propertylabels`

Returns:

  • (Hash<String,String>)


1079
1080
1081
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1079

def labels
  @labels
end

#nameString

Output only. The resource name of the Secret in the format projects/*/secrets/ *. Corresponds to the JSON property name

Returns:

  • (String)


1085
1086
1087
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1085

def name
  @name
end

#replicationGoogle::Apis::SecretmanagerV1beta2::Replication

A policy that defines the replication and encryption configuration of data. Corresponds to the JSON property replication



1090
1091
1092
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1090

def replication
  @replication
end

#rotationGoogle::Apis::SecretmanagerV1beta2::Rotation

The rotation time and period for a Secret. At next_rotation_time, Secret Manager will send a Pub/Sub notification to the topics configured on the Secret. Secret.topics must be set to configure rotation. Corresponds to the JSON property rotation



1097
1098
1099
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1097

def rotation
  @rotation
end

#tagsHash<String,String>

Optional. Input only. Immutable. Mapping of Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" Tags are used to organize and group resources. Tags can be used to control policy evaluation for the resource. Corresponds to the JSON property tags

Returns:

  • (Hash<String,String>)


1105
1106
1107
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1105

def tags
  @tags
end

#topicsArray<Google::Apis::SecretmanagerV1beta2::Topic>

Optional. A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Corresponds to the JSON property topics



1111
1112
1113
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1111

def topics
  @topics
end

#ttlString

Input only. The TTL for the Secret. Corresponds to the JSON property ttl

Returns:

  • (String)


1116
1117
1118
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1116

def ttl
  @ttl
end

#version_aliasesHash<String,Fixnum>

Optional. Mapping from version alias to version name. A version alias is a string with a maximum length of 63 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string must start with a letter and cannot be the string ' latest' or 'NEW'. No more than 50 aliases can be assigned to a given secret. Version-Alias pairs will be viewable via GetSecret and modifiable via UpdateSecret. Access by alias is only supported for GetSecretVersion and AccessSecretVersion. Corresponds to the JSON property versionAliases

Returns:

  • (Hash<String,Fixnum>)


1128
1129
1130
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1128

def version_aliases
  @version_aliases
end

#version_destroy_ttlString

Optional. Secret Version TTL after destruction request This is a part of the Delayed secret version destroy feature. For secret with TTL>0, version destruction doesn't happen immediately on calling destroy instead the version goes to a disabled state and destruction happens after the TTL expires. Corresponds to the JSON property versionDestroyTtl

Returns:

  • (String)


1136
1137
1138
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1136

def version_destroy_ttl
  @version_destroy_ttl
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
# File 'lib/google/apis/secretmanager_v1beta2/classes.rb', line 1143

def update!(**args)
  @annotations = args[:annotations] if args.key?(:annotations)
  @create_time = args[:create_time] if args.key?(:create_time)
  @customer_managed_encryption = args[:customer_managed_encryption] if args.key?(:customer_managed_encryption)
  @etag = args[:etag] if args.key?(:etag)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @labels = args[:labels] if args.key?(:labels)
  @name = args[:name] if args.key?(:name)
  @replication = args[:replication] if args.key?(:replication)
  @rotation = args[:rotation] if args.key?(:rotation)
  @tags = args[:tags] if args.key?(:tags)
  @topics = args[:topics] if args.key?(:topics)
  @ttl = args[:ttl] if args.key?(:ttl)
  @version_aliases = args[:version_aliases] if args.key?(:version_aliases)
  @version_destroy_ttl = args[:version_destroy_ttl] if args.key?(:version_destroy_ttl)
end