Reference documentation and code samples for the Google Cloud Storage Control V2 Client class StorageControlClient.
Service Description: StorageControl service includes selected control plane operations.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ Storage \ Control \ V2 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information https://cloud.google.com/docs/authentication/external/externally-sourced-credentials |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
↳ logger |
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
createAnywhereCache
Creates an Anywhere Cache instance.
The async variant is StorageControlClient::createAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\CreateAnywhereCacheRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The bucket to which this cache belongs.
* Format: `projects/{project}/buckets/{bucket}`
* Please see {@see StorageControlClient::bucketName()} for help formatting this field.
*/
function create_anywhere_cache_sample(string $formattedParent): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$anywhereCache = new AnywhereCache();
$request = (new CreateAnywhereCacheRequest())
->setParent($formattedParent)
->setAnywhereCache($anywhereCache);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $storageControlClient->createAnywhereCache($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var AnywhereCache $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
create_anywhere_cache_sample($formattedParent);
}
createFolder
Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.
The async variant is StorageControlClient::createFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\Folder |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\CreateFolderRequest;
use Google\Cloud\Storage\Control\V2\Folder;
/**
* @param string $formattedParent Name of the bucket in which the folder will reside. The bucket
* must be a hierarchical namespace enabled bucket. Please see
* {@see StorageControlClient::bucketName()} for help formatting this field.
* @param string $folderId The full name of a folder, including all its parent folders.
* Folders use single '/' characters as a delimiter.
* The folder_id must end with a slash.
* For example, the folder_id of "books/biographies/" would create a new
* "biographies/" folder under the "books/" folder.
*/
function create_folder_sample(string $formattedParent, string $folderId): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$folder = new Folder();
$request = (new CreateFolderRequest())
->setParent($formattedParent)
->setFolder($folder)
->setFolderId($folderId);
// Call the API and handle any network failures.
try {
/** @var Folder $response */
$response = $storageControlClient->createFolder($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
$folderId = '[FOLDER_ID]';
create_folder_sample($formattedParent, $folderId);
}
createManagedFolder
Creates a new managed folder.
The async variant is StorageControlClient::createManagedFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateManagedFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\ManagedFolder |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\CreateManagedFolderRequest;
use Google\Cloud\Storage\Control\V2\ManagedFolder;
/**
* @param string $formattedParent Name of the bucket this managed folder belongs to. Please see
* {@see StorageControlClient::bucketName()} for help formatting this field.
* @param string $managedFolderId The name of the managed folder. It uses a single `/` as delimiter
* and leading and trailing `/` are allowed.
*/
function create_managed_folder_sample(string $formattedParent, string $managedFolderId): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$managedFolder = new ManagedFolder();
$request = (new CreateManagedFolderRequest())
->setParent($formattedParent)
->setManagedFolder($managedFolder)
->setManagedFolderId($managedFolderId);
// Call the API and handle any network failures.
try {
/** @var ManagedFolder $response */
$response = $storageControlClient->createManagedFolder($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
$managedFolderId = '[MANAGED_FOLDER_ID]';
create_managed_folder_sample($formattedParent, $managedFolderId);
}
deleteFolder
Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.
The async variant is StorageControlClient::deleteFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DeleteFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\DeleteFolderRequest;
/**
* @param string $formattedName Name of the folder.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
* Please see {@see StorageControlClient::folderName()} for help formatting this field.
*/
function delete_folder_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new DeleteFolderRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$storageControlClient->deleteFolder($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::folderName('[PROJECT]', '[BUCKET]', '[FOLDER]');
delete_folder_sample($formattedName);
}
deleteManagedFolder
Permanently deletes an empty managed folder.
The async variant is StorageControlClient::deleteManagedFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DeleteManagedFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\DeleteManagedFolderRequest;
/**
* @param string $formattedName Name of the managed folder.
* Format:
* `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
* Please see {@see StorageControlClient::managedFolderName()} for help formatting this field.
*/
function delete_managed_folder_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new DeleteManagedFolderRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$storageControlClient->deleteManagedFolder($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::managedFolderName(
'[PROJECT]',
'[BUCKET]',
'[MANAGED_FOLDER]'
);
delete_managed_folder_sample($formattedName);
}
disableAnywhereCache
Disables an Anywhere Cache instance. A disabled instance is read-only. The disablement could be revoked by calling ResumeAnywhereCache. The cache instance will be deleted automatically if it remains in the disabled state for at least one hour.
The async variant is StorageControlClient::disableAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DisableAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\AnywhereCache |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\DisableAnywhereCacheRequest;
/**
* @param string $formattedName The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
* Please see {@see StorageControlClient::anywhereCacheName()} for help formatting this field.
*/
function disable_anywhere_cache_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new DisableAnywhereCacheRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AnywhereCache $response */
$response = $storageControlClient->disableAnywhereCache($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::anywhereCacheName(
'[PROJECT]',
'[BUCKET]',
'[ANYWHERE_CACHE]'
);
disable_anywhere_cache_sample($formattedName);
}
getAnywhereCache
Gets an Anywhere Cache instance.
The async variant is StorageControlClient::getAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\AnywhereCache |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetAnywhereCacheRequest;
/**
* @param string $formattedName The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
* Please see {@see StorageControlClient::anywhereCacheName()} for help formatting this field.
*/
function get_anywhere_cache_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetAnywhereCacheRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AnywhereCache $response */
$response = $storageControlClient->getAnywhereCache($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::anywhereCacheName(
'[PROJECT]',
'[BUCKET]',
'[ANYWHERE_CACHE]'
);
get_anywhere_cache_sample($formattedName);
}
getFolder
Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.
The async variant is StorageControlClient::getFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\Folder |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\Folder;
use Google\Cloud\Storage\Control\V2\GetFolderRequest;
/**
* @param string $formattedName Name of the folder.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
* Please see {@see StorageControlClient::folderName()} for help formatting this field.
*/
function get_folder_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetFolderRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Folder $response */
$response = $storageControlClient->getFolder($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::folderName('[PROJECT]', '[BUCKET]', '[FOLDER]');
get_folder_sample($formattedName);
}
getFolderIntelligenceConfig
Returns the Folder scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::getFolderIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetFolderIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetFolderIntelligenceConfigRequest;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
/**
* @param string $formattedName The name of the `IntelligenceConfig` resource associated with
* your folder.
*
* Format: `folders/{id}/locations/global/intelligenceConfig`
* Please see {@see StorageControlClient::intelligenceConfigName()} for help formatting this field.
*/
function get_folder_intelligence_config_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetFolderIntelligenceConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->getFolderIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::intelligenceConfigName('[FOLDER]', '[LOCATION]');
get_folder_intelligence_config_sample($formattedName);
}
getManagedFolder
Returns metadata for the specified managed folder.
The async variant is StorageControlClient::getManagedFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetManagedFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\ManagedFolder |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetManagedFolderRequest;
use Google\Cloud\Storage\Control\V2\ManagedFolder;
/**
* @param string $formattedName Name of the managed folder.
* Format:
* `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
* Please see {@see StorageControlClient::managedFolderName()} for help formatting this field.
*/
function get_managed_folder_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetManagedFolderRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ManagedFolder $response */
$response = $storageControlClient->getManagedFolder($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::managedFolderName(
'[PROJECT]',
'[BUCKET]',
'[MANAGED_FOLDER]'
);
get_managed_folder_sample($formattedName);
}
getOrganizationIntelligenceConfig
Returns the Organization scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::getOrganizationIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetOrganizationIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetOrganizationIntelligenceConfigRequest;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
/**
* @param string $formattedName The name of the `IntelligenceConfig` resource associated with
* your organization.
*
* Format: `organizations/{org_id}/locations/global/intelligenceConfig`
* Please see {@see StorageControlClient::intelligenceConfigName()} for help formatting this field.
*/
function get_organization_intelligence_config_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetOrganizationIntelligenceConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->getOrganizationIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::intelligenceConfigName('[FOLDER]', '[LOCATION]');
get_organization_intelligence_config_sample($formattedName);
}
getProjectIntelligenceConfig
Returns the Project scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::getProjectIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetProjectIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetProjectIntelligenceConfigRequest;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
/**
* @param string $formattedName The name of the `IntelligenceConfig` resource associated with
* your project.
*
* Format: `projects/{id}/locations/global/intelligenceConfig`
* Please see {@see StorageControlClient::intelligenceConfigName()} for help formatting this field.
*/
function get_project_intelligence_config_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetProjectIntelligenceConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->getProjectIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::intelligenceConfigName('[FOLDER]', '[LOCATION]');
get_project_intelligence_config_sample($formattedName);
}
getStorageLayout
Returns the storage layout configuration for a given bucket.
The async variant is StorageControlClient::getStorageLayoutAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetStorageLayoutRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\StorageLayout |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\GetStorageLayoutRequest;
use Google\Cloud\Storage\Control\V2\StorageLayout;
/**
* @param string $formattedName The name of the StorageLayout resource.
* Format: `projects/{project}/buckets/{bucket}/storageLayout`
* Please see {@see StorageControlClient::storageLayoutName()} for help formatting this field.
*/
function get_storage_layout_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetStorageLayoutRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var StorageLayout $response */
$response = $storageControlClient->getStorageLayout($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::storageLayoutName('[PROJECT]', '[BUCKET]');
get_storage_layout_sample($formattedName);
}
listAnywhereCaches
Lists Anywhere Cache instances for a given bucket.
The async variant is StorageControlClient::listAnywhereCachesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListAnywhereCachesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\ListAnywhereCachesRequest;
/**
* @param string $formattedParent The bucket to which this cache belongs. Please see
* {@see StorageControlClient::bucketName()} for help formatting this field.
*/
function list_anywhere_caches_sample(string $formattedParent): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new ListAnywhereCachesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $storageControlClient->listAnywhereCaches($request);
/** @var AnywhereCache $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
list_anywhere_caches_sample($formattedParent);
}
listFolders
Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.
The async variant is StorageControlClient::listFoldersAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListFoldersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\Folder;
use Google\Cloud\Storage\Control\V2\ListFoldersRequest;
/**
* @param string $formattedParent Name of the bucket in which to look for folders. The bucket must
* be a hierarchical namespace enabled bucket. Please see
* {@see StorageControlClient::bucketName()} for help formatting this field.
*/
function list_folders_sample(string $formattedParent): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new ListFoldersRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $storageControlClient->listFolders($request);
/** @var Folder $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
list_folders_sample($formattedParent);
}
listManagedFolders
Retrieves a list of managed folders for a given bucket.
The async variant is StorageControlClient::listManagedFoldersAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListManagedFoldersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\ListManagedFoldersRequest;
use Google\Cloud\Storage\Control\V2\ManagedFolder;
/**
* @param string $formattedParent Name of the bucket this managed folder belongs to. Please see
* {@see StorageControlClient::bucketName()} for help formatting this field.
*/
function list_managed_folders_sample(string $formattedParent): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new ListManagedFoldersRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $storageControlClient->listManagedFolders($request);
/** @var ManagedFolder $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = StorageControlClient::bucketName('[PROJECT]', '[BUCKET]');
list_managed_folders_sample($formattedParent);
}
pauseAnywhereCache
Pauses an Anywhere Cache instance.
The async variant is StorageControlClient::pauseAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\PauseAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\AnywhereCache |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\PauseAnywhereCacheRequest;
/**
* @param string $formattedName The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
* Please see {@see StorageControlClient::anywhereCacheName()} for help formatting this field.
*/
function pause_anywhere_cache_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new PauseAnywhereCacheRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AnywhereCache $response */
$response = $storageControlClient->pauseAnywhereCache($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::anywhereCacheName(
'[PROJECT]',
'[BUCKET]',
'[ANYWHERE_CACHE]'
);
pause_anywhere_cache_sample($formattedName);
}
renameFolder
Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.
The async variant is StorageControlClient::renameFolderAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\RenameFolderRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\Folder;
use Google\Cloud\Storage\Control\V2\RenameFolderRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the source folder being renamed.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
* Please see {@see StorageControlClient::folderName()} for help formatting this field.
* @param string $destinationFolderId The destination folder ID, e.g. `foo/bar/`.
*/
function rename_folder_sample(string $formattedName, string $destinationFolderId): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new RenameFolderRequest())
->setName($formattedName)
->setDestinationFolderId($destinationFolderId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $storageControlClient->renameFolder($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Folder $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::folderName('[PROJECT]', '[BUCKET]', '[FOLDER]');
$destinationFolderId = '[DESTINATION_FOLDER_ID]';
rename_folder_sample($formattedName, $destinationFolderId);
}
resumeAnywhereCache
Resumes a disabled or paused Anywhere Cache instance.
The async variant is StorageControlClient::resumeAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ResumeAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\AnywhereCache |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\ResumeAnywhereCacheRequest;
/**
* @param string $formattedName The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
* Please see {@see StorageControlClient::anywhereCacheName()} for help formatting this field.
*/
function resume_anywhere_cache_sample(string $formattedName): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new ResumeAnywhereCacheRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AnywhereCache $response */
$response = $storageControlClient->resumeAnywhereCache($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = StorageControlClient::anywhereCacheName(
'[PROJECT]',
'[BUCKET]',
'[ANYWHERE_CACHE]'
);
resume_anywhere_cache_sample($formattedName);
}
updateAnywhereCache
Updates an Anywhere Cache instance. Mutable fields include ttl
and
admission_policy
.
The async variant is StorageControlClient::updateAnywhereCacheAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateAnywhereCacheRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Storage\Control\V2\AnywhereCache;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\UpdateAnywhereCacheRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_anywhere_cache_sample(): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$anywhereCache = new AnywhereCache();
$updateMask = new FieldMask();
$request = (new UpdateAnywhereCacheRequest())
->setAnywhereCache($anywhereCache)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $storageControlClient->updateAnywhereCache($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var AnywhereCache $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateFolderIntelligenceConfig
Updates the Folder scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::updateFolderIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateFolderIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
use Google\Cloud\Storage\Control\V2\UpdateFolderIntelligenceConfigRequest;
use Google\Protobuf\FieldMask;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_folder_intelligence_config_sample(): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$intelligenceConfig = new IntelligenceConfig();
$updateMask = new FieldMask();
$request = (new UpdateFolderIntelligenceConfigRequest())
->setIntelligenceConfig($intelligenceConfig)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->updateFolderIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateOrganizationIntelligenceConfig
Updates the Organization scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::updateOrganizationIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateOrganizationIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
use Google\Cloud\Storage\Control\V2\UpdateOrganizationIntelligenceConfigRequest;
use Google\Protobuf\FieldMask;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_organization_intelligence_config_sample(): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$intelligenceConfig = new IntelligenceConfig();
$updateMask = new FieldMask();
$request = (new UpdateOrganizationIntelligenceConfigRequest())
->setIntelligenceConfig($intelligenceConfig)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->updateOrganizationIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateProjectIntelligenceConfig
Updates the Project scoped singleton IntelligenceConfig resource.
The async variant is StorageControlClient::updateProjectIntelligenceConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateProjectIntelligenceConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Storage\Control\V2\IntelligenceConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
use Google\Cloud\Storage\Control\V2\IntelligenceConfig;
use Google\Cloud\Storage\Control\V2\UpdateProjectIntelligenceConfigRequest;
use Google\Protobuf\FieldMask;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_project_intelligence_config_sample(): void
{
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$intelligenceConfig = new IntelligenceConfig();
$updateMask = new FieldMask();
$request = (new UpdateProjectIntelligenceConfigRequest())
->setIntelligenceConfig($intelligenceConfig)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var IntelligenceConfig $response */
$response = $storageControlClient->updateProjectIntelligenceConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
createAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\Folder> |
createManagedFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\CreateManagedFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\ManagedFolder> |
deleteFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DeleteFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteManagedFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DeleteManagedFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
disableAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\DisableAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\AnywhereCache> |
getAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\AnywhereCache> |
getFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\Folder> |
getFolderIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetFolderIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
getManagedFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetManagedFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\ManagedFolder> |
getOrganizationIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetOrganizationIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
getProjectIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetProjectIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
getStorageLayoutAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\GetStorageLayoutRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\StorageLayout> |
listAnywhereCachesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListAnywhereCachesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listFoldersAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListFoldersRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listManagedFoldersAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ListManagedFoldersRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
pauseAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\PauseAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\AnywhereCache> |
renameFolderAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\RenameFolderRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
resumeAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\ResumeAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\AnywhereCache> |
updateAnywhereCacheAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateAnywhereCacheRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateFolderIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateFolderIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
updateOrganizationIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateOrganizationIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
updateProjectIntelligenceConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Storage\Control\V2\UpdateProjectIntelligenceConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Storage\Control\V2\IntelligenceConfig> |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\LongRunning\Client\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::anywhereCacheName
Formats a string containing the fully-qualified path to represent a anywhere_cache resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
bucket |
string
|
anywhereCache |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted anywhere_cache resource. |
static::bucketName
Formats a string containing the fully-qualified path to represent a bucket resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
bucket |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted bucket resource. |
static::folderName
Formats a string containing the fully-qualified path to represent a folder resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
bucket |
string
|
folder |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted folder resource. |
static::folderLocationIntelligenceConfigName
Formats a string containing the fully-qualified path to represent a folder_location_intelligenceConfig resource.
Parameters | |
---|---|
Name | Description |
folder |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted folder_location_intelligenceConfig resource. |
static::intelligenceConfigName
Formats a string containing the fully-qualified path to represent a intelligence_config resource.
Parameters | |
---|---|
Name | Description |
folder |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted intelligence_config resource. |
static::managedFolderName
Formats a string containing the fully-qualified path to represent a managed_folder resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
bucket |
string
|
managedFolder |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted managed_folder resource. |
static::orgLocationIntelligenceConfigName
Formats a string containing the fully-qualified path to represent a org_location_intelligenceConfig resource.
Parameters | |
---|---|
Name | Description |
org |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted org_location_intelligenceConfig resource. |
static::projectLocationIntelligenceConfigName
Formats a string containing the fully-qualified path to represent a project_location_intelligenceConfig resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted project_location_intelligenceConfig resource. |
static::storageLayoutName
Formats a string containing the fully-qualified path to represent a storage_layout resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
bucket |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted storage_layout resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- anywhereCache: projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}
- bucket: projects/{project}/buckets/{bucket}
- folder: projects/{project}/buckets/{bucket}/folders/{folder=**}
- folderLocationIntelligenceConfig: folders/{folder}/locations/{location}/intelligenceConfig
- intelligenceConfig: folders/{folder}/locations/{location}/intelligenceConfig
- managedFolder: projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}
- orgLocationIntelligenceConfig: organizations/{org}/locations/{location}/intelligenceConfig
- projectLocationIntelligenceConfig: projects/{project}/locations/{location}/intelligenceConfig
- storageLayout: projects/{project}/buckets/{bucket}/storageLayout
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |