Reference documentation and code samples for the Google Cloud Bare Metal Solution V2 Client class BareMetalSolutionClient.
Service Description: Performs management operations on Bare Metal Solution servers.
This class is currently experimental and may be subject to changes.
Namespace
Google \ Cloud \ BareMetalSolution \ 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. |
↳ 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. |
detachLun
Detach LUN from Instance.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::detachLunAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\DetachLunRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\DetachLunRequest;
use Google\Cloud\BareMetalSolution\V2\Instance;
use Google\Rpc\Status;
/**
* @param string $formattedInstance Name of the instance. Please see
* {@see BareMetalSolutionClient::instanceName()} for help formatting this field.
* @param string $formattedLun Name of the Lun to detach. Please see
* {@see BareMetalSolutionClient::lunName()} for help formatting this field.
*/
function detach_lun_sample(string $formattedInstance, string $formattedLun): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new DetachLunRequest())
->setInstance($formattedInstance)
->setLun($formattedLun);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->detachLun($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Instance $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
{
$formattedInstance = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
$formattedLun = BareMetalSolutionClient::lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]');
detach_lun_sample($formattedInstance, $formattedLun);
}
getInstance
Get details about a single server.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::getInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetInstanceRequest
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\BareMetalSolution\V2\Instance |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\GetInstanceRequest;
use Google\Cloud\BareMetalSolution\V2\Instance;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::instanceName()} for help formatting this field.
*/
function get_instance_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new GetInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Instance $response */
$response = $bareMetalSolutionClient->getInstance($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 = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
get_instance_sample($formattedName);
}
getLun
Get details of a single storage logical unit number(LUN).
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::getLunAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetLunRequest
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\BareMetalSolution\V2\Lun |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\GetLunRequest;
use Google\Cloud\BareMetalSolution\V2\Lun;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::lunName()} for help formatting this field.
*/
function get_lun_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new GetLunRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Lun $response */
$response = $bareMetalSolutionClient->getLun($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 = BareMetalSolutionClient::lunName('[PROJECT]', '[LOCATION]', '[VOLUME]', '[LUN]');
get_lun_sample($formattedName);
}
getNetwork
Get details of a single network.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::getNetworkAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetNetworkRequest
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\BareMetalSolution\V2\Network |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\GetNetworkRequest;
use Google\Cloud\BareMetalSolution\V2\Network;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::networkName()} for help formatting this field.
*/
function get_network_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new GetNetworkRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Network $response */
$response = $bareMetalSolutionClient->getNetwork($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 = BareMetalSolutionClient::networkName('[PROJECT]', '[LOCATION]', '[NETWORK]');
get_network_sample($formattedName);
}
getNfsShare
Get details of a single NFS share.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::getNfsShareAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetNfsShareRequest
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\BareMetalSolution\V2\NfsShare |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\GetNfsShareRequest;
use Google\Cloud\BareMetalSolution\V2\NfsShare;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::nFSShareName()} for help formatting this field.
*/
function get_nfs_share_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new GetNfsShareRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var NfsShare $response */
$response = $bareMetalSolutionClient->getNfsShare($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 = BareMetalSolutionClient::nFSShareName('[PROJECT]', '[LOCATION]', '[NFS_SHARE]');
get_nfs_share_sample($formattedName);
}
getVolume
Get details of a single storage volume.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::getVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetVolumeRequest
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\BareMetalSolution\V2\Volume |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\GetVolumeRequest;
use Google\Cloud\BareMetalSolution\V2\Volume;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::volumeName()} for help formatting this field.
*/
function get_volume_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new GetVolumeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Volume $response */
$response = $bareMetalSolutionClient->getVolume($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 = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
get_volume_sample($formattedName);
}
listInstances
List servers in a given project and location.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listInstancesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListInstancesRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\Instance;
use Google\Cloud\BareMetalSolution\V2\ListInstancesRequest;
/**
* @param string $formattedParent Parent value for ListInstancesRequest. Please see
* {@see BareMetalSolutionClient::locationName()} for help formatting this field.
*/
function list_instances_sample(string $formattedParent): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListInstancesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $bareMetalSolutionClient->listInstances($request);
/** @var Instance $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 = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]');
list_instances_sample($formattedParent);
}
listLuns
List storage volume luns for given storage volume.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listLunsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListLunsRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ListLunsRequest;
use Google\Cloud\BareMetalSolution\V2\Lun;
/**
* @param string $formattedParent Parent value for ListLunsRequest. Please see
* {@see BareMetalSolutionClient::volumeName()} for help formatting this field.
*/
function list_luns_sample(string $formattedParent): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListLunsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $bareMetalSolutionClient->listLuns($request);
/** @var Lun $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 = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
list_luns_sample($formattedParent);
}
listNetworkUsage
List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listNetworkUsageAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNetworkUsageRequest
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\BareMetalSolution\V2\ListNetworkUsageResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ListNetworkUsageRequest;
use Google\Cloud\BareMetalSolution\V2\ListNetworkUsageResponse;
/**
* @param string $formattedLocation Parent value (project and location). Please see
* {@see BareMetalSolutionClient::locationName()} for help formatting this field.
*/
function list_network_usage_sample(string $formattedLocation): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListNetworkUsageRequest())
->setLocation($formattedLocation);
// Call the API and handle any network failures.
try {
/** @var ListNetworkUsageResponse $response */
$response = $bareMetalSolutionClient->listNetworkUsage($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
{
$formattedLocation = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]');
list_network_usage_sample($formattedLocation);
}
listNetworks
List network in a given project and location.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listNetworksAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNetworksRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ListNetworksRequest;
use Google\Cloud\BareMetalSolution\V2\Network;
/**
* @param string $formattedParent Parent value for ListNetworksRequest. Please see
* {@see BareMetalSolutionClient::locationName()} for help formatting this field.
*/
function list_networks_sample(string $formattedParent): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListNetworksRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $bareMetalSolutionClient->listNetworks($request);
/** @var Network $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 = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]');
list_networks_sample($formattedParent);
}
listNfsShares
List NFS shares.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listNfsSharesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNfsSharesRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ListNfsSharesRequest;
use Google\Cloud\BareMetalSolution\V2\NfsShare;
/**
* @param string $formattedParent Parent value for ListNfsSharesRequest. Please see
* {@see BareMetalSolutionClient::locationName()} for help formatting this field.
*/
function list_nfs_shares_sample(string $formattedParent): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListNfsSharesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $bareMetalSolutionClient->listNfsShares($request);
/** @var NfsShare $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 = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]');
list_nfs_shares_sample($formattedParent);
}
listVolumes
List storage volumes in a given project and location.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::listVolumesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListVolumesRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ListVolumesRequest;
use Google\Cloud\BareMetalSolution\V2\Volume;
/**
* @param string $formattedParent Parent value for ListVolumesRequest. Please see
* {@see BareMetalSolutionClient::locationName()} for help formatting this field.
*/
function list_volumes_sample(string $formattedParent): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ListVolumesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $bareMetalSolutionClient->listVolumes($request);
/** @var Volume $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 = BareMetalSolutionClient::locationName('[PROJECT]', '[LOCATION]');
list_volumes_sample($formattedParent);
}
resetInstance
Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::resetInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ResetInstanceRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ResetInstanceRequest;
use Google\Cloud\BareMetalSolution\V2\ResetInstanceResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::instanceName()} for help formatting this field.
*/
function reset_instance_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ResetInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->resetInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ResetInstanceResponse $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 = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
reset_instance_sample($formattedName);
}
resizeVolume
Emergency Volume resize.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::resizeVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ResizeVolumeRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\ResizeVolumeRequest;
use Google\Cloud\BareMetalSolution\V2\Volume;
use Google\Rpc\Status;
/**
* @param string $formattedVolume Volume to resize. Please see
* {@see BareMetalSolutionClient::volumeName()} for help formatting this field.
*/
function resize_volume_sample(string $formattedVolume): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new ResizeVolumeRequest())
->setVolume($formattedVolume);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->resizeVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Volume $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
{
$formattedVolume = BareMetalSolutionClient::volumeName('[PROJECT]', '[LOCATION]', '[VOLUME]');
resize_volume_sample($formattedVolume);
}
startInstance
Starts a server that was shutdown.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::startInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\StartInstanceRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\StartInstanceRequest;
use Google\Cloud\BareMetalSolution\V2\StartInstanceResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::instanceName()} for help formatting this field.
*/
function start_instance_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new StartInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->startInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var StartInstanceResponse $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 = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
start_instance_sample($formattedName);
}
stopInstance
Stop a running server.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::stopInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\StopInstanceRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\StopInstanceRequest;
use Google\Cloud\BareMetalSolution\V2\StopInstanceResponse;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see BareMetalSolutionClient::instanceName()} for help formatting this field.
*/
function stop_instance_sample(string $formattedName): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$request = (new StopInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->stopInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var StopInstanceResponse $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 = BareMetalSolutionClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
stop_instance_sample($formattedName);
}
updateInstance
Update details of a single server.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::updateInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateInstanceRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\Instance;
use Google\Cloud\BareMetalSolution\V2\UpdateInstanceRequest;
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_instance_sample(): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$instance = new Instance();
$request = (new UpdateInstanceRequest())
->setInstance($instance);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->updateInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Instance $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());
}
}
updateNetwork
Update details of a single network.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::updateNetworkAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateNetworkRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\Network;
use Google\Cloud\BareMetalSolution\V2\UpdateNetworkRequest;
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_network_sample(): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$network = new Network();
$request = (new UpdateNetworkRequest())
->setNetwork($network);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->updateNetwork($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Network $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());
}
}
updateNfsShare
Update details of a single NFS share.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::updateNfsShareAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateNfsShareRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\NfsShare;
use Google\Cloud\BareMetalSolution\V2\UpdateNfsShareRequest;
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_nfs_share_sample(): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$nfsShare = new NfsShare();
$request = (new UpdateNfsShareRequest())
->setNfsShare($nfsShare);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->updateNfsShare($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var NfsShare $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());
}
}
updateVolume
Update details of a single storage volume.
The async variant is Google\Cloud\BareMetalSolution\V2\Client\BaseClient\self::updateVolumeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateVolumeRequest
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\BareMetalSolution\V2\Client\BareMetalSolutionClient;
use Google\Cloud\BareMetalSolution\V2\UpdateVolumeRequest;
use Google\Cloud\BareMetalSolution\V2\Volume;
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_volume_sample(): void
{
// Create a client.
$bareMetalSolutionClient = new BareMetalSolutionClient();
// Prepare the request message.
$volume = new Volume();
$request = (new UpdateVolumeRequest())
->setVolume($volume);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $bareMetalSolutionClient->updateVolume($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Volume $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());
}
}
detachLunAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\DetachLunRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetInstanceRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getLunAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetLunRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getNetworkAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetNetworkRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getNfsShareAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetNfsShareRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\GetVolumeRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listInstancesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListInstancesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listLunsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListLunsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listNetworkUsageAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNetworkUsageRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listNetworksAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNetworksRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listNfsSharesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListNfsSharesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listVolumesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ListVolumesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
resetInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ResetInstanceRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
resizeVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\ResizeVolumeRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
startInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\StartInstanceRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
stopInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\StopInstanceRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateInstanceRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateNetworkAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateNetworkRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateNfsShareAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateNfsShareRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateVolumeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BareMetalSolution\V2\UpdateVolumeRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\ApiCore\LongRunning\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::instanceName
Formats a string containing the fully-qualified path to represent a instance resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
instance |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted instance resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted location resource. |
static::lunName
Formats a string containing the fully-qualified path to represent a lun resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
volume |
string
|
lun |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted lun resource. |
static::nFSShareName
Formats a string containing the fully-qualified path to represent a nfs_share resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
nfsShare |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted nfs_share resource. |
static::networkName
Formats a string containing the fully-qualified path to represent a network resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
network |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted network resource. |
static::serverNetworkTemplateName
Formats a string containing the fully-qualified path to represent a server_network_template resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
serverNetworkTemplate |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted server_network_template resource. |
static::volumeName
Formats a string containing the fully-qualified path to represent a volume resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
volume |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted volume 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
- instance: projects/{project}/locations/{location}/instances/{instance}
- location: projects/{project}/locations/{location}
- lun: projects/{project}/locations/{location}/volumes/{volume}/luns/{lun}
- nFSShare: projects/{project}/locations/{location}/nfsShares/{nfs_share}
- network: projects/{project}/locations/{location}/networks/{network}
- serverNetworkTemplate: projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}
- volume: projects/{project}/locations/{location}/volumes/{volume}
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. |