namespaces
Creates, updates, deletes, gets or lists a namespaces
resource.
Overview
Name | namespaces |
Type | Resource |
Id | google.servicedirectory.namespaces |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/* . |
labels | object | Optional. 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. |
uid | string | Output only. The globally unique identifier of the namespace in the UUID4 format. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/* . |
labels | object | Optional. 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. |
uid | string | Output only. The globally unique identifier of the namespace in the UUID4 format. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , namespacesId | Gets a namespace. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists all namespaces. |
create | insert | projectsId , locationsId | namespaceId | Creates a namespace, and returns the new namespace. |
patch | update | projectsId , locationsId , namespacesId | updateMask | Updates a namespace. |
delete | delete | projectsId , locationsId , namespacesId | Deletes a namespace. This also deletes all services and endpoints in the namespace. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
namespacesId | string | |
projectsId | string | |
filter | string | |
namespaceId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets a namespace.
SELECT
name,
labels,
uid
FROM google.servicedirectory.namespaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND namespacesId = '{{ namespacesId }}' -- required;
Lists all namespaces.
SELECT
name,
labels,
uid
FROM google.servicedirectory.namespaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
Creates a namespace, and returns the new namespace.
INSERT INTO google.servicedirectory.namespaces (
data__name,
data__labels,
projectsId,
locationsId,
namespaceId
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ namespaceId }}'
RETURNING
name,
labels,
uid
;
# Description fields are for documentation purposes
- name: namespaces
props:
- name: projectsId
value: string
description: Required parameter for the namespaces resource.
- name: locationsId
value: string
description: Required parameter for the namespaces resource.
- name: name
value: string
description: >
Immutable. The resource name for the namespace in the format `projects/*/locations/*/namespaces/*`.
- name: labels
value: object
description: >
Optional. 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.
- name: namespaceId
value: string
UPDATE
examples
- patch
Updates a namespace.
UPDATE google.servicedirectory.namespaces
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND namespacesId = '{{ namespacesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
labels,
uid;
DELETE
examples
- delete
Deletes a namespace. This also deletes all services and endpoints in the namespace.
DELETE FROM google.servicedirectory.namespaces
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND namespacesId = '{{ namespacesId }}' --required;