Reference documentation and code samples for the Google Certificate Authority Service V1 Client class CertificateAuthorityServiceClient.
Service Description: Certificate Authority Service manages private certificate authorities and issued certificates.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ Security \ PrivateCA \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
activateCertificateAuthority
Activate a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE.
After the parent Certificate Authority signs a certificate signing request from FetchCertificateAuthorityCsr, this method can complete the activation process.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::activateCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\SubordinateConfig;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
* @param string $pemCaCertificate The signed CA certificate issued from
* [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr].
* @param string $formattedSubordinateConfigCertificateAuthority This can refer to a
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* that was used to create a subordinate
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
* This field is used for information and usability purposes only. The
* resource name is in the format
* `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function activate_certificate_authority_sample(
string $formattedName,
string $pemCaCertificate,
string $formattedSubordinateConfigCertificateAuthority
): void {
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$subordinateConfig = (new SubordinateConfig())
->setCertificateAuthority($formattedSubordinateConfigCertificateAuthority);
$request = (new ActivateCertificateAuthorityRequest())
->setName($formattedName)
->setPemCaCertificate($pemCaCertificate)
->setSubordinateConfig($subordinateConfig);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->activateCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
$pemCaCertificate = '[PEM_CA_CERTIFICATE]';
$formattedSubordinateConfigCertificateAuthority = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
activate_certificate_authority_sample(
$formattedName,
$pemCaCertificate,
$formattedSubordinateConfigCertificateAuthority
);
}
createCaPool
Create a CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::createCaPoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\CaPool\Tier;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the location associated with the
* [CaPool][google.cloud.security.privateca.v1.CaPool], in the format
* `projects/*/locations/*`. Please see
* {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
* @param string $caPoolId It must be unique within a location and match the regular
* expression `[a-zA-Z0-9_-]{1,63}`
* @param int $caPoolTier Immutable. The
* [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this
* [CaPool][google.cloud.security.privateca.v1.CaPool].
*/
function create_ca_pool_sample(string $formattedParent, string $caPoolId, int $caPoolTier): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$caPool = (new CaPool())
->setTier($caPoolTier);
$request = (new CreateCaPoolRequest())
->setParent($formattedParent)
->setCaPoolId($caPoolId)
->setCaPool($caPool);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->createCaPool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CaPool $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
$caPoolId = '[CA_POOL_ID]';
$caPoolTier = Tier::TIER_UNSPECIFIED;
create_ca_pool_sample($formattedParent, $caPoolId, $caPoolTier);
}
createCertificate
Create a new Certificate in a given Project, Location from a particular CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::createCertificateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\Certificate |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest;
use Google\Protobuf\Duration;
/**
* @param string $formattedParent The resource name of the
* [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
* [Certificate][google.cloud.security.privateca.v1.Certificate], in the
* format `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function create_certificate_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateLifetime = new Duration();
$certificate = (new Certificate())
->setLifetime($certificateLifetime);
$request = (new CreateCertificateRequest())
->setParent($formattedParent)
->setCertificate($certificate);
// Call the API and handle any network failures.
try {
/** @var Certificate $response */
$response = $certificateAuthorityServiceClient->createCertificate($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 = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
create_certificate_sample($formattedParent);
}
createCertificateAuthority
Create a new CertificateAuthority in a given Project and Location.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::createCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\KeyVersionSpec;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\Type;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig\SubjectConfig;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\Subject;
use Google\Cloud\Security\PrivateCA\V1\X509Parameters;
use Google\Protobuf\Duration;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the
* [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
* [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
* in the format `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
* @param string $certificateAuthorityId It must be unique within a location and match the regular
* expression `[a-zA-Z0-9_-]{1,63}`
* @param int $certificateAuthorityType Immutable. The
* [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of
* this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
*/
function create_certificate_authority_sample(
string $formattedParent,
string $certificateAuthorityId,
int $certificateAuthorityType
): void {
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateAuthorityConfigSubjectConfigSubject = new Subject();
$certificateAuthorityConfigSubjectConfig = (new SubjectConfig())
->setSubject($certificateAuthorityConfigSubjectConfigSubject);
$certificateAuthorityConfigX509Config = new X509Parameters();
$certificateAuthorityConfig = (new CertificateConfig())
->setSubjectConfig($certificateAuthorityConfigSubjectConfig)
->setX509Config($certificateAuthorityConfigX509Config);
$certificateAuthorityLifetime = new Duration();
$certificateAuthorityKeySpec = new KeyVersionSpec();
$certificateAuthority = (new CertificateAuthority())
->setType($certificateAuthorityType)
->setConfig($certificateAuthorityConfig)
->setLifetime($certificateAuthorityLifetime)
->setKeySpec($certificateAuthorityKeySpec);
$request = (new CreateCertificateAuthorityRequest())
->setParent($formattedParent)
->setCertificateAuthorityId($certificateAuthorityId)
->setCertificateAuthority($certificateAuthority);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->createCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
$certificateAuthorityId = '[CERTIFICATE_AUTHORITY_ID]';
$certificateAuthorityType = Type::TYPE_UNSPECIFIED;
create_certificate_authority_sample(
$formattedParent,
$certificateAuthorityId,
$certificateAuthorityType
);
}
createCertificateTemplate
Create a new CertificateTemplate in a given Project and Location.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::createCertificateTemplateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the location associated with the
* [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate],
* in the format `projects/*/locations/*`. Please see
* {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
* @param string $certificateTemplateId It must be unique within a location and match the regular
* expression `[a-zA-Z0-9_-]{1,63}`
*/
function create_certificate_template_sample(
string $formattedParent,
string $certificateTemplateId
): void {
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateTemplate = new CertificateTemplate();
$request = (new CreateCertificateTemplateRequest())
->setParent($formattedParent)
->setCertificateTemplateId($certificateTemplateId)
->setCertificateTemplate($certificateTemplate);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->createCertificateTemplate($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateTemplate $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
$certificateTemplateId = '[CERTIFICATE_TEMPLATE_ID]';
create_certificate_template_sample($formattedParent, $certificateTemplateId);
}
deleteCaPool
Delete a CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::deleteCaPoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
* `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function delete_ca_pool_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new DeleteCaPoolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->deleteCaPool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
delete_ca_pool_sample($formattedName);
}
deleteCertificateAuthority
Delete a CertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::deleteCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function delete_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new DeleteCertificateAuthorityRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->deleteCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
delete_certificate_authority_sample($formattedName);
}
deleteCertificateTemplate
DeleteCertificateTemplate deletes a CertificateTemplate.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::deleteCertificateTemplateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
* in the format `projects/*/locations/*/certificateTemplates/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateTemplateName()} for help formatting this field.
*/
function delete_certificate_template_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new DeleteCertificateTemplateRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->deleteCertificateTemplate($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateTemplateName(
'[PROJECT]',
'[LOCATION]',
'[CERTIFICATE_TEMPLATE]'
);
delete_certificate_template_sample($formattedName);
}
disableCertificateAuthority
Disable a CertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::disableCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function disable_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new DisableCertificateAuthorityRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->disableCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
disable_certificate_authority_sample($formattedName);
}
enableCertificateAuthority
Enable a CertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::enableCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function enable_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new EnableCertificateAuthorityRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->enableCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
enable_certificate_authority_sample($formattedName);
}
fetchCaCerts
FetchCaCerts returns the current trust anchor for the CaPool. This will include CA certificate chains for all ACTIVE CertificateAuthority resources in the CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::fetchCaCertsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\FetchCaCertsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest;
use Google\Cloud\Security\PrivateCA\V1\FetchCaCertsResponse;
/**
* @param string $formattedCaPool The resource name for the
* [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
* `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function fetch_ca_certs_sample(string $formattedCaPool): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new FetchCaCertsRequest())
->setCaPool($formattedCaPool);
// Call the API and handle any network failures.
try {
/** @var FetchCaCertsResponse $response */
$response = $certificateAuthorityServiceClient->fetchCaCerts($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
{
$formattedCaPool = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
fetch_ca_certs_sample($formattedCaPool);
}
fetchCertificateAuthorityCsr
Fetch a certificate signing request (CSR) from a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE.
The CSR must then be signed by the desired parent Certificate Authority, which could be another CertificateAuthority resource, or could be an on-prem certificate authority. See also ActivateCertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::fetchCertificateAuthorityCsrAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest;
use Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrResponse;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function fetch_certificate_authority_csr_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new FetchCertificateAuthorityCsrRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var FetchCertificateAuthorityCsrResponse $response */
$response = $certificateAuthorityServiceClient->fetchCertificateAuthorityCsr($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 = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
fetch_certificate_authority_csr_sample($formattedName);
}
getCaPool
Returns a CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getCaPoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\CaPool |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest;
/**
* @param string $formattedName The [name][google.cloud.security.privateca.v1.CaPool.name] of the
* [CaPool][google.cloud.security.privateca.v1.CaPool] to get. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function get_ca_pool_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetCaPoolRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var CaPool $response */
$response = $certificateAuthorityServiceClient->getCaPool($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 = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
get_ca_pool_sample($formattedName);
}
getCertificate
Returns a Certificate.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getCertificateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\Certificate |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest;
/**
* @param string $formattedName The [name][google.cloud.security.privateca.v1.Certificate.name]
* of the [Certificate][google.cloud.security.privateca.v1.Certificate] to
* get. Please see
* {@see CertificateAuthorityServiceClient::certificateName()} for help formatting this field.
*/
function get_certificate_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetCertificateRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Certificate $response */
$response = $certificateAuthorityServiceClient->getCertificate($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 = CertificateAuthorityServiceClient::certificateName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE]'
);
get_certificate_sample($formattedName);
}
getCertificateAuthority
Returns a CertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\CertificateAuthority |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest;
/**
* @param string $formattedName The
* [name][google.cloud.security.privateca.v1.CertificateAuthority.name] of the
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* to get. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function get_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetCertificateAuthorityRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var CertificateAuthority $response */
$response = $certificateAuthorityServiceClient->getCertificateAuthority($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 = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
get_certificate_authority_sample($formattedName);
}
getCertificateRevocationList
Returns a CertificateRevocationList.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getCertificateRevocationListAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest;
/**
* @param string $formattedName The
* [name][google.cloud.security.privateca.v1.CertificateRevocationList.name]
* of the
* [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
* to get. Please see
* {@see CertificateAuthorityServiceClient::certificateRevocationListName()} for help formatting this field.
*/
function get_certificate_revocation_list_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetCertificateRevocationListRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var CertificateRevocationList $response */
$response = $certificateAuthorityServiceClient->getCertificateRevocationList($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 = CertificateAuthorityServiceClient::certificateRevocationListName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]',
'[CERTIFICATE_REVOCATION_LIST]'
);
get_certificate_revocation_list_sample($formattedName);
}
getCertificateTemplate
Returns a CertificateTemplate.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getCertificateTemplateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\CertificateTemplate |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest;
/**
* @param string $formattedName The
* [name][google.cloud.security.privateca.v1.CertificateTemplate.name] of the
* [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
* to get. Please see
* {@see CertificateAuthorityServiceClient::certificateTemplateName()} for help formatting this field.
*/
function get_certificate_template_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetCertificateTemplateRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var CertificateTemplate $response */
$response = $certificateAuthorityServiceClient->getCertificateTemplate($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 = CertificateAuthorityServiceClient::certificateTemplateName(
'[PROJECT]',
'[LOCATION]',
'[CERTIFICATE_TEMPLATE]'
);
get_certificate_template_sample($formattedName);
}
listCaPools
Lists CaPools.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listCaPoolsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest;
/**
* @param string $formattedParent The resource name of the location associated with the
* [CaPools][google.cloud.security.privateca.v1.CaPool], in the format
* `projects/*/locations/*`. Please see
* {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
*/
function list_ca_pools_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new ListCaPoolsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listCaPools($request);
/** @var CaPool $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 = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_ca_pools_sample($formattedParent);
}
listCertificateAuthorities
Lists CertificateAuthorities.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listCertificateAuthoritiesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest;
/**
* @param string $formattedParent The resource name of the
* [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
* [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
* in the format `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function list_certificate_authorities_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new ListCertificateAuthoritiesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listCertificateAuthorities($request);
/** @var CertificateAuthority $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 = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
list_certificate_authorities_sample($formattedParent);
}
listCertificateRevocationLists
Lists CertificateRevocationLists.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listCertificateRevocationListsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest;
/**
* @param string $formattedParent The resource name of the location associated with the
* [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList],
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function list_certificate_revocation_lists_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new ListCertificateRevocationListsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listCertificateRevocationLists($request);
/** @var CertificateRevocationList $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 = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
list_certificate_revocation_lists_sample($formattedParent);
}
listCertificateTemplates
Lists CertificateTemplates.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listCertificateTemplatesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest;
/**
* @param string $formattedParent The resource name of the location associated with the
* [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate],
* in the format `projects/*/locations/*`. Please see
* {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
*/
function list_certificate_templates_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new ListCertificateTemplatesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listCertificateTemplates($request);
/** @var CertificateTemplate $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 = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_certificate_templates_sample($formattedParent);
}
listCertificates
Lists Certificates.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listCertificatesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest;
/**
* @param string $formattedParent The resource name of the location associated with the
* [Certificates][google.cloud.security.privateca.v1.Certificate], in the
* format `projects/*/locations/*/caPools/*`. Please see
* {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
*/
function list_certificates_sample(string $formattedParent): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new ListCertificatesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listCertificates($request);
/** @var Certificate $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 = CertificateAuthorityServiceClient::caPoolName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]'
);
list_certificates_sample($formattedParent);
}
revokeCertificate
Revoke a Certificate.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::revokeCertificateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\Certificate |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\RevocationReason;
use Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest;
/**
* @param string $formattedName The resource name for this
* [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
* `projects/*/locations/*/caPools/*/certificates/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateName()} for help formatting this field.
* @param int $reason The
* [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] for
* revoking this certificate.
*/
function revoke_certificate_sample(string $formattedName, int $reason): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new RevokeCertificateRequest())
->setName($formattedName)
->setReason($reason);
// Call the API and handle any network failures.
try {
/** @var Certificate $response */
$response = $certificateAuthorityServiceClient->revokeCertificate($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 = CertificateAuthorityServiceClient::certificateName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE]'
);
$reason = RevocationReason::REVOCATION_REASON_UNSPECIFIED;
revoke_certificate_sample($formattedName, $reason);
}
undeleteCertificateAuthority
Undelete a CertificateAuthority that has been deleted.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::undeleteCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name for this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
* in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
* {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
*/
function undelete_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new UndeleteCertificateAuthorityRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->undeleteCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
'[PROJECT]',
'[LOCATION]',
'[CA_POOL]',
'[CERTIFICATE_AUTHORITY]'
);
undelete_certificate_authority_sample($formattedName);
}
updateCaPool
Update a CaPool.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCaPoolAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\CaPool\Tier;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param int $caPoolTier Immutable. The
* [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this
* [CaPool][google.cloud.security.privateca.v1.CaPool].
*/
function update_ca_pool_sample(int $caPoolTier): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$caPool = (new CaPool())
->setTier($caPoolTier);
$updateMask = new FieldMask();
$request = (new UpdateCaPoolRequest())
->setCaPool($caPool)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->updateCaPool($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CaPool $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$caPoolTier = Tier::TIER_UNSPECIFIED;
update_ca_pool_sample($caPoolTier);
}
updateCertificate
Update a Certificate.
Currently, the only field you can update is the labels field.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCertificateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Security\PrivateCA\V1\Certificate |
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest;
use Google\Protobuf\Duration;
use Google\Protobuf\FieldMask;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_certificate_sample(): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateLifetime = new Duration();
$certificate = (new Certificate())
->setLifetime($certificateLifetime);
$updateMask = new FieldMask();
$request = (new UpdateCertificateRequest())
->setCertificate($certificate)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var Certificate $response */
$response = $certificateAuthorityServiceClient->updateCertificate($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateCertificateAuthority
Update a CertificateAuthority.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCertificateAuthorityAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\KeyVersionSpec;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\Type;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig\SubjectConfig;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\Subject;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\X509Parameters;
use Google\Protobuf\Duration;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param int $certificateAuthorityType Immutable. The
* [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of
* this
* [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
*/
function update_certificate_authority_sample(int $certificateAuthorityType): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateAuthorityConfigSubjectConfigSubject = new Subject();
$certificateAuthorityConfigSubjectConfig = (new SubjectConfig())
->setSubject($certificateAuthorityConfigSubjectConfigSubject);
$certificateAuthorityConfigX509Config = new X509Parameters();
$certificateAuthorityConfig = (new CertificateConfig())
->setSubjectConfig($certificateAuthorityConfigSubjectConfig)
->setX509Config($certificateAuthorityConfigX509Config);
$certificateAuthorityLifetime = new Duration();
$certificateAuthorityKeySpec = new KeyVersionSpec();
$certificateAuthority = (new CertificateAuthority())
->setType($certificateAuthorityType)
->setConfig($certificateAuthorityConfig)
->setLifetime($certificateAuthorityLifetime)
->setKeySpec($certificateAuthorityKeySpec);
$updateMask = new FieldMask();
$request = (new UpdateCertificateAuthorityRequest())
->setCertificateAuthority($certificateAuthority)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->updateCertificateAuthority($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateAuthority $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$certificateAuthorityType = Type::TYPE_UNSPECIFIED;
update_certificate_authority_sample($certificateAuthorityType);
}
updateCertificateRevocationList
Update a CertificateRevocationList.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCertificateRevocationListAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_certificate_revocation_list_sample(): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateRevocationList = new CertificateRevocationList();
$updateMask = new FieldMask();
$request = (new UpdateCertificateRevocationListRequest())
->setCertificateRevocationList($certificateRevocationList)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->updateCertificateRevocationList($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateRevocationList $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateCertificateTemplate
Update a CertificateTemplate.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCertificateTemplateAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_certificate_template_sample(): void
{
// Create a client.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$certificateTemplate = new CertificateTemplate();
$updateMask = new FieldMask();
$request = (new UpdateCertificateTemplateRequest())
->setCertificateTemplate($certificateTemplate)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $certificateAuthorityServiceClient->updateCertificateTemplate($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var CertificateTemplate $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getLocation
Gets information about a location.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getLocationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
/**
* 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.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $certificateAuthorityServiceClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listLocationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
/**
* 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.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $certificateAuthorityServiceClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getIamPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
/**
* @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.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $certificateAuthorityServiceClient->getIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
get_iam_policy_sample($resource);
}
setIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::setIamPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
/**
* @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.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// 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 = $certificateAuthorityServiceClient->setIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
set_iam_policy_sample($resource);
}
testIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND
error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::testIamPermissionsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
/**
* @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.
$certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();
// 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 = $certificateAuthorityServiceClient->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);
}
activateCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createCaPoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createCertificateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createCertificateTemplateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteCaPoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteCertificateTemplateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
disableCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
enableCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
fetchCaCertsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
fetchCertificateAuthorityCsrAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCaPoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCertificateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCertificateRevocationListAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCertificateTemplateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCaPoolsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCertificateAuthoritiesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCertificateRevocationListsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCertificateTemplatesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCertificatesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
revokeCertificateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
undeleteCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCaPoolAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCertificateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCertificateAuthorityAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCertificateRevocationListAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCertificateTemplateAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getLocationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listLocationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getIamPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
setIamPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
testIamPermissionsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\ApiCore\LongRunning\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::caPoolName
Formats a string containing the fully-qualified path to represent a ca_pool resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
caPool |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted ca_pool resource. |
static::certificateName
Formats a string containing the fully-qualified path to represent a certificate resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
caPool |
string
|
certificate |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted certificate resource. |
static::certificateAuthorityName
Formats a string containing the fully-qualified path to represent a certificate_authority resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
caPool |
string
|
certificateAuthority |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted certificate_authority resource. |
static::certificateRevocationListName
Formats a string containing the fully-qualified path to represent a certificate_revocation_list resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
caPool |
string
|
certificateAuthority |
string
|
certificateRevocationList |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted certificate_revocation_list resource. |
static::certificateTemplateName
Formats a string containing the fully-qualified path to represent a certificate_template resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
certificateTemplate |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted certificate_template 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::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
- caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
- certificate: projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}
- certificateAuthority: projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}
- certificateRevocationList: projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}
- certificateTemplate: projects/{project}/locations/{location}/certificateTemplates/{certificate_template}
- location: projects/{project}/locations/{location}
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. |