Reference documentation and code samples for the Google Cloud Dataplex V1 Client class CatalogServiceClient.
Service Description: The primary resources offered by this service are EntryGroups, EntryTypes, AspectTypes, and Entries. They collectively let data administrators organize, manage, secure, and catalog data located across cloud projects in their organization in a variety of storage systems, including Cloud Storage and BigQuery.
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 \ Dataplex \ V1 \ ClientMethods
__construct
Constructor.
options
array
Optional. Options for configuring the service API wrapper.
↳ apiEndpoint
string
The address of the API remote host. May optionally include the port, formatted as "
↳ credentials
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage : In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important : If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
↳ credentialsConfig
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
↳ disableRetries
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false
.
↳ clientConfig
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
↳ transport
string|TransportInterface
The transport used for executing network requests. May be either the string rest
or grpc
. Defaults to grpc
if gRPC support is detected on the system. Advanced usage
: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface
object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
↳ transportConfig
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
↳ clientCertSource
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
↳ logger
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag
cancelMetadataJob
Cancels a metadata job.
If you cancel a metadata import job that is in progress, the changes in the job might be partially applied. We recommend that you reset the state of the entry groups in your project by running another metadata job that reverts the changes from the canceled job.
The async variant is CatalogServiceClient::cancelMetadataJobAsync() .
request
Google\Cloud\Dataplex\V1\CancelMetadataJobRequest
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\CancelMetadataJobRequest;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
/**
* @param string $formattedName The resource name of the job, in the format
* `projects/{project_id_or_number}/locations/{location_id}/metadataJobs/{metadata_job_id}`
* Please see {@see CatalogServiceClient::metadataJobName()} for help formatting this field.
*/
function cancel_metadata_job_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new CancelMetadataJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$catalogServiceClient->cancelMetadataJob($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CatalogServiceClient::metadataJobName('[PROJECT]', '[LOCATION]', '[METADATAJOB]');
cancel_metadata_job_sample($formattedName);
}
createAspectType
Creates an AspectType.
The async variant is CatalogServiceClient::createAspectTypeAsync() .
request
Google\Cloud\Dataplex\V1\CreateAspectTypeRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\AspectType;
use Google\Cloud\Dataplex\V1\AspectType\MetadataTemplate;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\CreateAspectTypeRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the AspectType, of the form:
* projects/{project_number}/locations/{location_id}
* where `location_id` refers to a Google Cloud region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
* @param string $aspectTypeId AspectType identifier.
* @param string $aspectTypeMetadataTemplateName The name of the field.
* @param string $aspectTypeMetadataTemplateType The datatype of this field. The following values are supported:
*
* Primitive types:
*
* * string
* * integer
* * boolean
* * double
* * datetime. Must be of the format RFC3339 UTC "Zulu" (Examples:
* "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z").
*
* Complex types:
*
* * enum
* * array
* * map
* * record
*/
function create_aspect_type_sample(
string $formattedParent,
string $aspectTypeId,
string $aspectTypeMetadataTemplateName,
string $aspectTypeMetadataTemplateType
): void {
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$aspectTypeMetadataTemplate = (new MetadataTemplate())
->setName($aspectTypeMetadataTemplateName)
->setType($aspectTypeMetadataTemplateType);
$aspectType = (new AspectType())
->setMetadataTemplate($aspectTypeMetadataTemplate);
$request = (new CreateAspectTypeRequest())
->setParent($formattedParent)
->setAspectTypeId($aspectTypeId)
->setAspectType($aspectType);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->createAspectType($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var AspectType $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
$aspectTypeId = '[ASPECT_TYPE_ID]';
$aspectTypeMetadataTemplateName = '[NAME]';
$aspectTypeMetadataTemplateType = '[TYPE]';
create_aspect_type_sample(
$formattedParent,
$aspectTypeId,
$aspectTypeMetadataTemplateName,
$aspectTypeMetadataTemplateType
);
}
createEntry
Creates an Entry.
The async variant is CatalogServiceClient::createEntryAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\CreateEntryRequest;
use Google\Cloud\Dataplex\V1\Entry;
/**
* @param string $formattedParent The resource name of the parent Entry Group:
* `projects/{project}/locations/{location}/entryGroups/{entry_group}`. Please see
* {@see CatalogServiceClient::entryGroupName()} for help formatting this field.
* @param string $entryId Entry identifier. It has to be unique within an Entry Group.
*
* Entries corresponding to Google Cloud resources use an Entry ID format
* based on [full resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
* The format is a full resource name of the resource without the
* prefix double slashes in the API service name part of the full resource
* name. This allows retrieval of entries using their associated resource
* name.
*
* For example, if the full resource name of a resource is
* `//library.googleapis.com/shelves/shelf1/books/book2`,
* then the suggested entry_id is
* `library.googleapis.com/shelves/shelf1/books/book2`.
*
* It is also suggested to follow the same convention for entries
* corresponding to resources from providers or systems other than Google
* Cloud.
*
* The maximum size of the field is 4000 characters.
* @param string $entryEntryType Immutable. The relative resource name of the entry type that was
* used to create this entry, in the format
* `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry_type_id}`.
*/
function create_entry_sample(
string $formattedParent,
string $entryId,
string $entryEntryType
): void {
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entry = (new Entry())
->setEntryType($entryEntryType);
$request = (new CreateEntryRequest())
->setParent($formattedParent)
->setEntryId($entryId)
->setEntry($entry);
// Call the API and handle any network failures.
try {
/** @var Entry $response */
$response = $catalogServiceClient->createEntry($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 = CatalogServiceClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]');
$entryId = '[ENTRY_ID]';
$entryEntryType = '[ENTRY_TYPE]';
create_entry_sample($formattedParent, $entryId, $entryEntryType);
}
createEntryGroup
Creates an EntryGroup.
The async variant is CatalogServiceClient::createEntryGroupAsync() .
request
Google\Cloud\Dataplex\V1\CreateEntryGroupRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\CreateEntryGroupRequest;
use Google\Cloud\Dataplex\V1\EntryGroup;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the entryGroup, of the form:
* projects/{project_number}/locations/{location_id}
* where `location_id` refers to a GCP region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
* @param string $entryGroupId EntryGroup identifier.
*/
function create_entry_group_sample(string $formattedParent, string $entryGroupId): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entryGroup = new EntryGroup();
$request = (new CreateEntryGroupRequest())
->setParent($formattedParent)
->setEntryGroupId($entryGroupId)
->setEntryGroup($entryGroup);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->createEntryGroup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var EntryGroup $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
$entryGroupId = '[ENTRY_GROUP_ID]';
create_entry_group_sample($formattedParent, $entryGroupId);
}
createEntryType
Creates an EntryType.
The async variant is CatalogServiceClient::createEntryTypeAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\CreateEntryTypeRequest;
use Google\Cloud\Dataplex\V1\EntryType;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the EntryType, of the form:
* projects/{project_number}/locations/{location_id}
* where `location_id` refers to a Google Cloud region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
* @param string $entryTypeId EntryType identifier.
*/
function create_entry_type_sample(string $formattedParent, string $entryTypeId): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entryType = new EntryType();
$request = (new CreateEntryTypeRequest())
->setParent($formattedParent)
->setEntryTypeId($entryTypeId)
->setEntryType($entryType);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->createEntryType($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var EntryType $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
$entryTypeId = '[ENTRY_TYPE_ID]';
create_entry_type_sample($formattedParent, $entryTypeId);
}
createMetadataJob
Creates a metadata job. For example, use a metadata job to import Dataplex Catalog entries and aspects from a third-party system into Dataplex.
The async variant is CatalogServiceClient::createMetadataJobAsync() .
request
Google\Cloud\Dataplex\V1\CreateMetadataJobRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\CreateMetadataJobRequest;
use Google\Cloud\Dataplex\V1\MetadataJob;
use Google\Cloud\Dataplex\V1\MetadataJob\Type;
use Google\Rpc\Status;
/**
* @param string $formattedParent The resource name of the parent location, in the format
* `projects/{project_id_or_number}/locations/{location_id}`
* Please see {@see CatalogServiceClient::locationName()} for help formatting this field.
* @param int $metadataJobType Metadata job type.
*/
function create_metadata_job_sample(string $formattedParent, int $metadataJobType): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$metadataJob = (new MetadataJob())
->setType($metadataJobType);
$request = (new CreateMetadataJobRequest())
->setParent($formattedParent)
->setMetadataJob($metadataJob);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->createMetadataJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var MetadataJob $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
$metadataJobType = Type::TYPE_UNSPECIFIED;
create_metadata_job_sample($formattedParent, $metadataJobType);
}
deleteAspectType
Deletes an AspectType.
The async variant is CatalogServiceClient::deleteAspectTypeAsync() .
request
Google\Cloud\Dataplex\V1\DeleteAspectTypeRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\DeleteAspectTypeRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the AspectType:
* `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`. Please see
* {@see CatalogServiceClient::aspectTypeName()} for help formatting this field.
*/
function delete_aspect_type_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new DeleteAspectTypeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->deleteAspectType($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 = CatalogServiceClient::aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]');
delete_aspect_type_sample($formattedName);
}
deleteEntry
Deletes an Entry.
The async variant is CatalogServiceClient::deleteEntryAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\DeleteEntryRequest;
use Google\Cloud\Dataplex\V1\Entry;
/**
* @param string $formattedName The resource name of the Entry:
* `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. Please see
* {@see CatalogServiceClient::entryName()} for help formatting this field.
*/
function delete_entry_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new DeleteEntryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Entry $response */
$response = $catalogServiceClient->deleteEntry($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 = CatalogServiceClient::entryName(
'[PROJECT]',
'[LOCATION]',
'[ENTRY_GROUP]',
'[ENTRY]'
);
delete_entry_sample($formattedName);
}
deleteEntryGroup
Deletes an EntryGroup.
The async variant is CatalogServiceClient::deleteEntryGroupAsync() .
request
Google\Cloud\Dataplex\V1\DeleteEntryGroupRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\DeleteEntryGroupRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the EntryGroup:
* `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`. Please see
* {@see CatalogServiceClient::entryGroupName()} for help formatting this field.
*/
function delete_entry_group_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new DeleteEntryGroupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->deleteEntryGroup($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 = CatalogServiceClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]');
delete_entry_group_sample($formattedName);
}
deleteEntryType
Deletes an EntryType.
The async variant is CatalogServiceClient::deleteEntryTypeAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\DeleteEntryTypeRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The resource name of the EntryType:
* `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`. Please see
* {@see CatalogServiceClient::entryTypeName()} for help formatting this field.
*/
function delete_entry_type_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new DeleteEntryTypeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->deleteEntryType($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 = CatalogServiceClient::entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]');
delete_entry_type_sample($formattedName);
}
getAspectType
Gets an AspectType.
The async variant is CatalogServiceClient::getAspectTypeAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\AspectType;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\GetAspectTypeRequest;
/**
* @param string $formattedName The resource name of the AspectType:
* `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`. Please see
* {@see CatalogServiceClient::aspectTypeName()} for help formatting this field.
*/
function get_aspect_type_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetAspectTypeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var AspectType $response */
$response = $catalogServiceClient->getAspectType($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 = CatalogServiceClient::aspectTypeName('[PROJECT]', '[LOCATION]', '[ASPECT_TYPE]');
get_aspect_type_sample($formattedName);
}
getEntry
Gets an Entry.
The async variant is CatalogServiceClient::getEntryAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\Entry;
use Google\Cloud\Dataplex\V1\GetEntryRequest;
/**
* @param string $formattedName The resource name of the Entry:
* `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. Please see
* {@see CatalogServiceClient::entryName()} for help formatting this field.
*/
function get_entry_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetEntryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Entry $response */
$response = $catalogServiceClient->getEntry($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 = CatalogServiceClient::entryName(
'[PROJECT]',
'[LOCATION]',
'[ENTRY_GROUP]',
'[ENTRY]'
);
get_entry_sample($formattedName);
}
getEntryGroup
Gets an EntryGroup.
The async variant is CatalogServiceClient::getEntryGroupAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryGroup;
use Google\Cloud\Dataplex\V1\GetEntryGroupRequest;
/**
* @param string $formattedName The resource name of the EntryGroup:
* `projects/{project_number}/locations/{location_id}/entryGroups/{entry_group_id}`. Please see
* {@see CatalogServiceClient::entryGroupName()} for help formatting this field.
*/
function get_entry_group_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetEntryGroupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var EntryGroup $response */
$response = $catalogServiceClient->getEntryGroup($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 = CatalogServiceClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]');
get_entry_group_sample($formattedName);
}
getEntryType
Gets an EntryType.
The async variant is CatalogServiceClient::getEntryTypeAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryType;
use Google\Cloud\Dataplex\V1\GetEntryTypeRequest;
/**
* @param string $formattedName The resource name of the EntryType:
* `projects/{project_number}/locations/{location_id}/entryTypes/{entry_type_id}`. Please see
* {@see CatalogServiceClient::entryTypeName()} for help formatting this field.
*/
function get_entry_type_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetEntryTypeRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var EntryType $response */
$response = $catalogServiceClient->getEntryType($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 = CatalogServiceClient::entryTypeName('[PROJECT]', '[LOCATION]', '[ENTRY_TYPE]');
get_entry_type_sample($formattedName);
}
getMetadataJob
Gets a metadata job.
The async variant is CatalogServiceClient::getMetadataJobAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\GetMetadataJobRequest;
use Google\Cloud\Dataplex\V1\MetadataJob;
/**
* @param string $formattedName The resource name of the metadata job, in the format
* `projects/{project_id_or_number}/locations/{location_id}/metadataJobs/{metadata_job_id}`. Please see
* {@see CatalogServiceClient::metadataJobName()} for help formatting this field.
*/
function get_metadata_job_sample(string $formattedName): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetMetadataJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var MetadataJob $response */
$response = $catalogServiceClient->getMetadataJob($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 = CatalogServiceClient::metadataJobName('[PROJECT]', '[LOCATION]', '[METADATAJOB]');
get_metadata_job_sample($formattedName);
}
listAspectTypes
Lists AspectType resources in a project and location.
The async variant is CatalogServiceClient::listAspectTypesAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\AspectType;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\ListAspectTypesRequest;
/**
* @param string $formattedParent The resource name of the AspectType location, of the form:
* `projects/{project_number}/locations/{location_id}`
* where `location_id` refers to a Google Cloud region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
*/
function list_aspect_types_sample(string $formattedParent): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new ListAspectTypesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->listAspectTypes($request);
/** @var AspectType $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_aspect_types_sample($formattedParent);
}
listEntries
Lists Entries within an EntryGroup.
The async variant is CatalogServiceClient::listEntriesAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\Entry;
use Google\Cloud\Dataplex\V1\ListEntriesRequest;
/**
* @param string $formattedParent The resource name of the parent Entry Group:
* `projects/{project}/locations/{location}/entryGroups/{entry_group}`. Please see
* {@see CatalogServiceClient::entryGroupName()} for help formatting this field.
*/
function list_entries_sample(string $formattedParent): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new ListEntriesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->listEntries($request);
/** @var Entry $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 = CatalogServiceClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]');
list_entries_sample($formattedParent);
}
listEntryGroups
Lists EntryGroup resources in a project and location.
The async variant is CatalogServiceClient::listEntryGroupsAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryGroup;
use Google\Cloud\Dataplex\V1\ListEntryGroupsRequest;
/**
* @param string $formattedParent The resource name of the entryGroup location, of the form:
* `projects/{project_number}/locations/{location_id}`
* where `location_id` refers to a Google Cloud region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
*/
function list_entry_groups_sample(string $formattedParent): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new ListEntryGroupsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->listEntryGroups($request);
/** @var EntryGroup $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_entry_groups_sample($formattedParent);
}
listEntryTypes
Lists EntryType resources in a project and location.
The async variant is CatalogServiceClient::listEntryTypesAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryType;
use Google\Cloud\Dataplex\V1\ListEntryTypesRequest;
/**
* @param string $formattedParent The resource name of the EntryType location, of the form:
* `projects/{project_number}/locations/{location_id}`
* where `location_id` refers to a Google Cloud region. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
*/
function list_entry_types_sample(string $formattedParent): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new ListEntryTypesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->listEntryTypes($request);
/** @var EntryType $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_entry_types_sample($formattedParent);
}
listMetadataJobs
Lists metadata jobs.
The async variant is CatalogServiceClient::listMetadataJobsAsync() .
request
Google\Cloud\Dataplex\V1\ListMetadataJobsRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\ListMetadataJobsRequest;
use Google\Cloud\Dataplex\V1\MetadataJob;
/**
* @param string $formattedParent The resource name of the parent location, in the format
* `projects/{project_id_or_number}/locations/{location_id}`
* Please see {@see CatalogServiceClient::locationName()} for help formatting this field.
*/
function list_metadata_jobs_sample(string $formattedParent): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new ListMetadataJobsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->listMetadataJobs($request);
/** @var MetadataJob $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 = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_metadata_jobs_sample($formattedParent);
}
lookupEntry
Looks up an entry by name using the permission on the source system.
The async variant is CatalogServiceClient::lookupEntryAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\Entry;
use Google\Cloud\Dataplex\V1\LookupEntryRequest;
/**
* @param string $name The project to which the request should be attributed in the
* following form: `projects/{project}/locations/{location}`.
* @param string $formattedEntry The resource name of the Entry:
* `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. Please see
* {@see CatalogServiceClient::entryName()} for help formatting this field.
*/
function lookup_entry_sample(string $name, string $formattedEntry): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new LookupEntryRequest())
->setName($name)
->setEntry($formattedEntry);
// Call the API and handle any network failures.
try {
/** @var Entry $response */
$response = $catalogServiceClient->lookupEntry($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
{
$name = '[NAME]';
$formattedEntry = CatalogServiceClient::entryName(
'[PROJECT]',
'[LOCATION]',
'[ENTRY_GROUP]',
'[ENTRY]'
);
lookup_entry_sample($name, $formattedEntry);
}
searchEntries
Searches for Entries matching the given query and scope.
The async variant is CatalogServiceClient::searchEntriesAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\SearchEntriesRequest;
use Google\Cloud\Dataplex\V1\SearchEntriesResult;
/**
* @param string $formattedName The project to which the request should be attributed in the
* following form: `projects/{project}/locations/{location}`. Please see
* {@see CatalogServiceClient::locationName()} for help formatting this field.
* @param string $query The query against which entries in scope should be matched.
* The query syntax is defined in [Search syntax for Dataplex
* Catalog](https://cloud.google.com/dataplex/docs/search-syntax).
*/
function search_entries_sample(string $formattedName, string $query): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new SearchEntriesRequest())
->setName($formattedName)
->setQuery($query);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->searchEntries($request);
/** @var SearchEntriesResult $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
$query = '[QUERY]';
search_entries_sample($formattedName, $query);
}
updateAspectType
Updates an AspectType.
The async variant is CatalogServiceClient::updateAspectTypeAsync() .
request
Google\Cloud\Dataplex\V1\UpdateAspectTypeRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\AspectType;
use Google\Cloud\Dataplex\V1\AspectType\MetadataTemplate;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\UpdateAspectTypeRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $aspectTypeMetadataTemplateName The name of the field.
* @param string $aspectTypeMetadataTemplateType The datatype of this field. The following values are supported:
*
* Primitive types:
*
* * string
* * integer
* * boolean
* * double
* * datetime. Must be of the format RFC3339 UTC "Zulu" (Examples:
* "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z").
*
* Complex types:
*
* * enum
* * array
* * map
* * record
*/
function update_aspect_type_sample(
string $aspectTypeMetadataTemplateName,
string $aspectTypeMetadataTemplateType
): void {
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$aspectTypeMetadataTemplate = (new MetadataTemplate())
->setName($aspectTypeMetadataTemplateName)
->setType($aspectTypeMetadataTemplateType);
$aspectType = (new AspectType())
->setMetadataTemplate($aspectTypeMetadataTemplate);
$updateMask = new FieldMask();
$request = (new UpdateAspectTypeRequest())
->setAspectType($aspectType)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->updateAspectType($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var AspectType $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
{
$aspectTypeMetadataTemplateName = '[NAME]';
$aspectTypeMetadataTemplateType = '[TYPE]';
update_aspect_type_sample($aspectTypeMetadataTemplateName, $aspectTypeMetadataTemplateType);
}
updateEntry
Updates an Entry.
The async variant is CatalogServiceClient::updateEntryAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\Entry;
use Google\Cloud\Dataplex\V1\UpdateEntryRequest;
/**
* @param string $entryEntryType Immutable. The relative resource name of the entry type that was
* used to create this entry, in the format
* `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry_type_id}`.
*/
function update_entry_sample(string $entryEntryType): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entry = (new Entry())
->setEntryType($entryEntryType);
$request = (new UpdateEntryRequest())
->setEntry($entry);
// Call the API and handle any network failures.
try {
/** @var Entry $response */
$response = $catalogServiceClient->updateEntry($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
{
$entryEntryType = '[ENTRY_TYPE]';
update_entry_sample($entryEntryType);
}
updateEntryGroup
Updates an EntryGroup.
The async variant is CatalogServiceClient::updateEntryGroupAsync() .
request
Google\Cloud\Dataplex\V1\UpdateEntryGroupRequest
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryGroup;
use Google\Cloud\Dataplex\V1\UpdateEntryGroupRequest;
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_entry_group_sample(): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entryGroup = new EntryGroup();
$updateMask = new FieldMask();
$request = (new UpdateEntryGroupRequest())
->setEntryGroup($entryGroup)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->updateEntryGroup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var EntryGroup $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());
}
}
updateEntryType
Updates an EntryType.
The async variant is CatalogServiceClient::updateEntryTypeAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\EntryType;
use Google\Cloud\Dataplex\V1\UpdateEntryTypeRequest;
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_entry_type_sample(): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$entryType = new EntryType();
$updateMask = new FieldMask();
$request = (new UpdateEntryTypeRequest())
->setEntryType($entryType)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $catalogServiceClient->updateEntryType($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var EntryType $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());
}
}
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 CatalogServiceClient::getIamPolicyAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
/**
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $catalogServiceClient->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 CatalogServiceClient::setIamPolicyAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
/**
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
function set_iam_policy_sample(string $resource): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// 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 = $catalogServiceClient->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 CatalogServiceClient::testIamPermissionsAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
/**
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
*/
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// 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 = $catalogServiceClient->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);
}
getLocation
Gets information about a location.
The async variant is CatalogServiceClient::getLocationAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function get_location_sample(): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $catalogServiceClient->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 CatalogServiceClient::listLocationsAsync() .
request
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.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function list_locations_sample(): void
{
// Create a client.
$catalogServiceClient = new CatalogServiceClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $catalogServiceClient->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());
}
}
cancelMetadataJobAsync
optionalArgs
array
createAspectTypeAsync
optionalArgs
array
createEntryAsync
createEntryGroupAsync
optionalArgs
array
createEntryTypeAsync
optionalArgs
array
createMetadataJobAsync
optionalArgs
array
deleteAspectTypeAsync
optionalArgs
array
deleteEntryAsync
deleteEntryGroupAsync
optionalArgs
array
deleteEntryTypeAsync
optionalArgs
array
getAspectTypeAsync
optionalArgs
array
getEntryAsync
getEntryGroupAsync
optionalArgs
array
getEntryTypeAsync
getMetadataJobAsync
optionalArgs
array
listAspectTypesAsync
optionalArgs
array
listEntriesAsync
listEntryGroupsAsync
optionalArgs
array
listEntryTypesAsync
optionalArgs
array
listMetadataJobsAsync
optionalArgs
array
lookupEntryAsync
searchEntriesAsync
optionalArgs
array
updateAspectTypeAsync
optionalArgs
array
updateEntryAsync
updateEntryGroupAsync
optionalArgs
array
updateEntryTypeAsync
optionalArgs
array
getIamPolicyAsync
setIamPolicyAsync
testIamPermissionsAsync
optionalArgs
array
getLocationAsync
listLocationsAsync
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Google\LongRunning\Client\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.
operationName
string
The name of the long running operation
methodName
string
The name of the method used to start the operation
static::aspectTypeName
Formats a string containing the fully-qualified path to represent a aspect_type resource.
project
string
location
string
aspectType
string
string
static::entryName
Formats a string containing the fully-qualified path to represent a entry resource.
project
string
location
string
entryGroup
string
entry
string
string
static::entryGroupName
Formats a string containing the fully-qualified path to represent a entry_group resource.
project
string
location
string
entryGroup
string
string
static::entryTypeName
Formats a string containing the fully-qualified path to represent a entry_type resource.
project
string
location
string
entryType
string
string
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
project
string
location
string
string
static::metadataJobName
Formats a string containing the fully-qualified path to represent a metadata_job resource.
project
string
location
string
metadataJob
string
string
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- aspectType: projects/{project}/locations/{location}/aspectTypes/{aspect_type}
- entry: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}
- entryGroup: projects/{project}/locations/{location}/entryGroups/{entry_group}
- entryType: projects/{project}/locations/{location}/entryTypes/{entry_type}
- location: projects/{project}/locations/{location}
- metadataJob: projects/{project}/locations/{location}/metadataJobs/{metadataJob}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
formattedName
string
The formatted name string
template
?string
Optional name of template to match
array