Skip to main content

namespaces

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

Overview​

Namenamespaces
TypeResource
Idgoogle.iam.namespaces

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The resource name of the namespace.
descriptionstringOptional. A description of the namespace. Cannot exceed 256 characters.
disabledbooleanOptional. Whether the namespace is disabled. If disabled, credentials may no longer be issued for identities within this namespace, however existing credentials will still be accepted until they expire.
expireTimestring (google-datetime)Output only. Time after which the namespace will be permanently purged and cannot be recovered.
ownerServiceobjectOutput only. The Google Cloud service that owns this namespace. (id: OwnerService)
statestringOutput only. The state of the namespace. (STATE_UNSPECIFIED, ACTIVE, DELETED)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdGets an individual WorkloadIdentityPoolNamespace.
listselectprojectsId, locationsId, workloadIdentityPoolsIdpageSize, pageToken, showDeletedLists all non-deleted WorkloadIdentityPoolNamespaces in a workload identity pool. If show_deleted is set to true, then deleted namespaces are also listed.
createinsertprojectsId, locationsId, workloadIdentityPoolsIdworkloadIdentityPoolNamespaceIdCreates a new WorkloadIdentityPoolNamespace in a WorkloadIdentityPool.
patchupdateprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdupdateMaskUpdates an existing WorkloadIdentityPoolNamespace in a WorkloadIdentityPool.
deletedeleteprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdDeletes a WorkloadIdentityPoolNamespace. You can undelete a namespace for 30 days. After 30 days, deletion is permanent.
undeleteexecprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdUndeletes a WorkloadIdentityPoolNamespace, as long as it was deleted fewer than 30 days ago.

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.

NameDatatypeDescription
locationsIdstring
namespacesIdstring
projectsIdstring
workloadIdentityPoolsIdstring
pageSizeinteger (int32)
pageTokenstring
showDeletedboolean
updateMaskstring (google-fieldmask)
workloadIdentityPoolNamespaceIdstring

SELECT examples​

Gets an individual WorkloadIdentityPoolNamespace.

SELECT
name,
description,
disabled,
expireTime,
ownerService,
state
FROM google.iam.namespaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' -- required
AND namespacesId = '{{ namespacesId }}' -- required
;

INSERT examples​

Creates a new WorkloadIdentityPoolNamespace in a WorkloadIdentityPool.

INSERT INTO google.iam.namespaces (
data__description,
data__disabled,
data__name,
projectsId,
locationsId,
workloadIdentityPoolsId,
workloadIdentityPoolNamespaceId
)
SELECT
'{{ description }}',
{{ disabled }},
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ workloadIdentityPoolsId }}',
'{{ workloadIdentityPoolNamespaceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples​

Updates an existing WorkloadIdentityPoolNamespace in a WorkloadIdentityPool.

UPDATE google.iam.namespaces
SET
data__description = '{{ description }}',
data__disabled = {{ disabled }},
data__name = '{{ name }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' --required
AND namespacesId = '{{ namespacesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples​

Deletes a WorkloadIdentityPoolNamespace. You can undelete a namespace for 30 days. After 30 days, deletion is permanent.

DELETE FROM google.iam.namespaces
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' --required
AND namespacesId = '{{ namespacesId }}' --required
;

Lifecycle Methods​

Undeletes a WorkloadIdentityPoolNamespace, as long as it was deleted fewer than 30 days ago.

EXEC google.iam.namespaces.undelete
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@workloadIdentityPoolsId='{{ workloadIdentityPoolsId }}' --required,
@namespacesId='{{ namespacesId }}' --required
;