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 | Optional Params | Description |
---|---|---|---|---|
list_accounts | SELECT | endpoint | like , showLimit , history | 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 | ifExists | 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). |
Optional Parameter Details
Name | Description | Type | Default |
---|---|---|---|
history | Optionally includes dropped accounts that have not yet been purged. | boolean | - |
ifExists | Query parameter that specifies how to handle the request for a resource that does not exist: - true : The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false : The endpoint throws an error if the resource doesn't exist. | boolean | false |
like | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | string | - |
showLimit | Query parameter to limit the maximum number of rows returned by a command. | integer | - |
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
Creates a account. You must provide the full account definition when creating a account.
- 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 }}'
;
# Description fields below are for documentation purposes only and are not required in the manifest
- name: accounts
props:
- name: endpoint
value: string
description: Required parameter for the accounts resource.
- name: name
value: string
description: >-
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. (Required
parameter for the accounts resource.)
- name: region_group
value: string
description: >-
Region group where the account is located. Note - This column is only
displayed for organizations that span multiple region groups.
- name: region
value: string
description: >-
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).
- name: edition
value: string
description: >-
Snowflake Edition of the account. (valid values: 'STANDARD',
'ENTERPRISE', 'BUSINESS_CRITICAL') (Required parameter for the accounts
resource.)
- name: comment
value: string
description: Optional comment in which to store information related to the account.
- name: admin_name
value: string
description: >-
Name of the account administrator. (Required parameter for the accounts
resource.)
- name: admin_password
value: string
description: Password for the account administrator.
- name: admin_rsa_public_key
value: string
description: RSA public key for the account administrator.
- name: admin_user_type
value: string
description: User type of the account administrator.
- name: first_name
value: string
description: First name of the account administrator.
- name: last_name
value: string
description: Last name of the account administrator.
- name: email
value: string
description: >-
Email address of the account administrator. (Required parameter for the
accounts resource.)
- name: must_change_password
value: boolean
description: >-
Indicates whether the account administrator must change the password at
the next login.
default: false
- name: polaris
value: boolean
description: Indicates whether the account is a Polaris account.
default: false
DELETE
example
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.
/*+ delete */
DELETE FROM snowflake.account.accounts
WHERE gracePeriodInDays = '{{ gracePeriodInDays }}'
AND name = '{{ name }}'
AND endpoint = '{{ endpoint }}';