class ProjectsServiceAccountsKeys extends Resource (View source)

The "keys" collection of methods.

Typical usage is:

 $iamService = new Google\Service\Iam(...);
 $keys = $iamService->projects_serviceAccounts_keys;

Methods

create(string $name, CreateServiceAccountKeyRequest $postBody, array $optParams = [])

Creates a ServiceAccountKey. (keys.create)

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

Deletes a ServiceAccountKey. Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key. (keys.delete)

disable(string $name, DisableServiceAccountKeyRequest $postBody, array $optParams = [])

Disable a ServiceAccountKey. A disabled service account key can be re-enabled with EnableServiceAccountKey. (keys.disable)

enable(string $name, EnableServiceAccountKeyRequest $postBody, array $optParams = [])

Enable a ServiceAccountKey. (keys.enable)

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

Gets a ServiceAccountKey. (keys.get)

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

Lists every ServiceAccountKey for a service account.

upload(string $name, UploadServiceAccountKeyRequest $postBody, array $optParams = [])

Uploads the public key portion of a key pair that you manage, and associates the public key with a ServiceAccount. After you upload the public key, you can use the private key from the key pair as a service account key.

Details

ServiceAccountKey create(string $name, CreateServiceAccountKeyRequest $postBody, array $optParams = [])

Creates a ServiceAccountKey. (keys.create)

Parameters

string $name

Required. The resource name of the service account. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS} projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

CreateServiceAccountKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

ServiceAccountKey

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

Deletes a ServiceAccountKey. Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key. (keys.delete)

Parameters

string $name

Required. The resource name of the service account key. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

array $optParams

Optional parameters.

Return Value

IamEmpty

IamEmpty disable(string $name, DisableServiceAccountKeyRequest $postBody, array $optParams = [])

Disable a ServiceAccountKey. A disabled service account key can be re-enabled with EnableServiceAccountKey. (keys.disable)

Parameters

string $name

Required. The resource name of the service account key. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

DisableServiceAccountKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

IamEmpty

IamEmpty enable(string $name, EnableServiceAccountKeyRequest $postBody, array $optParams = [])

Enable a ServiceAccountKey. (keys.enable)

Parameters

string $name

Required. The resource name of the service account key. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

EnableServiceAccountKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

IamEmpty

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

Gets a ServiceAccountKey. (keys.get)

Parameters

string $name

Required. The resource name of the service account key. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS}/keys/{KEY_ID} projects/-/serviceAccounts/{UNIQUE_ID}/keys/{KEY_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account key projects/-/serviceAccounts/fake@example.com/keys/fake-key, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

array $optParams

Optional parameters.

Return Value

ServiceAccountKey

ListServiceAccountKeysResponse listProjectsServiceAccountsKeys(string $name, array $optParams = [])

Lists every ServiceAccountKey for a service account.

(keys.listProjectsServiceAccountsKeys)

Parameters

string $name

Required. The resource name of the service account. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS} projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

array $optParams

Optional parameters.

Return Value

ListServiceAccountKeysResponse

ServiceAccountKey upload(string $name, UploadServiceAccountKeyRequest $postBody, array $optParams = [])

Uploads the public key portion of a key pair that you manage, and associates the public key with a ServiceAccount. After you upload the public key, you can use the private key from the key pair as a service account key.

(keys.upload)

Parameters

string $name

The resource name of the service account key. Use one of the following formats: projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS} projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID} As an alternative, you can use the - wildcard character instead of the project ID: projects/-/serviceAccounts/{EMAIL_ADDRESS} projects/-/serviceAccounts/{UNIQUE_ID} When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not Found error.

UploadServiceAccountKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

ServiceAccountKey