public interface SecretManagerOperations
| Modifier and Type | Method and Description |
|---|---|
void |
createSecret(String secretId,
byte[] payload)
Creates a new secret or a new version of existing secret with the provided
payload. |
void |
createSecret(String secretId,
String payload)
Creates a new secret or a new version of existing secret with the provided
payload. |
byte[] |
getSecretBytes(String secretId)
Gets the secret payload of the specified
secretId at the latest version. |
byte[] |
getSecretBytes(String secretId,
String versionName)
Gets the secret payload of the specified
secretId at version
versionName. |
com.google.protobuf.ByteString |
getSecretByteString(String secretId,
String versionName)
Gets the secret payload of the specified
secretId at version
versionName. |
String |
getSecretString(String secretId)
Gets the secret payload of the specified
secretId at the latest version. |
String |
getSecretString(String secretId,
String versionName)
Gets the secret payload of the specified
secretId at version
versionName. |
boolean |
secretExists(String secretId)
Returns true if there already exists a secret under the GCP project with the
secretId. |
void createSecret(String secretId, String payload)
payload.
If there is already a secret saved in SecretManager with the specified
secretId, then it simply creates a new version under the secret with the secret
payload.
secretId - the secret ID of the secret to create.payload - the secret payload string.void createSecret(String secretId, byte[] payload)
payload.
If there is already a secret saved in SecretManager with the specified
secretId, then it simply creates a new version under the secret with the secret
payload.
secretId - the secret ID of the secret to create.payload - the secret payload as a byte array.String getSecretString(String secretId)
secretId at the latest version.secretId - unique identifier of your secret in Secret Manager.String getSecretString(String secretId, String versionName)
secretId at version
versionName.secretId - unique identifier of your secret in Secret Manager.versionName - which version of the secret to load. The version can be a version
number as a string (e.g. "5") or an alias (e.g. "latest").byte[] getSecretBytes(String secretId)
secretId at the latest version.secretId - unique identifier of your secret in Secret Manager.byte[] getSecretBytes(String secretId, String versionName)
secretId at version
versionName.secretId - unique identifier of your secret in Secret Manager.versionName - which version of the secret to load. The version can be a version
number as a string (e.g. "5") or an alias (e.g. "latest").com.google.protobuf.ByteString getSecretByteString(String secretId, String versionName)
secretId at version
versionName.secretId - unique identifier of your secret in Secret Manager.versionName - which version of the secret to load. The version can be a version
number as a string (e.g. "5") or an alias (e.g. "latest").ByteStringboolean secretExists(String secretId)
secretId.secretId - unique identifier of your secret in Secret Manager.Copyright © 2020 Pivotal Software, Inc.. All rights reserved.