Skip to main content

roles

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

Overview

Nameroles
TypeResource
Idsnowflake.service.roles

Fields

The following fields are returned by SELECT queries:

successful

NameDatatypeDescription
namestringService role name
commentstringComment, if any, for the service role
created_onstring (date-time)Date and time when the service role was created

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_service_rolesselectdatabase_name, schema_name, name, endpointList all the service roles of the service

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
database_namestringIdentifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
endpointstringOrganization and Account Name (default: orgid-acctid)
namestringIdentifier (i.e. name) for the resource.
schema_namestringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.

SELECT examples

List all the service roles of the service

SELECT
name,
comment,
created_on
FROM snowflake.service.roles
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required;