Reference documentation and code samples for the Secret Manager V1 API class Google::Cloud::SecretManager::V1::SecretManagerService::Client.
Client for the SecretManagerService service.
Secret Manager Service
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the SecretManagerService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SecretManagerService clients ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| config.timeout = 10.0 end
#access_secret_version
def access_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse
def access_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse
Accesses a SecretVersion. This call returns the secret data.
projects//secrets//versions/latest
is an alias to the most recently
created SecretVersion.
def access_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse
access_secret_version
via a request object, either of type
AccessSecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def access_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse
access_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
SecretVersion in the format
projects/*/secrets/*/versions/*
orprojects/*/locations/*/secrets/*/versions/*
.projects/*/secrets/*/versions/latest
orprojects/*/locations/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new # Call the access_secret_version method. result = client.access_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. p result
#add_secret_version
def add_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def add_secret_version(parent: nil, payload: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
Creates a new SecretVersion containing secret data and attaches it to an existing Secret.
def add_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
add_secret_version
via a request object, either of type
AddSecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_secret_version(parent: nil, payload: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
add_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the
Secret to associate with the
SecretVersion in the format
projects/*/secrets/*
orprojects/*/locations/*/secrets/*
. - payload (::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash) — Required. The secret payload of the SecretVersion.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::SecretVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new # Call the add_secret_version method. result = client.add_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. p result
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the SecretManagerService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_secret
def create_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
def create_secret(parent: nil, secret_id: nil, secret: nil) -> ::Google::Cloud::SecretManager::V1::Secret
Creates a new Secret containing no SecretVersions.
def create_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
create_secret
via a request object, either of type
CreateSecretRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_secret(parent: nil, secret_id: nil, secret: nil) -> ::Google::Cloud::SecretManager::V1::Secret
create_secret
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the project to associate with the
Secret, in the format
projects/*
orprojects/*/locations/*
. -
secret_id (::String) — Required. This must be unique within the project.
A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (
-
) and underscore (_
) characters. - secret (::Google::Cloud::SecretManager::V1::Secret, ::Hash) — Required. A Secret with initial field values.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::Secret)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new # Call the create_secret method. result = client.create_secret request # The returned object is of type Google::Cloud::SecretManager::V1::Secret. p result
#delete_secret
def delete_secret(request, options = nil) -> ::Google::Protobuf::Empty
def delete_secret(name: nil, etag: nil) -> ::Google::Protobuf::Empty
Deletes a Secret.
def delete_secret(request, options = nil) -> ::Google::Protobuf::Empty
delete_secret
via a request object, either of type
DeleteSecretRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_secret(name: nil, etag: nil) -> ::Google::Protobuf::Empty
delete_secret
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new # Call the delete_secret method. result = client.delete_secret request # The returned object is of type Google::Protobuf::Empty. p result
#destroy_secret_version
def destroy_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def destroy_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
Destroys a SecretVersion.
Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.
def destroy_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
destroy_secret_version
via a request object, either of type
DestroySecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def destroy_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
destroy_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
SecretVersion to destroy in
the format
projects/*/secrets/*/versions/*
orprojects/*/locations/*/secrets/*/versions/*
. - etag (::String) — Optional. Etag of the SecretVersion. The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::SecretVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new # Call the destroy_secret_version method. result = client.destroy_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. p result
#disable_secret_version
def disable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def disable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def disable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
disable_secret_version
via a request object, either of type
DisableSecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def disable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
disable_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
SecretVersion to disable in
the format
projects/*/secrets/*/versions/*
orprojects/*/locations/*/secrets/*/versions/*
. - etag (::String) — Optional. Etag of the SecretVersion. The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::SecretVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new # Call the disable_secret_version method. result = client.disable_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. p result
#enable_secret_version
def enable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def enable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def enable_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
enable_secret_version
via a request object, either of type
EnableSecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def enable_secret_version(name: nil, etag: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
enable_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
SecretVersion to enable in
the format
projects/*/secrets/*/versions/*
orprojects/*/locations/*/secrets/*/versions/*
. - etag (::String) — Optional. Etag of the SecretVersion. The request succeeds if it matches the etag of the currently stored secret version object. If the etag is omitted, the request succeeds.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::SecretVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new # Call the enable_secret_version method. result = client.enable_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. p result
#get_iam_policy
def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy
Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.
def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
get_iam_policy
via a request object, either of type
Iam::V1::GetIamPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy
get_iam_policy
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
-
options (::Google::Iam::V1::GetPolicyOptions, ::Hash) — OPTIONAL: A
GetPolicyOptions
object for specifying options toGetIamPolicy
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Iam::V1::Policy)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V1::GetIamPolicyRequest.new # Call the get_iam_policy method. result = client.get_iam_policy request # The returned object is of type Google::Iam::V1::Policy. p result
#get_secret
def get_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
def get_secret(name: nil) -> ::Google::Cloud::SecretManager::V1::Secret
Gets metadata for a given Secret.
def get_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
get_secret
via a request object, either of type
GetSecretRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_secret(name: nil) -> ::Google::Cloud::SecretManager::V1::Secret
get_secret
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
Secret, in the format
projects/*/secrets/*
orprojects/*/locations/*/secrets/*
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::Secret)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::GetSecretRequest.new # Call the get_secret method. result = client.get_secret request # The returned object is of type Google::Cloud::SecretManager::V1::Secret. p result
#get_secret_version
def get_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
def get_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
Gets metadata for a SecretVersion.
projects//secrets//versions/latest
is an alias to the most recently
created SecretVersion.
def get_secret_version(request, options = nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
get_secret_version
via a request object, either of type
GetSecretVersionRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_secret_version(name: nil) -> ::Google::Cloud::SecretManager::V1::SecretVersion
get_secret_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the
SecretVersion in the format
projects/*/secrets/*/versions/*
orprojects/*/locations/*/secrets/*/versions/*
.projects/*/secrets/*/versions/latest
orprojects/*/locations/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::SecretVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new # Call the get_secret_version method. result = client.get_secret_version request # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new SecretManagerService client object.
- (config) — Configure the SecretManagerService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.timeout = 10.0 end
#list_secret_versions
def list_secret_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>
def list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>
Lists SecretVersions. This call does not return secret data.
def list_secret_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>
list_secret_versions
via a request object, either of type
ListSecretVersionsRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>
list_secret_versions
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the
Secret associated with the
SecretVersions to list, in
the format
projects/*/secrets/*
orprojects/*/locations/*/secrets/*
. - page_size (::Integer) — Optional. The maximum number of results to be returned in a single page. If set to 0, the server decides the number of results to return. If the number is greater than 25000, it is capped at 25000.
- page_token (::String) — Optional. Pagination token, returned earlier via ListSecretVersionsResponse.next_page_token][].
- filter (::String) — Optional. Filter string, adhering to the rules in List-operation filtering. List only secret versions matching the filter. If filter is empty, all secret versions are listed.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new # Call the list_secret_versions method. result = client.list_secret_versions request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. p item end
#list_secrets
def list_secrets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>
def list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>
Lists Secrets.
def list_secrets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>
list_secrets
via a request object, either of type
ListSecretsRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>
list_secrets
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the project associated with the
Secrets, in the format
projects/*
orprojects/*/locations/*
- page_size (::Integer) — Optional. The maximum number of results to be returned in a single page. If set to 0, the server decides the number of results to return. If the number is greater than 25000, it is capped at 25000.
- page_token (::String) — Optional. Pagination token, returned earlier via ListSecretsResponse.next_page_token.
- filter (::String) — Optional. Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new # Call the list_secrets method. result = client.list_secrets request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#set_iam_policy
def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy
Sets the access control policy on the specified secret. Replaces any existing policy.
Permissions on SecretVersions are enforced according to the policy set on the associated Secret.
def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
set_iam_policy
via a request object, either of type
Iam::V1::SetIamPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy
set_iam_policy
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
-
policy (::Google::Iam::V1::Policy, ::Hash) — REQUIRED: The complete policy to be applied to the
resource
. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. -
update_mask (::Google::Protobuf::FieldMask, ::Hash) — OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
the fields in the mask will be modified. If no mask is provided, the
following default mask is used:
paths: "bindings, etag"
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Iam::V1::Policy)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V1::SetIamPolicyRequest.new # Call the set_iam_policy method. result = client.set_iam_policy request # The returned object is of type Google::Iam::V1::Policy. p result
#test_iam_permissions
def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
test_iam_permissions
via a request object, either of type
Iam::V1::TestIamPermissionsRequest or an equivalent Hash.
- request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
test_iam_permissions
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
-
permissions (::Array<::String>) — The set of permissions to check for the
resource
. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Iam::V1::TestIamPermissionsResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V1::TestIamPermissionsRequest.new # Call the test_iam_permissions method. result = client.test_iam_permissions request # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. p result
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_secret
def update_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
def update_secret(secret: nil, update_mask: nil) -> ::Google::Cloud::SecretManager::V1::Secret
Updates metadata of an existing Secret.
def update_secret(request, options = nil) -> ::Google::Cloud::SecretManager::V1::Secret
update_secret
via a request object, either of type
UpdateSecretRequest or an equivalent Hash.
- request (::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_secret(secret: nil, update_mask: nil) -> ::Google::Cloud::SecretManager::V1::Secret
update_secret
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- secret (::Google::Cloud::SecretManager::V1::Secret, ::Hash) — Required. Secret with updated field values.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Specifies the fields to be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::SecretManager::V1::Secret)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/secret_manager/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new # Call the update_secret method. result = client.update_secret request # The returned object is of type Google::Cloud::SecretManager::V1::Secret. p result