class ProjectsLocationsSecrets extends Resource (View source)

The "secrets" collection of methods.

Typical usage is:

 $secretmanagerService = new Google\Service\SecretManager(...);
 $secrets = $secretmanagerService->projects_locations_secrets;

Methods

addVersion(string $parent, AddSecretVersionRequest $postBody, array $optParams = [])

Creates a new SecretVersion containing secret data and attaches it to an existing Secret. (secrets.addVersion)

create(string $parent, Secret $postBody, array $optParams = [])

Creates a new Secret containing no SecretVersions. (secrets.create)

delete(string $name, array $optParams = [])

Deletes a Secret. (secrets.delete)

get(string $name, array $optParams = [])

Gets metadata for a given Secret. (secrets.get)

getIamPolicy(string $resource, array $optParams = [])

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set. (secrets.getIamPolicy)

listProjectsLocationsSecrets(string $parent, array $optParams = [])

Lists Secrets. (secrets.listProjectsLocationsSecrets)

patch(string $name, Secret $postBody, array $optParams = [])

Updates metadata of an existing Secret. (secrets.patch)

setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

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. (secrets.setIamPolicy)

testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

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.

Details

SecretVersion addVersion(string $parent, AddSecretVersionRequest $postBody, array $optParams = [])

Creates a new SecretVersion containing secret data and attaches it to an existing Secret. (secrets.addVersion)

Parameters

string $parent

Required. The resource name of the Secret to associate with the SecretVersion in the format projects/secrets or projects/locations/secrets.

AddSecretVersionRequest $postBody
array $optParams

Optional parameters.

Return Value

SecretVersion

Exceptions

Exception

Secret create(string $parent, Secret $postBody, array $optParams = [])

Creates a new Secret containing no SecretVersions. (secrets.create)

Parameters

string $parent

Required. The resource name of the project to associate with the Secret, in the format projects or projects/locations.

Secret $postBody
array $optParams

Optional parameters.

Return Value

Secret

Exceptions

Exception

SecretmanagerEmpty delete(string $name, array $optParams = [])

Deletes a Secret. (secrets.delete)

Parameters

string $name

Required. The resource name of the Secret to delete in the format projects/secrets.

array $optParams

Optional parameters.

Return Value

SecretmanagerEmpty

Exceptions

Exception

Secret get(string $name, array $optParams = [])

Gets metadata for a given Secret. (secrets.get)

Parameters

string $name

Required. The resource name of the Secret, in the format projects/secrets or projects/locations/secrets.

array $optParams

Optional parameters.

Return Value

Secret

Exceptions

Exception

Policy getIamPolicy(string $resource, array $optParams = [])

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set. (secrets.getIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

ListSecretsResponse listProjectsLocationsSecrets(string $parent, array $optParams = [])

Lists Secrets. (secrets.listProjectsLocationsSecrets)

Parameters

string $parent

Required. The resource name of the project associated with the Secrets, in the format projects or projects/locations

array $optParams

Optional parameters.

Return Value

ListSecretsResponse

Exceptions

Exception

Secret patch(string $name, Secret $postBody, array $optParams = [])

Updates metadata of an existing Secret. (secrets.patch)

Parameters

string $name

Output only. The resource name of the Secret in the format projects/secrets.

Secret $postBody
array $optParams

Optional parameters.

Return Value

Secret

Exceptions

Exception

Policy setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

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. (secrets.setIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

SetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

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. (secrets.testIamPermissions)

Parameters

string $resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

TestIamPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception