accounts
Creates, updates, deletes, gets or lists a accounts
resource.
Overview
Name | accounts |
Type | Resource |
Id | snowflake.account.accounts |
Fields
Name | Datatype | Description |
---|---|---|
name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. |
account_locator | string | System-assigned identifier of the acccount. |
account_locator_url | string | Legacy Snowflake account URL syntax that includes the region_name and account_locator. |
account_old_url_last_used | string | If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL. |
account_old_url_saved_on | string | If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved. |
account_url | string | Preferred Snowflake account URL that includes the values of organization_name and account_name. |
admin_name | string | Name of the account administrator. |
admin_password | string | Password for the account administrator. |
admin_rsa_public_key | string | RSA public key for the account administrator. |
admin_user_type | string | User type of the account administrator. |
comment | string | Optional comment in which to store information related to the account. |
consumption_billing_entity_name | string | Name of the consumption billing entity. |
created_on | string | Date and time the account was created. |
dropped_on | string | Date and time the account was dropped. |
edition | string | Snowflake Edition of the account. |
email | string | Email address of the account administrator. |
first_name | string | First name of the account administrator. |
is_events_account | boolean | Indicates whether an account is an events account. For more information, see Set up logging and event sharing for an application. |
is_org_admin | boolean | Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. |
last_name | string | Last name of the account administrator. |
managed_accounts | integer | Indicates how many managed accounts have been created by the account. |
marketplace_consumer_billing_entity_name | string | Name of the marketplace consumer billing entity. |
marketplace_provider_billing_entity_name | string | Name of the marketplace provider billing entity. |
moved_on | string | Date and time when the account was moved to a different organization. |
moved_to_organization | string | If the account was moved to a different organization, provides the name of that organization. |
must_change_password | boolean | Indicates whether the account administrator must change the password at the next login. |
old_account_url | string | If the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed |
organization_URL_expiration_on | string | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account. |
organization_name | string | Name of the organization. |
organization_old_url | string | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed. |
organization_old_url_last_used | string | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL. |
organization_old_url_saved_on | string | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved. |
polaris | boolean | Indicates whether the account is a Polaris account. |
region | string | Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). |
region_group | string | Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. |
restored_on | string | Date and time when the account was last restored. |
retention_time | integer | Number of days that historical data is retained for Time Travel. |
scheduled_deletion_time | string | Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
list_accounts | SELECT | endpoint | Lists the accessible accounts. |
create_account | INSERT | data__admin_name, data__edition, data__email, data__name, endpoint | Creates a account. You must provide the full account definition when creating a account. |
delete_account | DELETE | gracePeriodInDays, name, endpoint | Deletes the specified account. If you enable the ifExists parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful. |
undrop_account | EXEC | name, endpoint | Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). |
SELECT
examples
Lists the accessible accounts.
SELECT
name,
account_locator,
account_locator_url,
account_old_url_last_used,
account_old_url_saved_on,
account_url,
admin_name,
admin_password,
admin_rsa_public_key,
admin_user_type,
comment,
consumption_billing_entity_name,
created_on,
dropped_on,
edition,
email,
first_name,
is_events_account,
is_org_admin,
last_name,
managed_accounts,
marketplace_consumer_billing_entity_name,
marketplace_provider_billing_entity_name,
moved_on,
moved_to_organization,
must_change_password,
old_account_url,
organization_URL_expiration_on,
organization_name,
organization_old_url,
organization_old_url_last_used,
organization_old_url_saved_on,
polaris,
region,
region_group,
restored_on,
retention_time,
scheduled_deletion_time
FROM snowflake.account.accounts
WHERE endpoint = '{{ endpoint }}';
INSERT
example
Use the following StackQL query and manifest file to create a new accounts
resource.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO snowflake.account.accounts (
data__name,
data__region_group,
data__region,
data__edition,
data__comment,
data__admin_name,
data__admin_password,
data__admin_rsa_public_key,
data__admin_user_type,
data__first_name,
data__last_name,
data__email,
data__must_change_password,
data__polaris,
endpoint
)
SELECT
'{{ name }}',
'{{ region_group }}',
'{{ region }}',
'{{ edition }}',
'{{ comment }}',
'{{ admin_name }}',
'{{ admin_password }}',
'{{ admin_rsa_public_key }}',
'{{ admin_user_type }}',
'{{ first_name }}',
'{{ last_name }}',
'{{ email }}',
'{{ must_change_password }}',
'{{ polaris }}',
'{{ endpoint }}'
;
/*+ create */
INSERT INTO snowflake.account.accounts (
data__name,
data__admin_name,
data__email,
data__edition,
endpoint
)
SELECT
'{{ name }}',
'{{ admin_name }}',
'{{ email }}',
'{{ edition }}',
'{{ endpoint }}'
;
- name: accounts
props:
- name: data__admin_name
value: string
- name: data__edition
value: string
- name: data__email
value: string
- name: data__name
value: string
- name: endpoint
value: string
- name: name
value: string
- name: region_group
value: string
- name: region
value: string
- name: edition
value: string
- name: comment
value: string
- name: admin_name
value: string
- name: admin_password
value: string
- name: admin_rsa_public_key
value: string
- name: admin_user_type
value: string
- name: first_name
value: string
- name: last_name
value: string
- name: email
value: string
- name: must_change_password
value: boolean
- name: polaris
value: boolean
DELETE
example
Deletes the specified accounts
resource.
/*+ delete */
DELETE FROM snowflake.account.accounts
WHERE gracePeriodInDays = '{{ gracePeriodInDays }}'
AND name = '{{ name }}'
AND endpoint = '{{ endpoint }}';