Reference documentation and code samples for the Cloud Storage Client class HmacKey.
Represents a Service Account HMAC key.
Example:
use Google\Cloud\Storage\StorageClient;
$storage = new StorageClient();
$hmacKey = $storage->hmacKey($accessId);
Namespace
Google \ Cloud \ StorageMethods
__construct
Parameters | |
---|---|
Name | Description |
connection |
Google\Cloud\Storage\Connection\ConnectionInterface
A connection to Cloud Storage. |
projectId |
string
The current project ID. |
accessId |
string
The key identifier. |
info |
array|null
The key metadata. |
accessId
Get the HMAC Key Access ID.
Example:
$accessId = $hmacKey->accessId();
Returns | |
---|---|
Type | Description |
string |
reload
Fetch the key metadata from Cloud Storage.
Example:
$keyMetadata = $hmacKey->reload();
Parameters | |
---|---|
Name | Description |
options |
array
Configuration Options |
↳ userProject |
string
If set, this is the ID of the project which will be billed for the request. NOTE: This option is currently ignored by Cloud Storage. |
Returns | |
---|---|
Type | Description |
array |
info
Get the HMAC Key Metadata.
If the metadata is not already available, it will be requested from Cloud Storage.
Example:
$keyMetadata = $hmacKey->info();
Parameters | |
---|---|
Name | Description |
options |
array
Configuration Options |
↳ userProject |
string
If set, this is the ID of the project which will be billed for the request. NOTE: This option is currently ignored by Cloud Storage. |
Returns | |
---|---|
Type | Description |
array |
update
Update the HMAC Key state.
Example:
$hmacKey->update('INACTIVE');
Parameters | |
---|---|
Name | Description |
state |
string
The key state. Either |
options |
array
Configuration Options |
↳ userProject |
string
If set, this is the ID of the project which will be billed for the request. NOTE: This option is currently ignored by Cloud Storage. |
Returns | |
---|---|
Type | Description |
array |
delete
Delete the HMAC Key.
Key state must be set to INACTIVE
prior to deletion. See
Google\Cloud\Storage\Google\Cloud\Storage\HmacKey::update() for details.
Example:
$hmacKey->delete();
Parameters | |
---|---|
Name | Description |
options |
array
Configuration Options |
↳ userProject |
string
If set, this is the ID of the project which will be billed for the request. NOTE: This option is currently ignored by Cloud Storage. |
Returns | |
---|---|
Type | Description |
void |