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
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();
string
reload
Fetch the key metadata from Cloud Storage.
Example:
$keyMetadata = $hmacKey->reload();
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.
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();
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.
array
update
Update the HMAC Key state.
Example:
$hmacKey->update('INACTIVE');
state
string
The key state. Either ACTIVE
or INACTIVE
.
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.
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();
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.
void