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(SecretManagerServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient const &
|
SecretManagerServiceClient(SecretManagerServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient &&
|
SecretManagerServiceClient(std::shared_ptr< SecretManagerServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< SecretManagerServiceConnection >
|
opts |
Options
|
Operators
operator=(SecretManagerServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient const &
|
Returns | |
---|---|
Type | Description |
SecretManagerServiceClient & |
operator=(SecretManagerServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
SecretManagerServiceClient &&
|
Returns | |
---|---|
Type | Description |
SecretManagerServiceClient & |
Functions
ListSecrets(std::string const &, Options)
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 > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListSecrets(google::cloud::secretmanager::v1::ListSecretsRequest, Options)
Lists Secrets.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::ListSecretsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::Secret > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
CreateSecret(std::string const &, std::string const &, google::cloud::secretmanager::v1::Secret const &, Options)
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. |
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateSecret(google::cloud::secretmanager::v1::CreateSecretRequest const &, Options)
Creates a new Secret containing no SecretVersions.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::CreateSecretRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
AddSecretVersion(std::string const &, google::cloud::secretmanager::v1::SecretPayload const &, Options)
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
AddSecretVersion(google::cloud::secretmanager::v1::AddSecretVersionRequest const &, Options)
Creates a new SecretVersion containing secret data and attaches it to an existing Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::AddSecretVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSecret(std::string const &, Options)
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSecret(google::cloud::secretmanager::v1::GetSecretRequest const &, Options)
Gets metadata for a given Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::GetSecretRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSecret(google::cloud::secretmanager::v1::Secret const &, google::protobuf::FieldMask const &, Options)
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSecret(google::cloud::secretmanager::v1::UpdateSecretRequest const &, Options)
Updates metadata of an existing Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::UpdateSecretRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::Secret > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.Secret) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSecret(std::string const &, Options)
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 | a |
DeleteSecret(google::cloud::secretmanager::v1::DeleteSecretRequest const &, Options)
Deletes a Secret.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DeleteSecretRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
ListSecretVersions(std::string const &, Options)
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 > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListSecretVersions(google::cloud::secretmanager::v1::ListSecretVersionsRequest, Options)
Lists SecretVersions.
This call does not return secret data.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::ListSecretVersionsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::secretmanager::v1::SecretVersion > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetSecretVersion(std::string const &, Options)
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSecretVersion(google::cloud::secretmanager::v1::GetSecretVersionRequest const &, Options)
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 &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
AccessSecretVersion(std::string const &, Options)
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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.AccessSecretVersionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
AccessSecretVersion(google::cloud::secretmanager::v1::AccessSecretVersionRequest const &, Options)
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 &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.AccessSecretVersionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DisableSecretVersion(std::string const &, Options)
Disables a SecretVersion.
Sets the state of the SecretVersion to 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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DisableSecretVersion(google::cloud::secretmanager::v1::DisableSecretVersionRequest const &, Options)
Disables a SecretVersion.
Sets the state of the SecretVersion to DISABLED.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DisableSecretVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
EnableSecretVersion(std::string const &, Options)
Enables a SecretVersion.
Sets the state of the SecretVersion to 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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
EnableSecretVersion(google::cloud::secretmanager::v1::EnableSecretVersionRequest const &, Options)
Enables a SecretVersion.
Sets the state of the SecretVersion to ENABLED.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::EnableSecretVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DestroySecretVersion(std::string const &, Options)
Destroys a SecretVersion.
Sets the state of the SecretVersion to 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 > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DestroySecretVersion(google::cloud::secretmanager::v1::DestroySecretVersionRequest const &, Options)
Destroys a SecretVersion.
Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::secretmanager::v1::DestroySecretVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::secretmanager::v1::SecretVersion > | the result of the RPC. The response message type (google.cloud.secretmanager.v1.SecretVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)
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 &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > | the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)
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 &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > | the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)
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 &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > | the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |