Google Cloud Config V1 Client - Class ConfigClient (0.1.3)

Reference documentation and code samples for the Google Cloud Config V1 Client class ConfigClient.

Service Description: Infrastructure Manager is a managed service that automates the deployment and management of Google Cloud infrastructure resources.

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.

This class is currently experimental and may be subject to changes.

Namespace

Google \ Cloud \ Config \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
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 false.

↳ 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 rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ 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.

createDeployment

Parameters
NameDescription
request Google\Cloud\Config\V1\CreateDeploymentRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\CreateDeploymentRequest;
use Google\Cloud\Config\V1\Deployment;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent in whose context the Deployment is created. The parent
 *                                value is in the format: 'projects/{project_id}/locations/{location}'. Please see
 *                                {@see ConfigClient::locationName()} for help formatting this field.
 * @param string $deploymentId    The Deployment ID.
 */
function create_deployment_sample(string $formattedParent, string $deploymentId): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $deployment = new Deployment();
    $request = (new CreateDeploymentRequest())
        ->setParent($formattedParent)
        ->setDeploymentId($deploymentId)
        ->setDeployment($deployment);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $configClient->createDeployment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Deployment $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 = ConfigClient::locationName('[PROJECT]', '[LOCATION]');
    $deploymentId = '[DEPLOYMENT_ID]';

    create_deployment_sample($formattedParent, $deploymentId);
}

deleteDeployment

Parameters
NameDescription
request Google\Cloud\Config\V1\DeleteDeploymentRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\DeleteDeploymentRequest;
use Google\Cloud\Config\V1\Deployment;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the Deployment in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function delete_deployment_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new DeleteDeploymentRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $configClient->deleteDeployment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Deployment $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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    delete_deployment_sample($formattedName);
}

deleteStatefile

Deletes Terraform state file in a given deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::deleteStatefileAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\DeleteStatefileRequest

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.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\DeleteStatefileRequest;

/**
 * @param string $formattedName The name of the deployment in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 * @param int    $lockId        Lock ID of the lock file to verify that the user who is deleting
 *                              the state file previously locked the Deployment.
 */
function delete_statefile_sample(string $formattedName, int $lockId): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new DeleteStatefileRequest())
        ->setName($formattedName)
        ->setLockId($lockId);

    // Call the API and handle any network failures.
    try {
        $configClient->deleteStatefile($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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');
    $lockId = 0;

    delete_statefile_sample($formattedName, $lockId);
}

exportDeploymentStatefile

Exports Terraform state file from a given deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::exportDeploymentStatefileAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportDeploymentStatefileRequest

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
TypeDescription
Google\Cloud\Config\V1\Statefile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ExportDeploymentStatefileRequest;
use Google\Cloud\Config\V1\Statefile;

/**
 * @param string $formattedParent The parent in whose context the statefile is listed. The parent
 *                                value is in the format:
 *                                'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                                {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function export_deployment_statefile_sample(string $formattedParent): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ExportDeploymentStatefileRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var Statefile $response */
        $response = $configClient->exportDeploymentStatefile($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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    export_deployment_statefile_sample($formattedParent);
}

exportLockInfo

Exports the lock info on a locked deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::exportLockInfoAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportLockInfoRequest

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
TypeDescription
Google\Cloud\Config\V1\LockInfo
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ExportLockInfoRequest;
use Google\Cloud\Config\V1\LockInfo;

/**
 * @param string $formattedName The name of the deployment in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function export_lock_info_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ExportLockInfoRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var LockInfo $response */
        $response = $configClient->exportLockInfo($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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    export_lock_info_sample($formattedName);
}

exportRevisionStatefile

Exports Terraform state file from a given revision.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::exportRevisionStatefileAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportRevisionStatefileRequest

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
TypeDescription
Google\Cloud\Config\V1\Statefile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ExportRevisionStatefileRequest;
use Google\Cloud\Config\V1\Statefile;

/**
 * @param string $formattedParent The parent in whose context the statefile is listed. The parent
 *                                value is in the format:
 *                                'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'. Please see
 *                                {@see ConfigClient::revisionName()} for help formatting this field.
 */
function export_revision_statefile_sample(string $formattedParent): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ExportRevisionStatefileRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var Statefile $response */
        $response = $configClient->exportRevisionStatefile($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 = ConfigClient::revisionName(
        '[PROJECT]',
        '[LOCATION]',
        '[DEPLOYMENT]',
        '[REVISION]'
    );

    export_revision_statefile_sample($formattedParent);
}

getDeployment

Parameters
NameDescription
request Google\Cloud\Config\V1\GetDeploymentRequest

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
TypeDescription
Google\Cloud\Config\V1\Deployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\Deployment;
use Google\Cloud\Config\V1\GetDeploymentRequest;

/**
 * @param string $formattedName The name of the deployment. Format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function get_deployment_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new GetDeploymentRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Deployment $response */
        $response = $configClient->getDeployment($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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    get_deployment_sample($formattedName);
}

getResource

Gets details about a Resource deployed by Infra Manager.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::getResourceAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\GetResourceRequest

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
TypeDescription
resource
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\GetResourceRequest;
use Google\Cloud\Config\V1\Resource;

/**
 * @param string $formattedName The name of the Resource in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'. Please see
 *                              {@see ConfigClient::resourceName()} for help formatting this field.
 */
function get_resource_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new GetResourceRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Resource $response */
        $response = $configClient->getResource($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 = ConfigClient::resourceName(
        '[PROJECT]',
        '[LOCATION]',
        '[DEPLOYMENT]',
        '[REVISION]',
        '[RESOURCE]'
    );

    get_resource_sample($formattedName);
}

getRevision

Gets details about a Revision.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::getRevisionAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\GetRevisionRequest

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
TypeDescription
Google\Cloud\Config\V1\Revision
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\GetRevisionRequest;
use Google\Cloud\Config\V1\Revision;

/**
 * @param string $formattedName The name of the Revision in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'. Please see
 *                              {@see ConfigClient::revisionName()} for help formatting this field.
 */
function get_revision_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new GetRevisionRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Revision $response */
        $response = $configClient->getRevision($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 = ConfigClient::revisionName(
        '[PROJECT]',
        '[LOCATION]',
        '[DEPLOYMENT]',
        '[REVISION]'
    );

    get_revision_sample($formattedName);
}

importStatefile

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::importStatefileAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ImportStatefileRequest

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
TypeDescription
Google\Cloud\Config\V1\Statefile
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ImportStatefileRequest;
use Google\Cloud\Config\V1\Statefile;

/**
 * @param string $formattedParent The parent in whose context the statefile is listed. The parent
 *                                value is in the format:
 *                                'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                                {@see ConfigClient::deploymentName()} for help formatting this field.
 * @param int    $lockId          Lock ID of the lock file to verify that the user who is importing
 *                                the state file previously locked the Deployment.
 */
function import_statefile_sample(string $formattedParent, int $lockId): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ImportStatefileRequest())
        ->setParent($formattedParent)
        ->setLockId($lockId);

    // Call the API and handle any network failures.
    try {
        /** @var Statefile $response */
        $response = $configClient->importStatefile($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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');
    $lockId = 0;

    import_statefile_sample($formattedParent, $lockId);
}

listDeployments

Lists Deployments in a given project and location.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::listDeploymentsAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ListDeploymentsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\Deployment;
use Google\Cloud\Config\V1\ListDeploymentsRequest;

/**
 * @param string $formattedParent The parent in whose context the Deployments are listed. The
 *                                parent value is in the format:
 *                                'projects/{project_id}/locations/{location}'. Please see
 *                                {@see ConfigClient::locationName()} for help formatting this field.
 */
function list_deployments_sample(string $formattedParent): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ListDeploymentsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $configClient->listDeployments($request);

        /** @var Deployment $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 = ConfigClient::locationName('[PROJECT]', '[LOCATION]');

    list_deployments_sample($formattedParent);
}

listResources

Lists Resources in a given revision.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::listResourcesAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ListResourcesRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ListResourcesRequest;
use Google\Cloud\Config\V1\Resource;

/**
 * @param string $formattedParent The parent in whose context the Resources are listed. The parent
 *                                value is in the format:
 *                                'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'. Please see
 *                                {@see ConfigClient::revisionName()} for help formatting this field.
 */
function list_resources_sample(string $formattedParent): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ListResourcesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $configClient->listResources($request);

        /** @var Resource $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 = ConfigClient::revisionName(
        '[PROJECT]',
        '[LOCATION]',
        '[DEPLOYMENT]',
        '[REVISION]'
    );

    list_resources_sample($formattedParent);
}

listRevisions

Lists Revisions of a deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::listRevisionsAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\ListRevisionsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\ListRevisionsRequest;
use Google\Cloud\Config\V1\Revision;

/**
 * @param string $formattedParent The parent in whose context the Revisions are listed. The parent
 *                                value is in the format:
 *                                'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                                {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function list_revisions_sample(string $formattedParent): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new ListRevisionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $configClient->listRevisions($request);

        /** @var Revision $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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    list_revisions_sample($formattedParent);
}

lockDeployment

Locks a deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::lockDeploymentAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\LockDeploymentRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\Deployment;
use Google\Cloud\Config\V1\LockDeploymentRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the deployment in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 */
function lock_deployment_sample(string $formattedName): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new LockDeploymentRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $configClient->lockDeployment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Deployment $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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');

    lock_deployment_sample($formattedName);
}

unlockDeployment

Unlocks a locked deployment.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::unlockDeploymentAsync() .

Parameters
NameDescription
request Google\Cloud\Config\V1\UnlockDeploymentRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\Deployment;
use Google\Cloud\Config\V1\UnlockDeploymentRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the deployment in the format:
 *                              'projects/{project_id}/locations/{location}/deployments/{deployment}'. Please see
 *                              {@see ConfigClient::deploymentName()} for help formatting this field.
 * @param int    $lockId        Lock ID of the lock file to be unlocked.
 */
function unlock_deployment_sample(string $formattedName, int $lockId): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new UnlockDeploymentRequest())
        ->setName($formattedName)
        ->setLockId($lockId);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $configClient->unlockDeployment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Deployment $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 = ConfigClient::deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');
    $lockId = 0;

    unlock_deployment_sample($formattedName, $lockId);
}

updateDeployment

Parameters
NameDescription
request Google\Cloud\Config\V1\UpdateDeploymentRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Config\V1\Deployment;
use Google\Cloud\Config\V1\UpdateDeploymentRequest;
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_deployment_sample(): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $deployment = new Deployment();
    $request = (new UpdateDeploymentRequest())
        ->setDeployment($deployment);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $configClient->updateDeployment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Deployment $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());
    }
}

getLocation

Gets information about a location.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::getLocationAsync() .

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

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
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;

/**
 * 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 get_location_sample(): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $configClient->getLocation($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

listLocations

Lists information about the supported locations for this service.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;

/**
 * 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 list_locations_sample(): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $configClient->listLocations($request);

        /** @var Location $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());
    }
}

getIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest

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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being requested.
 *                         See the operation documentation for the appropriate value for this field.
 */
function get_iam_policy_sample(string $resource): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $request = (new GetIamPolicyRequest())
        ->setResource($resource);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $configClient->getIamPolicy($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
{
    $resource = '[RESOURCE]';

    get_iam_policy_sample($resource);
}

setIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest

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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being specified.
 *                         See the operation documentation for the appropriate value for this field.
 */
function set_iam_policy_sample(string $resource): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $policy = new Policy();
    $request = (new SetIamPolicyRequest())
        ->setResource($resource)
        ->setPolicy($policy);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $configClient->setIamPolicy($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
{
    $resource = '[RESOURCE]';

    set_iam_policy_sample($resource);
}

testIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

The async variant is Google\Cloud\Config\V1\Client\ConfigClient::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

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
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Config\V1\Client\ConfigClient;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;

/**
 * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
 *                                   See the operation documentation for the appropriate value for this field.
 * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
 *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
 *                                   information see
 *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
 */
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
    // Create a client.
    $configClient = new ConfigClient();

    // Prepare the request message.
    $permissions = [$permissionsElement,];
    $request = (new TestIamPermissionsRequest())
        ->setResource($resource)
        ->setPermissions($permissions);

    // Call the API and handle any network failures.
    try {
        /** @var TestIamPermissionsResponse $response */
        $response = $configClient->testIamPermissions($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
{
    $resource = '[RESOURCE]';
    $permissionsElement = '[PERMISSIONS]';

    test_iam_permissions_sample($resource, $permissionsElement);
}

createDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\CreateDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\DeleteDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteStatefileAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\DeleteStatefileRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

exportDeploymentStatefileAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportDeploymentStatefileRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

exportLockInfoAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportLockInfoRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

exportRevisionStatefileAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ExportRevisionStatefileRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\GetDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getResourceAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\GetResourceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getRevisionAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\GetRevisionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

importStatefileAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ImportStatefileRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDeploymentsAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ListDeploymentsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listResourcesAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ListResourcesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listRevisionsAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\ListRevisionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

lockDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\LockDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

unlockDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\UnlockDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDeploymentAsync

Parameters
NameDescription
request Google\Cloud\Config\V1\UpdateDeploymentRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
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
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::deploymentName

Formats a string containing the fully-qualified path to represent a deployment resource.

Parameters
NameDescription
project string
location string
deployment string
Returns
TypeDescription
stringThe formatted deployment resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::resourceName

Formats a string containing the fully-qualified path to represent a resource resource.

Parameters
NameDescription
project string
location string
deployment string
revision string
resource string
Returns
TypeDescription
stringThe formatted resource resource.

static::revisionName

Formats a string containing the fully-qualified path to represent a revision resource.

Parameters
NameDescription
project string
location string
deployment string
revision string
Returns
TypeDescription
stringThe formatted revision resource.

static::serviceAccountName

Formats a string containing the fully-qualified path to represent a service_account resource.

Parameters
NameDescription
project string
serviceAccount string
Returns
TypeDescription
stringThe formatted service_account resource.

static::workerPoolName

Formats a string containing the fully-qualified path to represent a worker_pool resource.

Parameters
NameDescription
project string
location string
workerPool string
Returns
TypeDescription
stringThe formatted worker_pool 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

  • deployment: projects/{project}/locations/{location}/deployments/{deployment}
  • location: projects/{project}/locations/{location}
  • resource: projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}
  • revision: projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}
  • serviceAccount: projects/{project}/serviceAccounts/{service_account}
  • workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool}

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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.