users
Creates, updates, deletes, gets or lists a users
resource.
Overview
Name | users |
Type | Resource |
Id | google.sqladmin.users |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The name of the user in the Cloud SQL instance. Can be omitted for update because it is already specified in the URL. |
dualPasswordType | string | Dual password status for the user. |
etag | string | This field is deprecated and will be removed from a future version of the API. |
host | string | Optional. The host from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. For a MySQL instance, it's required; for a PostgreSQL or SQL Server instance, it's optional. |
instance | string | The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update because it is already specified on the URL. |
kind | string | This is always sql#user . |
password | string | The password for the user. |
passwordPolicy | object | User level password validation policy. |
project | string | The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update because it is already specified on the URL. |
sqlserverUserDetails | object | Represents a Sql Server user on the Cloud SQL instance. |
type | string | The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | instance, name, project | Retrieves a resource containing information about a user. |
list | SELECT | instance, project | Lists users in the specified Cloud SQL instance. |
insert | INSERT | instance, project | Creates a new user in a Cloud SQL instance. |
delete | DELETE | instance, project | Deletes a user from a Cloud SQL instance. |
update | REPLACE | instance, project | Updates an existing user in a Cloud SQL instance. |
SELECT
examples
Lists users in the specified Cloud SQL instance.
SELECT
name,
dualPasswordType,
etag,
host,
instance,
kind,
password,
passwordPolicy,
project,
sqlserverUserDetails,
type
FROM google.sqladmin.users
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';
INSERT
example
Use the following StackQL query and manifest file to create a new users
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.sqladmin.users (
instance,
project,
password,
etag,
name,
host,
instance,
project,
type,
sqlserverUserDetails,
passwordPolicy,
dualPasswordType
)
SELECT
'{{ instance }}',
'{{ project }}',
'{{ password }}',
'{{ etag }}',
'{{ name }}',
'{{ host }}',
'{{ instance }}',
'{{ project }}',
'{{ type }}',
'{{ sqlserverUserDetails }}',
'{{ passwordPolicy }}',
'{{ dualPasswordType }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: password
value: string
- name: etag
value: string
- name: name
value: string
- name: host
value: string
- name: instance
value: string
- name: project
value: string
- name: type
value: string
- name: sqlserverUserDetails
value:
- name: disabled
value: boolean
- name: serverRoles
value:
- string
- name: passwordPolicy
value:
- name: allowedFailedAttempts
value: integer
- name: passwordExpirationDuration
value: string
- name: enableFailedAttemptsCheck
value: boolean
- name: status
value:
- name: locked
value: boolean
- name: passwordExpirationTime
value: string
- name: enablePasswordVerification
value: boolean
- name: dualPasswordType
value: string
REPLACE
example
Replaces all fields in the specified users
resource.
/*+ update */
REPLACE google.sqladmin.users
SET
password = '{{ password }}',
etag = '{{ etag }}',
name = '{{ name }}',
host = '{{ host }}',
instance = '{{ instance }}',
project = '{{ project }}',
type = '{{ type }}',
sqlserverUserDetails = '{{ sqlserverUserDetails }}',
passwordPolicy = '{{ passwordPolicy }}',
dualPasswordType = '{{ dualPasswordType }}'
WHERE
instance = '{{ instance }}'
AND project = '{{ project }}';
DELETE
example
Deletes the specified users
resource.
/*+ delete */
DELETE FROM google.sqladmin.users
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';