users
Creates, updates, deletes, gets or lists a users
resource.
Overview
Name | users |
Type | Resource |
Id | google.alloydb.users |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Name of the resource in the form of projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. |
databaseRoles | array | Optional. List of database roles this user has. The database role strings are subject to the PostgreSQL naming conventions. |
keepExtraRoles | boolean | Input only. If the user already exists and it has additional roles, keep them granted. |
password | string | Input only. Password for the user. |
userType | string | Optional. Type of this user. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Name of the resource in the form of projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. |
databaseRoles | array | Optional. List of database roles this user has. The database role strings are subject to the PostgreSQL naming conventions. |
keepExtraRoles | boolean | Input only. If the user already exists and it has additional roles, keep them granted. |
password | string | Input only. Password for the user. |
userType | string | Optional. Type of this user. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , clustersId , usersId | Gets details of a single User. | |
list | select | projectsId , locationsId , clustersId | pageSize , pageToken , filter , orderBy | Lists Users in a given project and location. |
create | insert | projectsId , locationsId , clustersId | userId , requestId , validateOnly | Creates a new User in a given project, location, and cluster. |
patch | update | projectsId , locationsId , clustersId , usersId | updateMask , requestId , validateOnly , allowMissing | Updates the parameters of a single User. |
delete | delete | projectsId , locationsId , clustersId , usersId | requestId , validateOnly | Deletes a single User. |
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 |
---|---|---|
clustersId | string | |
locationsId | string | |
projectsId | string | |
usersId | string | |
allowMissing | boolean | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) | |
userId | string | |
validateOnly | boolean |
SELECT
examples
- get
- list
Gets details of a single User.
SELECT
name,
databaseRoles,
keepExtraRoles,
password,
userType
FROM google.alloydb.users
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND clustersId = '{{ clustersId }}' -- required
AND usersId = '{{ usersId }}' -- required;
Lists Users in a given project and location.
SELECT
name,
databaseRoles,
keepExtraRoles,
password,
userType
FROM google.alloydb.users
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND clustersId = '{{ clustersId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
Creates a new User in a given project, location, and cluster.
INSERT INTO google.alloydb.users (
data__password,
data__databaseRoles,
data__userType,
data__keepExtraRoles,
projectsId,
locationsId,
clustersId,
userId,
requestId,
validateOnly
)
SELECT
'{{ password }}',
'{{ databaseRoles }}',
'{{ userType }}',
{{ keepExtraRoles }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ clustersId }}',
'{{ userId }}',
'{{ requestId }}',
'{{ validateOnly }}'
RETURNING
name,
databaseRoles,
keepExtraRoles,
password,
userType
;
# Description fields are for documentation purposes
- name: users
props:
- name: projectsId
value: string
description: Required parameter for the users resource.
- name: locationsId
value: string
description: Required parameter for the users resource.
- name: clustersId
value: string
description: Required parameter for the users resource.
- name: password
value: string
description: >
Input only. Password for the user.
- name: databaseRoles
value: array
description: >
Optional. List of database roles this user has. The database role strings are subject to the PostgreSQL naming conventions.
- name: userType
value: string
description: >
Optional. Type of this user.
valid_values: ['USER_TYPE_UNSPECIFIED', 'ALLOYDB_BUILT_IN', 'ALLOYDB_IAM_USER']
- name: keepExtraRoles
value: boolean
description: >
Input only. If the user already exists and it has additional roles, keep them granted.
- name: userId
value: string
- name: requestId
value: string
- name: validateOnly
value: boolean
UPDATE
examples
- patch
Updates the parameters of a single User.
UPDATE google.alloydb.users
SET
data__password = '{{ password }}',
data__databaseRoles = '{{ databaseRoles }}',
data__userType = '{{ userType }}',
data__keepExtraRoles = {{ keepExtraRoles }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND clustersId = '{{ clustersId }}' --required
AND usersId = '{{ usersId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND validateOnly = {{ validateOnly}}
AND allowMissing = {{ allowMissing}}
RETURNING
name,
databaseRoles,
keepExtraRoles,
password,
userType;
DELETE
examples
- delete
Deletes a single User.
DELETE FROM google.alloydb.users
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND clustersId = '{{ clustersId }}' --required
AND usersId = '{{ usersId }}' --required
AND requestId = '{{ requestId }}'
AND validateOnly = '{{ validateOnly }}';