Skip to content

Commit 93a9c3c

Browse files
authored
Merge pull request #230 from stackql/feature/provider-docs
added snowflake
2 parents 14bbc51 + 9a89b98 commit 93a9c3c

File tree

87 files changed

+6944
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+6944
-2
lines changed

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
pagerduty
105105
homebrew
106106
datadog
107+
snowflake
107108
)
108109
for i in "${array[@]}"
109110
do

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This repository contains documentation for StackQL providers, which is published
3232
| Netlify Deploy Confluent | [![Netlify Status](https://api.netlify.com/api/v1/badges/63149c2f-6c3d-43f1-be38-80c55c223ac0/deploy-status)](https://app.netlify.com/sites/stackql-confluent-docs/deploys) | [confluent-docs.stackql.io](https://confluent-docs.stackql.io)<br/>[confluent.stackql.io](https://confluent.stackql.io) |
3333
| Netlify Deploy Databricks Account | [![Netlify Status](https://api.netlify.com/api/v1/badges/9250b360-9e36-49dd-8cc8-b8cbe2f8d983/deploy-status)](https://app.netlify.com/sites/stackql-databricks-account-docs/deploys) | [databricks-account-docs.stackql.io](https://databricks-account-docs.stackql.io)<br/>[databricks-account.stackql.io](https://databricks-account.stackql.io) |
3434
| Netlify Deploy Databricks Workspace | [![Netlify Status](https://api.netlify.com/api/v1/badges/7456d122-1d4a-445c-b410-7a9aa1bd3f05/deploy-status)](https://app.netlify.com/sites/stackql-databricks-workspace-docs/deploys) | [databricks-workspace-docs.stackql.io](https://databricks-workspace-docs.stackql.io)<br/>[databricks-workspace.stackql.io](https://databricks-workspace.stackql.io) |
35+
| Netlify Deploy Snowflake | [![Netlify Status](https://api.netlify.com/api/v1/badges/e14bf4c8-1dca-4250-a19b-bffaa62fac9a/deploy-status)](https://app.netlify.com/projects/stackql-snowflake-docs/deploys) | [snowflake-docs.stackql.io](https://snowflake-docs.stackql.io)<br/>[snowflake.stackql.io](https://snowflake.stackql.io) |
3536

3637
## Adding Docs for a New Provider
3738

ci-scripts/get-providers-to-deploy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const allProviders = [
3232
'pagerduty',
3333
'datadog',
3434
'homebrew',
35+
'snowflake',
3536
rootName];
3637

3738
const appendToOutput = (providers) => {

docs/snowflake-docs/index.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: snowflake
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- snowflake
7+
- stackql
8+
- infrastructure-as-code
9+
- configuration-as-data
10+
- cloud inventory
11+
description: Query, deploy and manage Snowflake resources using SQL
12+
custom_edit_url: null
13+
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
14+
id: snowflake-doc
15+
slug: /providers/snowflake
16+
17+
---
18+
19+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
20+
21+
Snowflake for managing data warehousing, analytics, and secure data sharing with scalable cloud-native architecture and pay-as-you-go pricing.
22+
23+
24+
:::info Provider Summary
25+
26+
<div class="row">
27+
<div class="providerDocColumn">
28+
<span>total services:&nbsp;<b>32</b></span><br />
29+
<span>total resources:&nbsp;<b>47</b></span><br />
30+
</div>
31+
</div>
32+
33+
:::
34+
35+
See also:
36+
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
37+
* * *
38+
39+
## Installation
40+
41+
To pull the latest version of the `snowflake` provider, run the following command:
42+
43+
```bash
44+
REGISTRY PULL snowflake;
45+
```
46+
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).
47+
48+
## Authentication
49+
50+
The following system environment variables are used for authentication by default:
51+
52+
- <CopyableCode code="SNOWFLAKE_PAT" /> - Snowflake Programmatic Access Token (PAT) (see <a href="https://docs.snowflake.com/developer-guide/snowflake-rest-api/authentication#using-a-programmatic-access-token-pat">Using a programmatic access token (PAT)</a>)
53+
54+
These variables are sourced at runtime (from the local machine or as CI variables/secrets).
55+
56+
<details>
57+
58+
<summary>Using different environment variables</summary>
59+
60+
To use different environment variables (instead of the defaults), use the `--auth` flag of the `stackql` program. For example:
61+
62+
```bash
63+
64+
AUTH='{ "snowflake": { "type": "bearer", "credentialsenvvar": "YOUR_SNOWFLAKE_PAT_VAR" }}'
65+
stackql shell --auth="${AUTH}"
66+
67+
```
68+
or using PowerShell:
69+
70+
```powershell
71+
72+
$Auth = "{ 'snowflake': { 'type': 'bearer', 'credentialsenvvar': 'YOUR_SNOWFLAKE_PAT_VAR' }}"
73+
stackql.exe shell --auth=$Auth
74+
75+
```
76+
</details>
77+
78+
79+
## Services
80+
<div class="row">
81+
<div class="providerDocColumn">
82+
<a href="/providers/snowflake/account/">account</a><br />
83+
<a href="/providers/snowflake/alert/">alert</a><br />
84+
<a href="/providers/snowflake/api_integration/">api_integration</a><br />
85+
<a href="/providers/snowflake/catalog_integration/">catalog_integration</a><br />
86+
<a href="/providers/snowflake/compute_pool/">compute_pool</a><br />
87+
<a href="/providers/snowflake/database/">database</a><br />
88+
<a href="/providers/snowflake/database_role/">database_role</a><br />
89+
<a href="/providers/snowflake/dynamic_table/">dynamic_table</a><br />
90+
<a href="/providers/snowflake/event_table/">event_table</a><br />
91+
<a href="/providers/snowflake/external_volume/">external_volume</a><br />
92+
<a href="/providers/snowflake/function/">function</a><br />
93+
<a href="/providers/snowflake/grant/">grant</a><br />
94+
<a href="/providers/snowflake/iceberg_table/">iceberg_table</a><br />
95+
<a href="/providers/snowflake/image_repository/">image_repository</a><br />
96+
<a href="/providers/snowflake/managed_account/">managed_account</a><br />
97+
<a href="/providers/snowflake/network_policy/">network_policy</a><br />
98+
</div>
99+
<div class="providerDocColumn">
100+
<a href="/providers/snowflake/notebook/">notebook</a><br />
101+
<a href="/providers/snowflake/notification_integration/">notification_integration</a><br />
102+
<a href="/providers/snowflake/pipe/">pipe</a><br />
103+
<a href="/providers/snowflake/procedure/">procedure</a><br />
104+
<a href="/providers/snowflake/result/">result</a><br />
105+
<a href="/providers/snowflake/role/">role</a><br />
106+
<a href="/providers/snowflake/schema/">schema</a><br />
107+
<a href="/providers/snowflake/sqlapi/">sqlapi</a><br />
108+
<a href="/providers/snowflake/stage/">stage</a><br />
109+
<a href="/providers/snowflake/streams/">streams</a><br />
110+
<a href="/providers/snowflake/table/">table</a><br />
111+
<a href="/providers/snowflake/task/">task</a><br />
112+
<a href="/providers/snowflake/user/">user</a><br />
113+
<a href="/providers/snowflake/user_defined_function/">user_defined_function</a><br />
114+
<a href="/providers/snowflake/view/">view</a><br />
115+
<a href="/providers/snowflake/warehouse/">warehouse</a><br />
116+
</div>
117+
</div>
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
title: accounts
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- accounts
7+
- account
8+
- snowflake
9+
- infrastructure-as-code
10+
- configuration-as-data
11+
- cloud inventory
12+
description: Query, deploy and manage snowflake resources using SQL
13+
custom_edit_url: null
14+
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
15+
---
16+
17+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
18+
import Tabs from '@theme/Tabs';
19+
import TabItem from '@theme/TabItem';
20+
21+
Creates, updates, deletes, gets or lists a <code>accounts</code> resource.
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>accounts</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="snowflake.account.accounts" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <CopyableCode code="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. |
34+
| <CopyableCode code="account_locator" /> | `string` | System-assigned identifier of the acccount. |
35+
| <CopyableCode code="account_locator_url" /> | `string` | Legacy Snowflake account URL syntax that includes the region_name and account_locator. |
36+
| <CopyableCode code="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. |
37+
| <CopyableCode code="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. |
38+
| <CopyableCode code="account_url" /> | `string` | Preferred Snowflake account URL that includes the values of organization_name and account_name. |
39+
| <CopyableCode code="admin_name" /> | `string` | Name of the account administrator. |
40+
| <CopyableCode code="admin_password" /> | `string` | Password for the account administrator. |
41+
| <CopyableCode code="admin_rsa_public_key" /> | `string` | RSA public key for the account administrator. |
42+
| <CopyableCode code="admin_user_type" /> | `string` | User type of the account administrator. |
43+
| <CopyableCode code="comment" /> | `string` | Optional comment in which to store information related to the account. |
44+
| <CopyableCode code="consumption_billing_entity_name" /> | `string` | Name of the consumption billing entity. |
45+
| <CopyableCode code="created_on" /> | `string` | Date and time the account was created. |
46+
| <CopyableCode code="dropped_on" /> | `string` | Date and time the account was dropped. |
47+
| <CopyableCode code="edition" /> | `string` | Snowflake Edition of the account. |
48+
| <CopyableCode code="email" /> | `string` | Email address of the account administrator. |
49+
| <CopyableCode code="first_name" /> | `string` | First name of the account administrator. |
50+
| <CopyableCode code="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. |
51+
| <CopyableCode code="is_org_admin" /> | `boolean` | Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. |
52+
| <CopyableCode code="last_name" /> | `string` | Last name of the account administrator. |
53+
| <CopyableCode code="managed_accounts" /> | `integer` | Indicates how many managed accounts have been created by the account. |
54+
| <CopyableCode code="marketplace_consumer_billing_entity_name" /> | `string` | Name of the marketplace consumer billing entity. |
55+
| <CopyableCode code="marketplace_provider_billing_entity_name" /> | `string` | Name of the marketplace provider billing entity. |
56+
| <CopyableCode code="moved_on" /> | `string` | Date and time when the account was moved to a different organization. |
57+
| <CopyableCode code="moved_to_organization" /> | `string` | If the account was moved to a different organization, provides the name of that organization. |
58+
| <CopyableCode code="must_change_password" /> | `boolean` | Indicates whether the account administrator must change the password at the next login. |
59+
| <CopyableCode code="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 |
60+
| <CopyableCode code="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. |
61+
| <CopyableCode code="organization_name" /> | `string` | Name of the organization. |
62+
| <CopyableCode code="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. |
63+
| <CopyableCode code="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. |
64+
| <CopyableCode code="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. |
65+
| <CopyableCode code="polaris" /> | `boolean` | Indicates whether the account is a Polaris account. |
66+
| <CopyableCode code="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). |
67+
| <CopyableCode code="region_group" /> | `string` | Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. |
68+
| <CopyableCode code="restored_on" /> | `string` | Date and time when the account was last restored. |
69+
| <CopyableCode code="retention_time" /> | `integer` | Number of days that historical data is retained for Time Travel. |
70+
| <CopyableCode code="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. |
71+
72+
## Methods
73+
| Name | Accessible by | Required Params | Description |
74+
|:-----|:--------------|:----------------|:------------|
75+
| <CopyableCode code="list_accounts" /> | `SELECT` | <CopyableCode code="endpoint" /> | Lists the accessible accounts. |
76+
| <CopyableCode code="create_account" /> | `INSERT` | <CopyableCode code="data__admin_name, data__edition, data__email, data__name, endpoint" /> | Creates a account. You must provide the full account definition when creating a account. |
77+
| <CopyableCode code="delete_account" /> | `DELETE` | <CopyableCode code="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. |
78+
| <CopyableCode code="undrop_account" /> | `EXEC` | <CopyableCode code="name, endpoint" /> | Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). |
79+
80+
## `SELECT` examples
81+
82+
Lists the accessible accounts.
83+
84+
85+
```sql
86+
SELECT
87+
name,
88+
account_locator,
89+
account_locator_url,
90+
account_old_url_last_used,
91+
account_old_url_saved_on,
92+
account_url,
93+
admin_name,
94+
admin_password,
95+
admin_rsa_public_key,
96+
admin_user_type,
97+
comment,
98+
consumption_billing_entity_name,
99+
created_on,
100+
dropped_on,
101+
edition,
102+
email,
103+
first_name,
104+
is_events_account,
105+
is_org_admin,
106+
last_name,
107+
managed_accounts,
108+
marketplace_consumer_billing_entity_name,
109+
marketplace_provider_billing_entity_name,
110+
moved_on,
111+
moved_to_organization,
112+
must_change_password,
113+
old_account_url,
114+
organization_URL_expiration_on,
115+
organization_name,
116+
organization_old_url,
117+
organization_old_url_last_used,
118+
organization_old_url_saved_on,
119+
polaris,
120+
region,
121+
region_group,
122+
restored_on,
123+
retention_time,
124+
scheduled_deletion_time
125+
FROM snowflake.account.accounts
126+
WHERE endpoint = '{{ endpoint }}';
127+
```
128+
## `INSERT` example
129+
130+
Use the following StackQL query and manifest file to create a new <code>accounts</code> resource.
131+
132+
<Tabs defaultValue="all" values={[ { label: 'All Properties', value: 'all' }, { label: 'Manifest', value: 'manifest' } ]}>
133+
<TabItem value="all">
134+
135+
```sql
136+
/*+ create */
137+
INSERT INTO snowflake.account.accounts (
138+
data__name,
139+
data__admin_name,
140+
data__email,
141+
endpoint,
142+
data__edition
143+
)
144+
SELECT
145+
'{ email }',
146+
'{ name }',
147+
'{ admin_name }',
148+
'{ endpoint }',
149+
'{ edition }'
150+
;
151+
```
152+
</TabItem>
153+
<TabItem value="manifest">
154+
155+
```yaml
156+
- name: accounts
157+
props:
158+
- name: data__admin_name
159+
value: string
160+
- name: data__edition
161+
value: string
162+
- name: data__email
163+
value: string
164+
- name: data__name
165+
value: string
166+
- name: endpoint
167+
value: string
168+
169+
```
170+
</TabItem>
171+
</Tabs>
172+
173+
## `DELETE` example
174+
175+
Deletes the specified <code>accounts</code> resource.
176+
177+
```sql
178+
/*+ delete */
179+
DELETE FROM snowflake.account.accounts
180+
WHERE gracePeriodInDays = '{ gracePeriodInDays }' AND name = '{ name }' AND endpoint = '{ endpoint }';
181+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: account
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- account
7+
- snowflake
8+
- stackql
9+
- infrastructure-as-code
10+
- configuration-as-data
11+
- cloud inventory
12+
description: Query, deploy and manage snowflake resources using SQL
13+
custom_edit_url: null
14+
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
15+
---
16+
17+
account service documentation.
18+
19+
:::info Service Summary
20+
21+
<div class="row">
22+
<div class="providerDocColumn">
23+
<span>total resources:&nbsp;<b>1</b></span><br />
24+
</div>
25+
</div>
26+
27+
:::
28+
29+
## Resources
30+
<div class="row">
31+
<div class="providerDocColumn">
32+
<a href="/providers/snowflake/account/accounts/">accounts</a>
33+
</div>
34+
<div class="providerDocColumn">
35+
36+
</div>
37+
</div>

0 commit comments

Comments
 (0)