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.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
createApi
Creates a specified API.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of APIs.
Format: |
api |
Google\Cloud\ApigeeRegistry\V1\Api
Required. The API to create. |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Api |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of deployments.
Format: |
apiDeployment |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Required. The deployment to create. |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of specs.
Format: |
apiSpec |
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Required. The spec to create. |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of versions.
Format: |
apiVersion |
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Required. The version to create. |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiVersion |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of artifacts.
Format: |
artifact |
Google\Cloud\ApigeeRegistry\V1\Artifact
Required. The artifact to create. |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Artifact |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the API to delete.
Format: |
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).
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the deployment to delete.
Format: |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the deployment revision to be deleted, with a revision ID explicitly included. Example:
|
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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).
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the spec to delete.
Format: |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the spec revision to be deleted, with a revision ID explicitly included. Example:
|
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the version to delete.
Format: |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the artifact to delete.
Format: |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the API to retrieve.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Api |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the deployment to retrieve.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the spec to retrieve.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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).
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the spec whose contents should be retrieved.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Api\HttpBody |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the version to retrieve.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiVersion |
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.
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the artifact to retrieve.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Artifact |
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).
Parameters | |
---|---|
Name | Description |
name |
string
Required. The name of the artifact whose contents should be retrieved.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\Api\HttpBody |
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.
Parameters | |
---|---|
Name | Description |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of deployments.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of specs.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of versions.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of APIs.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The parent, which owns this collection of artifacts.
Format: |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
artifact |
Google\Cloud\ApigeeRegistry\V1\Artifact
Required. The artifact to replace. The |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Artifact |
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.
Parameters | |
---|---|
Name | Description |
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: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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.
Parameters | |
---|---|
Name | Description |
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: |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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.
Parameters | |
---|---|
Name | Description |
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 |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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.
Parameters | |
---|---|
Name | Description |
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 |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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.
Parameters | |
---|---|
Name | Description |
api |
Google\Cloud\ApigeeRegistry\V1\Api
Required. The API to update. The |
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, |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\Api |
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.
Parameters | |
---|---|
Name | Description |
apiDeployment |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Required. The deployment to update. The |
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, |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiDeployment |
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.
Parameters | |
---|---|
Name | Description |
apiSpec |
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Required. The spec to update. The |
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, |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiSpec |
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.
Parameters | |
---|---|
Name | Description |
apiVersion |
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Required. The version to update. The |
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, |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\ApigeeRegistry\V1\ApiVersion |
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.
Parameters | |
---|---|
Name | Description |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
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.
Parameters | |
---|---|
Name | Description |
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. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
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.
Parameters | |
---|---|
Name | Description |
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 |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
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.
Parameters | |
---|---|
Name | Description |
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 |
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: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
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.
Parameters | |
---|---|
Name | Description |
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 |
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. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
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.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted api resource. |
static::apiDeploymentName
Formats a string containing the fully-qualified path to represent a api_deployment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
deployment |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted api_deployment resource. |
static::apiSpecName
Formats a string containing the fully-qualified path to represent a api_spec resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
version |
string
|
spec |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted api_spec resource. |
static::apiVersionName
Formats a string containing the fully-qualified path to represent a api_version resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
version |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted api_version resource. |
static::artifactName
Formats a string containing the fully-qualified path to represent a artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted artifact resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted location resource. |
static::projectLocationApiArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_location_api_artifact resource. |
static::projectLocationApiDeploymentArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_deployment_artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
deployment |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_location_api_deployment_artifact resource. |
static::projectLocationApiVersionArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_version_artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
version |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_location_api_version_artifact resource. |
static::projectLocationApiVersionSpecArtifactName
Formats a string containing the fully-qualified path to represent a project_location_api_version_spec_artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
api |
string
|
version |
string
|
spec |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_location_api_version_spec_artifact resource. |
static::projectLocationArtifactName
Formats a string containing the fully-qualified path to represent a project_location_artifact resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
artifact |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_location_artifact resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- 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.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array | An associative array from name component IDs to component values. |
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.