Secret Manager Service.
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
SecretManagerServiceClient
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient const &
|
SecretManagerServiceClient
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient &&
|
SecretManagerServiceClient
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< SecretManagerServiceConnection >
|
opts |
Options
|
~SecretManagerServiceClient
Operators
operator=
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient const &
|
Returns | |
---|---|
Type | Description |
SecretManagerServiceClient & |
operator=
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient &&
|
Returns | |
---|---|
Type | Description |
SecretManagerServiceClient & |
Functions
ListSecrets
Lists Secrets.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the project associated with the Secrets, in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
ListSecrets
Lists Secrets.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::ListSecretsRequest
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
CreateSecret
Creates a new Secret containing no SecretVersions.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the project to associate with the Secret, in the format |
secret_id |
std::string const &
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 ( |
secret |
google::cloud::secretmanager::v1::Secret const &
Required. A Secret with initial field values. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
CreateSecret
Creates a new Secret containing no SecretVersions.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::CreateSecretRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
AddSecretVersion
Creates a new SecretVersion containing secret data and attaches it to an existing Secret.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the Secret to associate with the SecretVersion in the format |
payload |
google::cloud::secretmanager::v1::SecretPayload const &
Required. The secret payload of the SecretVersion. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
AddSecretVersion
Creates a new SecretVersion containing secret data and attaches it to an existing Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::AddSecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
GetSecret
Gets metadata for a given Secret.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the Secret, in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
GetSecret
Gets metadata for a given Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::GetSecretRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
UpdateSecret
Updates metadata of an existing Secret.
Parameters | |
---|---|
Name | Description |
secret |
google::cloud::secretmanager::v1::Secret const &
Required. Secret with updated field values. |
update_mask |
google::protobuf::FieldMask const &
Required. Specifies the fields to be updated. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
UpdateSecret
Updates metadata of an existing Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::UpdateSecretRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > |
[`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40) |
DeleteSecret
Deletes a Secret.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the Secret to delete in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
DeleteSecret
Deletes a Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DeleteSecretRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
ListSecretVersions
Lists SecretVersions.
This call does not return secret data.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] associated with the SecretVersions to list, in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
ListSecretVersions
Lists SecretVersions.
This call does not return secret data.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::ListSecretVersionsRequest
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
GetSecretVersion
Gets metadata for a SecretVersion.
projects/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the SecretVersion in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
GetSecretVersion
Gets metadata for a SecretVersion.
projects/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::GetSecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
AccessSecretVersion
Accesses a SecretVersion.
This call returns the secret data.
projects/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the SecretVersion in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse > |
[`google::cloud::secretmanager::v1::AccessSecretVersionResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/service.proto#L378) |
AccessSecretVersion
Accesses a SecretVersion.
This call returns the secret data.
projects/*/secrets/*/versions/latest
is an alias to the most recently created SecretVersion.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::AccessSecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse > |
[`google::cloud::secretmanager::v1::AccessSecretVersionResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/service.proto#L378) |
DisableSecretVersion
Disables a SecretVersion.
Sets the state of the SecretVersion to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the SecretVersion to disable in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
DisableSecretVersion
Disables a SecretVersion.
Sets the state of the SecretVersion to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DisableSecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
EnableSecretVersion
Enables a SecretVersion.
Sets the state of the SecretVersion to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the SecretVersion to enable in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
EnableSecretVersion
Enables a SecretVersion.
Sets the state of the SecretVersion to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::EnableSecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
DestroySecretVersion
Destroys a SecretVersion.
Sets the state of the SecretVersion to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the SecretVersion to destroy in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
DestroySecretVersion
Destroys a SecretVersion.
Sets the state of the SecretVersion to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DestroySecretVersionRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > |
[`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144) |
SetIamPolicy
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::SetIamPolicyRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
[`google::iam::v1::Policy`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/policy.proto#L98) |
GetIamPolicy
Gets the access control policy for a secret.
Returns empty policy if the secret exists and does not have a policy set.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::GetIamPolicyRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
[`google::iam::v1::Policy`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/policy.proto#L98) |
TestIamPermissions
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::TestIamPermissionsRequest const &
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > |
[`google::iam::v1::TestIamPermissionsResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/iam_policy.proto#L151) |