Reference documentation and code samples for the Google Cloud Apigee Registry V1 Client class RegistryClient.
Service Description: The Registry service allows teams to manage descriptions of APIs.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
$registryClient = new RegistryClient();
try {
$formattedParent = $registryClient->locationName('[PROJECT]', '[LOCATION]');
$api = new Api();
$apiId = 'api_id';
$response = $registryClient->createApi($formattedParent, $api, $apiId);
} finally {
$registryClient->close();
}
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 service has a new (beta) implementation. See Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient to use the new surface.
Namespace
Google \ Cloud \ ApigeeRegistry \ V1Methods
__construct
Constructor.
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.
createApi
Creates a specified API.
parent
string
Required. The parent, which owns this collection of APIs.
Format: projects/*/locations/*
api
apiId
string
Required. The ID to use for the API, which will become the final component of the API's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\CreateApiRequest;
/**
* @param string $formattedParent The parent, which owns this collection of APIs.
* Format: `projects/*/locations/*`
* Please see {@see RegistryClient::locationName()} for help formatting this field.
* @param string $apiId The ID to use for the API, which will become the final component of
* the API's resource name.
*
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*
* Following AIP-162, IDs must not have the form of a UUID.
*/
function create_api_sample(string $formattedParent, string $apiId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$api = new Api();
$request = (new CreateApiRequest())
->setParent($formattedParent)
->setApi($api)
->setApiId($apiId);
// Call the API and handle any network failures.
try {
/** @var Api $response */
$response = $registryClient->createApi($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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
$apiId = '[API_ID]';
create_api_sample($formattedParent, $apiId);
}
createApiDeployment
Creates a specified deployment.
parent
string
Required. The parent, which owns this collection of deployments.
Format: projects/*/locations/*/apis/*
apiDeployment
apiDeploymentId
string
Required. The ID to use for the deployment, which will become the final component of the deployment's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\CreateApiDeploymentRequest;
/**
* @param string $formattedParent The parent, which owns this collection of deployments.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
* @param string $apiDeploymentId The ID to use for the deployment, which will become the final component of
* the deployment's resource name.
*
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*
* Following AIP-162, IDs must not have the form of a UUID.
*/
function create_api_deployment_sample(string $formattedParent, string $apiDeploymentId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiDeployment = new ApiDeployment();
$request = (new CreateApiDeploymentRequest())
->setParent($formattedParent)
->setApiDeployment($apiDeployment)
->setApiDeploymentId($apiDeploymentId);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->createApiDeployment($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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
$apiDeploymentId = '[API_DEPLOYMENT_ID]';
create_api_deployment_sample($formattedParent, $apiDeploymentId);
}
createApiSpec
Creates a specified spec.
parent
string
Required. The parent, which owns this collection of specs.
Format: projects/*/locations/*/apis/*/versions/*
apiSpec
apiSpecId
string
Required. The ID to use for the spec, which will become the final component of the spec's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\CreateApiSpecRequest;
/**
* @param string $formattedParent The parent, which owns this collection of specs.
* Format: `projects/*/locations/*/apis/*/versions/*`
* Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
* @param string $apiSpecId The ID to use for the spec, which will become the final component of
* the spec's resource name.
*
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*
* Following AIP-162, IDs must not have the form of a UUID.
*/
function create_api_spec_sample(string $formattedParent, string $apiSpecId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiSpec = new ApiSpec();
$request = (new CreateApiSpecRequest())
->setParent($formattedParent)
->setApiSpec($apiSpec)
->setApiSpecId($apiSpecId);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->createApiSpec($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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
$apiSpecId = '[API_SPEC_ID]';
create_api_spec_sample($formattedParent, $apiSpecId);
}
createApiVersion
Creates a specified version.
parent
string
Required. The parent, which owns this collection of versions.
Format: projects/*/locations/*/apis/*
apiVersion
apiVersionId
string
Required. The ID to use for the version, which will become the final component of the version's resource name.
This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\CreateApiVersionRequest;
/**
* @param string $formattedParent The parent, which owns this collection of versions.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
* @param string $apiVersionId The ID to use for the version, which will become the final component of
* the version's resource name.
*
* This value should be 1-63 characters, and valid characters
* are /[a-z][0-9]-/.
*
* Following AIP-162, IDs must not have the form of a UUID.
*/
function create_api_version_sample(string $formattedParent, string $apiVersionId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiVersion = new ApiVersion();
$request = (new CreateApiVersionRequest())
->setParent($formattedParent)
->setApiVersion($apiVersion)
->setApiVersionId($apiVersionId);
// Call the API and handle any network failures.
try {
/** @var ApiVersion $response */
$response = $registryClient->createApiVersion($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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
$apiVersionId = '[API_VERSION_ID]';
create_api_version_sample($formattedParent, $apiVersionId);
}
createArtifact
Creates a specified artifact.
parent
string
Required. The parent, which owns this collection of artifacts.
Format: {parent}
artifact
artifactId
string
Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\CreateArtifactRequest;
/**
* @param string $formattedParent The parent, which owns this collection of artifacts.
* Format: `{parent}`
* Please see {@see RegistryClient::locationName()} for help formatting this field.
* @param string $artifactId The ID to use for the artifact, which will become the final component of
* the artifact's resource name.
*
* This value should be 4-63 characters, and valid characters
* are /[a-z][0-9]-/.
*
* Following AIP-162, IDs must not have the form of a UUID.
*/
function create_artifact_sample(string $formattedParent, string $artifactId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$artifact = new Artifact();
$request = (new CreateArtifactRequest())
->setParent($formattedParent)
->setArtifact($artifact)
->setArtifactId($artifactId);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $registryClient->createArtifact($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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
$artifactId = '[ARTIFACT_ID]';
create_artifact_sample($formattedParent, $artifactId);
}
deleteApi
Removes a specified API and all of the resources that it owns.
name
string
Required. The name of the API to delete.
Format: projects/*/locations/*/apis/*
optionalArgs
array
Optional.
↳ force
bool
If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiRequest;
/**
* @param string $formattedName The name of the API to delete.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
*/
function delete_api_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$registryClient->deleteApi($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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
delete_api_sample($formattedName);
}
deleteApiDeployment
Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).
name
string
Required. The name of the deployment to delete.
Format: projects/*/locations/*/apis/*/deployments/*
optionalArgs
array
Optional.
↳ force
bool
If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiDeploymentRequest;
/**
* @param string $formattedName The name of the deployment to delete.
* Format: `projects/*/locations/*/apis/*/deployments/*`
* Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
*/
function delete_api_deployment_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiDeploymentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$registryClient->deleteApiDeployment($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 = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
delete_api_deployment_sample($formattedName);
}
deleteApiDeploymentRevision
Deletes a revision of a deployment.
name
string
Required. The name of the deployment revision to be deleted, with a revision ID explicitly included.
Example: projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiDeploymentRevisionRequest;
/**
* @param string $formattedName The name of the deployment revision to be deleted,
* with a revision ID explicitly included.
*
* Example:
* `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`
* Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
*/
function delete_api_deployment_revision_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiDeploymentRevisionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->deleteApiDeploymentRevision($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 = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
delete_api_deployment_revision_sample($formattedName);
}
deleteApiSpec
Removes a specified spec, all revisions, and all child resources (e.g., artifacts).
name
string
Required. The name of the spec to delete.
Format: projects/*/locations/*/apis/*/versions/*/specs/*
optionalArgs
array
Optional.
↳ force
bool
If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiSpecRequest;
/**
* @param string $formattedName The name of the spec to delete.
* Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
* Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
*/
function delete_api_spec_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiSpecRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$registryClient->deleteApiSpec($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
delete_api_spec_sample($formattedName);
}
deleteApiSpecRevision
Deletes a revision of a spec.
name
string
Required. The name of the spec revision to be deleted, with a revision ID explicitly included.
Example: projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiSpecRevisionRequest;
/**
* @param string $formattedName The name of the spec revision to be deleted,
* with a revision ID explicitly included.
*
* Example:
* `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8`
* Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
*/
function delete_api_spec_revision_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiSpecRevisionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->deleteApiSpecRevision($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
delete_api_spec_revision_sample($formattedName);
}
deleteApiVersion
Removes a specified version and all of the resources that it owns.
name
string
Required. The name of the version to delete.
Format: projects/*/locations/*/apis/*/versions/*
optionalArgs
array
Optional.
↳ force
bool
If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteApiVersionRequest;
/**
* @param string $formattedName The name of the version to delete.
* Format: `projects/*/locations/*/apis/*/versions/*`
* Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
*/
function delete_api_version_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteApiVersionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$registryClient->deleteApiVersion($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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
delete_api_version_sample($formattedName);
}
deleteArtifact
Removes a specified artifact.
name
string
Required. The name of the artifact to delete.
Format: {parent}/artifacts/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\DeleteArtifactRequest;
/**
* @param string $formattedName The name of the artifact to delete.
* Format: `{parent}/artifacts/*`
* Please see {@see RegistryClient::artifactName()} for help formatting this field.
*/
function delete_artifact_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new DeleteArtifactRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$registryClient->deleteArtifact($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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');
delete_artifact_sample($formattedName);
}
getApi
Returns a specified API.
name
string
Required. The name of the API to retrieve.
Format: projects/*/locations/*/apis/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetApiRequest;
/**
* @param string $formattedName The name of the API to retrieve.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
*/
function get_api_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetApiRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Api $response */
$response = $registryClient->getApi($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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
get_api_sample($formattedName);
}
getApiDeployment
Returns a specified deployment.
name
string
Required. The name of the deployment to retrieve.
Format: projects/*/locations/*/apis/*/deployments/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetApiDeploymentRequest;
/**
* @param string $formattedName The name of the deployment to retrieve.
* Format: `projects/*/locations/*/apis/*/deployments/*`
* Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
*/
function get_api_deployment_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetApiDeploymentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->getApiDeployment($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 = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
get_api_deployment_sample($formattedName);
}
getApiSpec
Returns a specified spec.
name
string
Required. The name of the spec to retrieve.
Format: projects/*/locations/*/apis/*/versions/*/specs/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetApiSpecRequest;
/**
* @param string $formattedName The name of the spec to retrieve.
* Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
* Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
*/
function get_api_spec_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetApiSpecRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->getApiSpec($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
get_api_spec_sample($formattedName);
}
getApiSpecContents
Returns the contents of a specified spec.
If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).
name
string
Required. The name of the spec whose contents should be retrieved.
Format: projects/*/locations/*/apis/*/versions/*/specs/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Api\HttpBody;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetApiSpecContentsRequest;
/**
* @param string $formattedName The name of the spec whose contents should be retrieved.
* Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
* Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
*/
function get_api_spec_contents_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetApiSpecContentsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var HttpBody $response */
$response = $registryClient->getApiSpecContents($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
get_api_spec_contents_sample($formattedName);
}
getApiVersion
Returns a specified version.
name
string
Required. The name of the version to retrieve.
Format: projects/*/locations/*/apis/*/versions/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetApiVersionRequest;
/**
* @param string $formattedName The name of the version to retrieve.
* Format: `projects/*/locations/*/apis/*/versions/*`
* Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
*/
function get_api_version_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetApiVersionRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ApiVersion $response */
$response = $registryClient->getApiVersion($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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
get_api_version_sample($formattedName);
}
getArtifact
Returns a specified artifact.
name
string
Required. The name of the artifact to retrieve.
Format: {parent}/artifacts/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetArtifactRequest;
/**
* @param string $formattedName The name of the artifact to retrieve.
* Format: `{parent}/artifacts/*`
* Please see {@see RegistryClient::artifactName()} for help formatting this field.
*/
function get_artifact_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetArtifactRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $registryClient->getArtifact($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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');
get_artifact_sample($formattedName);
}
getArtifactContents
Returns the contents of a specified artifact.
If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).
name
string
Required. The name of the artifact whose contents should be retrieved.
Format: {parent}/artifacts/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Api\HttpBody;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\GetArtifactContentsRequest;
/**
* @param string $formattedName The name of the artifact whose contents should be retrieved.
* Format: `{parent}/artifacts/*`
* Please see {@see RegistryClient::artifactName()} for help formatting this field.
*/
function get_artifact_contents_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetArtifactContentsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var HttpBody $response */
$response = $registryClient->getArtifactContents($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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');
get_artifact_contents_sample($formattedName);
}
listApiDeploymentRevisions
Lists all revisions of a deployment.
Revisions are returned in descending order of revision creation time.
name
string
Required. The name of the deployment to list revisions for.
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApiDeploymentRevisionsRequest;
/**
* @param string $formattedName The name of the deployment to list revisions for. Please see
* {@see RegistryClient::apiDeploymentName()} for help formatting this field.
*/
function list_api_deployment_revisions_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApiDeploymentRevisionsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApiDeploymentRevisions($request);
/** @var ApiDeployment $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
{
$formattedName = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
list_api_deployment_revisions_sample($formattedName);
}
listApiDeployments
Returns matching deployments.
parent
string
Required. The parent, which owns this collection of deployments.
Format: projects/*/locations/*/apis/*
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ filter
string
An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApiDeploymentsRequest;
/**
* @param string $formattedParent The parent, which owns this collection of deployments.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
*/
function list_api_deployments_sample(string $formattedParent): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApiDeploymentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApiDeployments($request);
/** @var ApiDeployment $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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
list_api_deployments_sample($formattedParent);
}
listApiSpecRevisions
Lists all revisions of a spec.
Revisions are returned in descending order of revision creation time.
name
string
Required. The name of the spec to list revisions for.
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApiSpecRevisionsRequest;
/**
* @param string $formattedName The name of the spec to list revisions for. Please see
* {@see RegistryClient::apiSpecName()} for help formatting this field.
*/
function list_api_spec_revisions_sample(string $formattedName): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApiSpecRevisionsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApiSpecRevisions($request);
/** @var ApiSpec $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
{
$formattedName = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
list_api_spec_revisions_sample($formattedName);
}
listApiSpecs
Returns matching specs.
parent
string
Required. The parent, which owns this collection of specs.
Format: projects/*/locations/*/apis/*/versions/*
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ filter
string
An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields except contents.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApiSpecsRequest;
/**
* @param string $formattedParent The parent, which owns this collection of specs.
* Format: `projects/*/locations/*/apis/*/versions/*`
* Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
*/
function list_api_specs_sample(string $formattedParent): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApiSpecsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApiSpecs($request);
/** @var ApiSpec $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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
list_api_specs_sample($formattedParent);
}
listApiVersions
Returns matching versions.
parent
string
Required. The parent, which owns this collection of versions.
Format: projects/*/locations/*/apis/*
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ filter
string
An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApiVersionsRequest;
/**
* @param string $formattedParent The parent, which owns this collection of versions.
* Format: `projects/*/locations/*/apis/*`
* Please see {@see RegistryClient::apiName()} for help formatting this field.
*/
function list_api_versions_sample(string $formattedParent): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApiVersionsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApiVersions($request);
/** @var ApiVersion $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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
list_api_versions_sample($formattedParent);
}
listApis
Returns matching APIs.
parent
string
Required. The parent, which owns this collection of APIs.
Format: projects/*/locations/*
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ filter
string
An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListApisRequest;
/**
* @param string $formattedParent The parent, which owns this collection of APIs.
* Format: `projects/*/locations/*`
* Please see {@see RegistryClient::locationName()} for help formatting this field.
*/
function list_apis_sample(string $formattedParent): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListApisRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listApis($request);
/** @var Api $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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
list_apis_sample($formattedParent);
}
listArtifacts
Returns matching artifacts.
parent
string
Required. The parent, which owns this collection of artifacts.
Format: {parent}
optionalArgs
array
Optional.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ filter
string
An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields except contents.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ListArtifactsRequest;
/**
* @param string $formattedParent The parent, which owns this collection of artifacts.
* Format: `{parent}`
* Please see {@see RegistryClient::locationName()} for help formatting this field.
*/
function list_artifacts_sample(string $formattedParent): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new ListArtifactsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->listArtifacts($request);
/** @var Artifact $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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
list_artifacts_sample($formattedParent);
}
replaceArtifact
Used to replace a specified artifact.
artifact
Google\Cloud\ApigeeRegistry\V1\Artifact
Required. The artifact to replace.
The name
field is used to identify the artifact to replace.
Format: {parent}/artifacts/*
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\ReplaceArtifactRequest;
/**
* 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 replace_artifact_sample(): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$artifact = new Artifact();
$request = (new ReplaceArtifactRequest())
->setArtifact($artifact);
// Call the API and handle any network failures.
try {
/** @var Artifact $response */
$response = $registryClient->replaceArtifact($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
rollbackApiDeployment
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.
name
string
Required. The deployment being rolled back.
revisionId
string
Required. The revision ID to roll back to. It must be a revision of the same deployment.
Example: c7cfa2a8
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\RollbackApiDeploymentRequest;
/**
* @param string $formattedName The deployment being rolled back. Please see
* {@see RegistryClient::apiDeploymentName()} for help formatting this field.
* @param string $revisionId The revision ID to roll back to.
* It must be a revision of the same deployment.
*
* Example: `c7cfa2a8`
*/
function rollback_api_deployment_sample(string $formattedName, string $revisionId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new RollbackApiDeploymentRequest())
->setName($formattedName)
->setRevisionId($revisionId);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->rollbackApiDeployment($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 = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
$revisionId = '[REVISION_ID]';
rollback_api_deployment_sample($formattedName, $revisionId);
}
rollbackApiSpec
Sets the current revision to a specified prior revision.
Note that this creates a new revision with a new revision ID.
name
string
Required. The spec being rolled back.
revisionId
string
Required. The revision ID to roll back to. It must be a revision of the same spec.
Example: c7cfa2a8
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\RollbackApiSpecRequest;
/**
* @param string $formattedName The spec being rolled back. Please see
* {@see RegistryClient::apiSpecName()} for help formatting this field.
* @param string $revisionId The revision ID to roll back to.
* It must be a revision of the same spec.
*
* Example: `c7cfa2a8`
*/
function rollback_api_spec_sample(string $formattedName, string $revisionId): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new RollbackApiSpecRequest())
->setName($formattedName)
->setRevisionId($revisionId);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->rollbackApiSpec($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
$revisionId = '[REVISION_ID]';
rollback_api_spec_sample($formattedName, $revisionId);
}
tagApiDeploymentRevision
Adds a tag to a specified revision of a deployment.
name
string
Required. The name of the deployment to be tagged, including the revision ID.
tag
string
Required. The tag to apply.
The tag should be at most 40 characters, and match [a-z][a-z0-9-]{3,39}
.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\TagApiDeploymentRevisionRequest;
/**
* @param string $formattedName The name of the deployment to be tagged, including the revision ID. Please see
* {@see RegistryClient::apiDeploymentName()} for help formatting this field.
* @param string $tag The tag to apply.
* The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
*/
function tag_api_deployment_revision_sample(string $formattedName, string $tag): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new TagApiDeploymentRevisionRequest())
->setName($formattedName)
->setTag($tag);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->tagApiDeploymentRevision($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 = RegistryClient::apiDeploymentName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[DEPLOYMENT]'
);
$tag = '[TAG]';
tag_api_deployment_revision_sample($formattedName, $tag);
}
tagApiSpecRevision
Adds a tag to a specified revision of a spec.
name
string
Required. The name of the spec to be tagged, including the revision ID.
tag
string
Required. The tag to apply.
The tag should be at most 40 characters, and match [a-z][a-z0-9-]{3,39}
.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\TagApiSpecRevisionRequest;
/**
* @param string $formattedName The name of the spec to be tagged, including the revision ID. Please see
* {@see RegistryClient::apiSpecName()} for help formatting this field.
* @param string $tag The tag to apply.
* The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
*/
function tag_api_spec_revision_sample(string $formattedName, string $tag): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new TagApiSpecRevisionRequest())
->setName($formattedName)
->setTag($tag);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->tagApiSpecRevision($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 = RegistryClient::apiSpecName(
'[PROJECT]',
'[LOCATION]',
'[API]',
'[VERSION]',
'[SPEC]'
);
$tag = '[TAG]';
tag_api_spec_revision_sample($formattedName, $tag);
}
updateApi
Used to modify a specified API.
api
Google\Cloud\ApigeeRegistry\V1\Api
Required. The API to update.
The name
field is used to identify the API to update.
Format: projects/*/locations/*/apis/*
optionalArgs
array
Optional.
↳ updateMask
FieldMask
The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.
↳ allowMissing
bool
If set to true, and the API is not found, a new API will be created. In this situation, update_mask
is ignored.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\UpdateApiRequest;
/**
* 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_api_sample(): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$api = new Api();
$request = (new UpdateApiRequest())
->setApi($api);
// Call the API and handle any network failures.
try {
/** @var Api $response */
$response = $registryClient->updateApi($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateApiDeployment
Used to modify a specified deployment.
apiDeployment
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Required. The deployment to update.
The name
field is used to identify the deployment to update.
Format: projects/*/locations/*/apis/*/deployments/*
optionalArgs
array
Optional.
↳ updateMask
FieldMask
The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.
↳ allowMissing
bool
If set to true, and the deployment is not found, a new deployment will be created. In this situation, update_mask
is ignored.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\UpdateApiDeploymentRequest;
/**
* 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_api_deployment_sample(): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiDeployment = new ApiDeployment();
$request = (new UpdateApiDeploymentRequest())
->setApiDeployment($apiDeployment);
// Call the API and handle any network failures.
try {
/** @var ApiDeployment $response */
$response = $registryClient->updateApiDeployment($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateApiSpec
Used to modify a specified spec.
apiSpec
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Required. The spec to update.
The name
field is used to identify the spec to update.
Format: projects/*/locations/*/apis/*/versions/*/specs/*
optionalArgs
array
Optional.
↳ updateMask
FieldMask
The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.
↳ allowMissing
bool
If set to true, and the spec is not found, a new spec will be created. In this situation, update_mask
is ignored.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\UpdateApiSpecRequest;
/**
* 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_api_spec_sample(): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiSpec = new ApiSpec();
$request = (new UpdateApiSpecRequest())
->setApiSpec($apiSpec);
// Call the API and handle any network failures.
try {
/** @var ApiSpec $response */
$response = $registryClient->updateApiSpec($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateApiVersion
Used to modify a specified version.
apiVersion
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Required. The version to update.
The name
field is used to identify the version to update.
Format: projects/*/locations/*/apis/*/versions/*
optionalArgs
array
Optional.
↳ updateMask
FieldMask
The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.
↳ allowMissing
bool
If set to true, and the version is not found, a new version will be created. In this situation, update_mask
is ignored.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
use Google\Cloud\ApigeeRegistry\V1\UpdateApiVersionRequest;
/**
* 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_api_version_sample(): void
{
// Create a client.
$registryClient = new RegistryClient();
// Prepare the request message.
$apiVersion = new ApiVersion();
$request = (new UpdateApiVersionRequest())
->setApiVersion($apiVersion);
// Call the API and handle any network failures.
try {
/** @var ApiVersion $response */
$response = $registryClient->updateApiVersion($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getLocation
Gets information about a location.
optionalArgs
array
Optional.
↳ name
string
Resource name for the location.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
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.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $registryClient->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.
optionalArgs
array
Optional.
↳ name
string
The resource that owns the locations collection, if applicable.
↳ filter
string
The standard list filter.
↳ pageSize
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.
↳ pageToken
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
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.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $registryClient->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.
resource
string
REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
optionalArgs
array
Optional.
↳ options
GetPolicyOptions
OPTIONAL: A GetPolicyOptions
object for specifying options to GetIamPolicy
.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
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.
$registryClient = new RegistryClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $registryClient->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.
resource
string
REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
policy
Google\Cloud\Iam\V1\Policy
REQUIRED: The complete policy to be applied to the resource
. The size of
the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
might reject them.
optionalArgs
array
Optional.
↳ updateMask
FieldMask
OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: paths: "bindings, etag"
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
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.
$registryClient = new RegistryClient();
// 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 = $registryClient->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.
resource
string
REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
permissions
string[]
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
.
optionalArgs
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\RegistryClient;
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.
$registryClient = new RegistryClient();
// 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 = $registryClient->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);
}
static::apiName
Formats a string containing the fully-qualified path to represent a api resource.
project
string
location
string
api
string
string
static::apiDeploymentName
Formats a string containing the fully-qualified path to represent a api_deployment resource.
project
string
location
string
api
string
deployment
string
string
static::apiSpecName
Formats a string containing the fully-qualified path to represent a api_spec resource.
project
string
location
string
api
string
version
string
spec
string
string
static::apiVersionName
Formats a string containing the fully-qualified path to represent a api_version resource.
project
string
location
string
api
string
version
string
string
static::artifactName
Formats a string containing the fully-qualified path to represent a artifact resource.
project
string
location
string
artifact
string
string
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
project
string
location
string
string
static::projectLocationApiArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_artifact resource.
project
string
location
string
api
string
artifact
string
string
static::projectLocationApiDeploymentArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_deployment_artifact resource.
project
string
location
string
api
string
deployment
string
artifact
string
string
static::projectLocationApiVersionArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_version_artifact resource.
project
string
location
string
api
string
version
string
artifact
string
string
static::projectLocationApiVersionSpecArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_version_spec_artifact resource.
project
string
location
string
api
string
version
string
spec
string
artifact
string
string
static::projectLocationArtifactName
Formats a string containing the fully-qualified path to represent a project_location_artifact resource.
project
string
location
string
artifact
string
string
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
- api: projects/{project}/locations/{location}/apis/{api}
- apiDeployment: projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}
- apiSpec: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
- apiVersion: projects/{project}/locations/{location}/apis/{api}/versions/{version}
- artifact: projects/{project}/locations/{location}/artifacts/{artifact}
- location: projects/{project}/locations/{location}
- projectLocationApiArtifact: projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}
- projectLocationApiDeploymentArtifact: projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}
- projectLocationApiVersionArtifact: projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}
- projectLocationApiVersionSpecArtifact: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}
- projectLocationArtifact: projects/{project}/locations/{location}/artifacts/{artifact}
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.
formattedName
string
The formatted name string
template
string
Optional name of template to match
array
Constants
SERVICE_NAME
Value: 'google.cloud.apigeeregistry.v1.Registry'
The name of the service.
SERVICE_ADDRESS
Value: 'apigeeregistry.googleapis.com'
The default address of the service.
DEFAULT_SERVICE_PORT
Value: 443
The default port of the service.
CODEGEN_NAME
Value: 'gapic'
The name of the code generator, to be included in the agent header.