Skip to main content

services

Creates, updates, deletes, gets or lists a services resource.

Overview

Nameservices
TypeResource
Idgoogle.metastore.services

Fields

NameDatatypeDescription
namestringImmutable. The relative resource name of the metastore service, in the following format:projects/{project_number}/locations/{location_id}/services/{service_id}.
artifactGcsUristringOutput only. A Cloud Storage URI (starting with gs://) that specifies where artifacts related to the metastore service are stored.
createTimestringOutput only. The time when the metastore service was created.
databaseTypestringImmutable. The database type that the Metastore service stores its data.
deletionProtectionbooleanOptional. Indicates if the dataproc metastore should be protected against accidental deletions.
encryptionConfigobjectEncryption settings for the service.
endpointUristringOutput only. The URI of the endpoint used to access the metastore service.
hiveMetastoreConfigobjectSpecifies configuration information specific to running Hive metastore software as the metastore service.
labelsobjectUser-defined labels for the metastore service.
maintenanceWindowobjectMaintenance window. This specifies when Dataproc Metastore may perform system maintenance operation to the service.
metadataIntegrationobjectSpecifies how metastore metadata should be integrated with external services.
metadataManagementActivityobjectThe metadata management activities of the metastore service.
networkstringImmutable. The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:projects/{project_number}/global/networks/{network_id}.
networkConfigobjectNetwork configuration for the Dataproc Metastore service.
portintegerThe TCP port at which the metastore service is reached. Default: 9083.
releaseChannelstringImmutable. The release channel of the service. If unspecified, defaults to STABLE.
scalingConfigobjectRepresents the scaling configuration of a metastore service.
scheduledBackupobjectThis specifies the configuration of scheduled backup.
statestringOutput only. The current state of the metastore service.
stateMessagestringOutput only. Additional information about the current state of the metastore service, if available.
telemetryConfigobjectTelemetry Configuration for the Dataproc Metastore service.
tierstringThe tier of the service.
uidstringOutput only. The globally unique resource identifier of the metastore service.
updateTimestringOutput only. The time when the metastore service was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, servicesIdGets the details of a single service.
listSELECTlocationsId, projectsIdLists services in a project and location.
createINSERTlocationsId, projectsIdCreates a metastore service in a project and location.
deleteDELETElocationsId, projectsId, servicesIdDeletes a single service.
patchUPDATElocationsId, projectsId, servicesIdUpdates the parameters of a single service.
alter_locationEXEClocationsId, projectsId, servicesIdAlter metadata resource location. The metadata resource can be a database, table, or partition. This functionality only updates the parent directory for the respective metadata resource and does not transfer any existing data to the new location.
alter_table_propertiesEXEClocationsId, projectsId, servicesIdAlter metadata table properties.
cancel_migrationEXEClocationsId, projectsId, servicesIdCancels the ongoing Managed Migration process.
complete_migrationEXEClocationsId, projectsId, servicesIdCompletes the managed migration process. The Dataproc Metastore service will switch to using its own backend database after successful migration.
export_metadataEXEClocationsId, projectsId, servicesIdExports metadata from a service.
move_table_to_databaseEXEClocationsId, projectsId, servicesIdMove a table to another database.
query_metadataEXEClocationsId, projectsId, servicesIdQuery Dataproc Metastore metadata.
restoreEXEClocationsId, projectsId, servicesIdRestores a service from a backup.
start_migrationEXEClocationsId, projectsId, servicesIdStarts the Managed Migration process.

SELECT examples

Lists services in a project and location.

SELECT
name,
artifactGcsUri,
createTime,
databaseType,
deletionProtection,
encryptionConfig,
endpointUri,
hiveMetastoreConfig,
labels,
maintenanceWindow,
metadataIntegration,
metadataManagementActivity,
network,
networkConfig,
port,
releaseChannel,
scalingConfig,
scheduledBackup,
state,
stateMessage,
telemetryConfig,
tier,
uid,
updateTime
FROM google.metastore.services
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new services resource.

/*+ create */
INSERT INTO google.metastore.services (
locationsId,
projectsId,
hiveMetastoreConfig,
name,
labels,
network,
port,
tier,
metadataIntegration,
maintenanceWindow,
releaseChannel,
encryptionConfig,
networkConfig,
databaseType,
telemetryConfig,
scalingConfig,
scheduledBackup,
deletionProtection
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ hiveMetastoreConfig }}',
'{{ name }}',
'{{ labels }}',
'{{ network }}',
'{{ port }}',
'{{ tier }}',
'{{ metadataIntegration }}',
'{{ maintenanceWindow }}',
'{{ releaseChannel }}',
'{{ encryptionConfig }}',
'{{ networkConfig }}',
'{{ databaseType }}',
'{{ telemetryConfig }}',
'{{ scalingConfig }}',
'{{ scheduledBackup }}',
{{ deletionProtection }}
;

UPDATE example

Updates a services resource.

/*+ update */
UPDATE google.metastore.services
SET
hiveMetastoreConfig = '{{ hiveMetastoreConfig }}',
name = '{{ name }}',
labels = '{{ labels }}',
network = '{{ network }}',
port = '{{ port }}',
tier = '{{ tier }}',
metadataIntegration = '{{ metadataIntegration }}',
maintenanceWindow = '{{ maintenanceWindow }}',
releaseChannel = '{{ releaseChannel }}',
encryptionConfig = '{{ encryptionConfig }}',
networkConfig = '{{ networkConfig }}',
databaseType = '{{ databaseType }}',
telemetryConfig = '{{ telemetryConfig }}',
scalingConfig = '{{ scalingConfig }}',
scheduledBackup = '{{ scheduledBackup }}',
deletionProtection = true|false
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND servicesId = '{{ servicesId }}';

DELETE example

Deletes the specified services resource.

/*+ delete */
DELETE FROM google.metastore.services
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND servicesId = '{{ servicesId }}';