roles
Creates, updates, deletes, gets or lists a roles
resource.
Overview
Name | roles |
Type | Resource |
Id | snowflake.role.roles |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Name of the role. |
assigned_to_users | integer | The number of users to whom this role has been assigned. |
comment | string | Comment of the role. |
created_on | string | Date and time when the role was created. |
granted_roles | integer | The number of roles that have been granted to this role. |
granted_to_roles | integer | The number of roles to which this role has been granted. |
is_current | boolean | Specifies whether the role being fetched is the user's current role. |
is_default | boolean | Specifies whether the role being fetched is the user's default role. |
is_inherited | boolean | Specifies whether the role used to run the command inherits the specified role. |
owner | string | Specifies the role that owns this role. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
list_roles | SELECT | endpoint | List roles |
create_role | INSERT | data__name, endpoint | Create a role |
delete_role | DELETE | name, endpoint | Delete a role |
SELECT
examples
List roles
SELECT
name,
assigned_to_users,
comment,
created_on,
granted_roles,
granted_to_roles,
is_current,
is_default,
is_inherited,
owner
FROM snowflake.role.roles
WHERE endpoint = '{{ endpoint }}';
INSERT
example
Use the following StackQL query and manifest file to create a new roles
resource.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO snowflake.role.roles (
data__name,
data__comment,
endpoint
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ endpoint }}'
;
/*+ create */
INSERT INTO snowflake.role.roles (
data__name,
endpoint
)
SELECT
'{{ name }}',
'{{ endpoint }}'
;
- name: roles
props:
- name: data__name
value: string
- name: endpoint
value: string
- name: name
value: string
- name: comment
value: string
DELETE
example
Deletes the specified roles
resource.
/*+ delete */
DELETE FROM snowflake.role.roles
WHERE name = '{{ name }}'
AND endpoint = '{{ endpoint }}';