Skip to main content

namespaces

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

Overview

Namenamespaces
TypeResource
Idgoogle.servicedirectory.namespaces

Fields

NameDatatypeDescription
namestringImmutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.
labelsobjectOptional. Resource labels associated with this namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.
uidstringOutput only. The globally unique identifier of the namespace in the UUID4 format.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, namespacesId, projectsIdGets a namespace.
listSELECTlocationsId, projectsIdLists all namespaces.
createINSERTlocationsId, projectsIdCreates a namespace, and returns the new namespace.
deleteDELETElocationsId, namespacesId, projectsIdDeletes a namespace. This also deletes all services and endpoints in the namespace.
patchUPDATElocationsId, namespacesId, projectsIdUpdates a namespace.

SELECT examples

Lists all namespaces.

SELECT
name,
labels,
uid
FROM google.servicedirectory.namespaces
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.servicedirectory.namespaces (
locationsId,
projectsId,
name,
labels
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}'
;

UPDATE example

Updates a namespaces resource.

/*+ update */
UPDATE google.servicedirectory.namespaces
SET
name = '{{ name }}',
labels = '{{ labels }}'
WHERE
locationsId = '{{ locationsId }}'
AND namespacesId = '{{ namespacesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified namespaces resource.

/*+ delete */
DELETE FROM google.servicedirectory.namespaces
WHERE locationsId = '{{ locationsId }}'
AND namespacesId = '{{ namespacesId }}'
AND projectsId = '{{ projectsId }}';