diff --git a/providers/src/snowflake/v00.00.00000/provider.yaml b/providers/src/snowflake/v00.00.00000/provider.yaml new file mode 100644 index 00000000..979dcc6b --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/provider.yaml @@ -0,0 +1,340 @@ +id: snowflake +name: snowflake +version: v00.00.00000 +providerServices: + account: + id: account:v00.00.00000 + name: account + preferred: true + service: + $ref: snowflake/v00.00.00000/services/account.yaml + title: Snowflake Account API + version: v00.00.00000 + description: The Snowflake Account API is a REST API that you can use to access, + update, and perform certain actions on Account resource in Snowflake. + alert: + id: alert:v00.00.00000 + name: alert + preferred: true + service: + $ref: snowflake/v00.00.00000/services/alert.yaml + title: Snowflake Alert API + version: v00.00.00000 + description: The Snowflake Alert API is a REST API that you can use to access, + update, and perform certain actions on Alert resource in a Snowflake database. + api_integration: + id: api_integration:v00.00.00000 + name: api_integration + preferred: true + service: + $ref: snowflake/v00.00.00000/services/api-integration.yaml + title: Snowflake API Integration API + version: v00.00.00000 + description: The Snowflake API Integration API is a REST API that you can use + to access, update, and perform certain actions on API Integration resource in + a Snowflake database. + catalog_integration: + id: catalog_integration:v00.00.00000 + name: catalog_integration + preferred: true + service: + $ref: snowflake/v00.00.00000/services/catalog-integration.yaml + title: Snowflake Catalog Integration API + version: v00.00.00000 + description: The Snowflake Catalog Integration API is a REST API that you can + use to access, update, and perform certain actions on Catalog Integration resource + in a Snowflake database. + compute_pool: + id: compute_pool:v00.00.00000 + name: compute_pool + preferred: true + service: + $ref: snowflake/v00.00.00000/services/compute-pool.yaml + title: Snowflake Compute Pools API + version: v00.00.00000 + description: The Snowflake Compute Pools API is a REST API that you can use to + access, update, and perform common actions on Compute Pool resources. + database_role: + id: database_role:v00.00.00000 + name: database_role + preferred: true + service: + $ref: snowflake/v00.00.00000/services/database-role.yaml + title: Snowflake Database Role API + version: v00.00.00000 + description: The Snowflake Database Role API is a REST API that you can use to + access, update, and perform certain actions on Database Role resource in a Snowflake + database. + database: + id: database:v00.00.00000 + name: database + preferred: true + service: + $ref: snowflake/v00.00.00000/services/database.yaml + title: Snowflake Database API + version: v00.00.00000 + description: The Snowflake Database API is a REST API that you can use to access, + update, and perform certain actions on Database resource in Snowflake. + dynamic_table: + id: dynamic_table:v00.00.00000 + name: dynamic_table + preferred: true + service: + $ref: snowflake/v00.00.00000/services/dynamic-table.yaml + title: Snowflake Dynamic Table API + version: v00.00.00000 + description: The Snowflake Dynamic Table API is a REST API that you can use to + access, update, and perform certain actions on Dynamic Tables resource in a + Snowflake database. + event_table: + id: event_table:v00.00.00000 + name: event_table + preferred: true + service: + $ref: snowflake/v00.00.00000/services/event-table.yaml + title: Snowflake Event Table API + version: v00.00.00000 + description: The Snowflake Event Table API is a REST API that you can use to access, + update, and perform certain actions on Event Table resource in a Snowflake database. + external_volume: + id: external_volume:v00.00.00000 + name: external_volume + preferred: true + service: + $ref: snowflake/v00.00.00000/services/external-volume.yaml + title: Snowflake External Volume API + version: v00.00.00000 + description: The Snowflake External Volume API is a REST API that you can use + to access, update, and perform certain actions on External Volume resource in + a Snowflake database. + function: + id: function:v00.00.00000 + name: function + preferred: true + service: + $ref: snowflake/v00.00.00000/services/function.yaml + title: Snowflake Function API + version: v00.00.00000 + description: The Snowflake Function API is a REST API that allows caller to create, + execute and drop functions in a Snowflake database. + grant: + id: grant:v00.00.00000 + name: grant + preferred: true + service: + $ref: snowflake/v00.00.00000/services/grant.yaml + title: Snowflake Grant API + version: v00.00.00000 + description: The Snowflake Grant API is a REST API that you can use to show or + manage privileges that have been provided to users and roles in a Snowflake + database. + iceberg_table: + id: iceberg_table:v00.00.00000 + name: iceberg_table + preferred: true + service: + $ref: snowflake/v00.00.00000/services/iceberg-table.yaml + title: Snowflake Iceberg Table API + version: v00.00.00000 + description: The Snowflake Iceberg Table API is a REST API that you can use to + access, update, and perform certain actions on Iceberg Table resource in a Snowflake + database. + image_repository: + id: image_repository:v00.00.00000 + name: image_repository + preferred: true + service: + $ref: snowflake/v00.00.00000/services/image-repository.yaml + title: Snowflake Image Repository API + version: v00.00.00000 + description: The Snowflake Image Repository API is a REST API that you can use + to access, update, and perform common actions on Image Repository resource in + Snowflake. + managed_account: + id: managed_account:v00.00.00000 + name: managed_account + preferred: true + service: + $ref: snowflake/v00.00.00000/services/managed-account.yaml + title: Snowflake Managed Account API + version: v00.00.00000 + description: The Snowflake Managed Account API is a REST API that you can use + to access, update, and perform certain actions on Managed Account resource in + Snowflake. + network_policy: + id: network_policy:v00.00.00000 + name: network_policy + preferred: true + service: + $ref: snowflake/v00.00.00000/services/network-policy.yaml + title: Snowflake Network Policy API + version: v00.00.00000 + description: The Snowflake Network Policy API is a REST API that you can use to + access, update, and perform certain actions on Network Policy resource in a + Snowflake database. + notebook: + id: notebook:v00.00.00000 + name: notebook + preferred: true + service: + $ref: snowflake/v00.00.00000/services/notebook.yaml + title: Snowflake Notebook API + version: v00.00.00000 + description: The Snowflake Notebook API is a REST API that you can use to access, + update, and perform certain actions on Notebook resource in a Snowflake database. + notification_integration: + id: notification_integration:v00.00.00000 + name: notification_integration + preferred: true + service: + $ref: snowflake/v00.00.00000/services/notification-integration.yaml + title: Snowflake Notification Integration API + version: v00.00.00000 + description: The Snowflake Notification Integration API is a REST API that you + can use to access, update, and perform certain actions on Notification Integration + resource in a Snowflake database. + pipe: + id: pipe:v00.00.00000 + name: pipe + preferred: true + service: + $ref: snowflake/v00.00.00000/services/pipe.yaml + title: Snowflake Pipe API + version: v00.00.00000 + description: The Snowflake Pipe API is a REST API that you can use to access, + update, and perform certain actions on Pipe resource in a Snowflake database. + procedure: + id: procedure:v00.00.00000 + name: procedure + preferred: true + service: + $ref: snowflake/v00.00.00000/services/procedure.yaml + title: Snowflake Procedure API + version: v00.00.00000 + description: The Snowflake Procedure API is a REST API that you can use to access, + update, and perform certain actions on Procedure resource in a Snowflake database. + result: + id: result:v00.00.00000 + name: result + preferred: true + service: + $ref: snowflake/v00.00.00000/services/result.yaml + title: Snowflake Result API + version: v00.00.00000 + description: The Snowflake Result API is a REST API that you can use to check + request status and fetch request response. + role: + id: role:v00.00.00000 + name: role + preferred: true + service: + $ref: snowflake/v00.00.00000/services/role.yaml + title: Snowflake Role API + version: v00.00.00000 + description: The Snowflake Role API is a REST API that you can use to access, + update, and perform certain actions on Role resource in a Snowflake database. + schema: + id: schema:v00.00.00000 + name: schema + preferred: true + service: + $ref: snowflake/v00.00.00000/services/schema.yaml + title: Snowflake Schema API + version: v00.00.00000 + description: The Snowflake Schema API is a REST API that you can use to access, + update, and perform certain actions on a Snowflake schema. + sqlapi: + id: sqlapi:v00.00.00000 + name: sqlapi + preferred: true + service: + $ref: snowflake/v00.00.00000/services/sqlapi.yaml + title: Snowflake SQL API + version: v00.00.00000 + description: 'The Snowflake SQL API is a REST API that you can use to access and + update data in a Snowflake database. ' + stage: + id: stage:v00.00.00000 + name: stage + preferred: true + service: + $ref: snowflake/v00.00.00000/services/stage.yaml + title: Snowflake Stage API + version: v00.00.00000 + description: The Snowflake Stage API is a REST API that you can use to access, + update, and perform certain actions on stage resources in a Snowflake database. + streams: + id: streams:v00.00.00000 + name: streams + preferred: true + service: + $ref: snowflake/v00.00.00000/services/streams.yaml + title: Snowflake Stream API + version: v00.00.00000 + description: The Snowflake Stream API is a REST API that you can use to access, + update, and perform certain actions on Stream resource in a Snowflake database. + table: + id: table:v00.00.00000 + name: table + preferred: true + service: + $ref: snowflake/v00.00.00000/services/table.yaml + title: Snowflake Table API + version: v00.00.00000 + description: The Snowflake Table API is a REST API that you can use to access, + update, and perform certain actions on Tables resource in a Snowflake database. + task: + id: task:v00.00.00000 + name: task + preferred: true + service: + $ref: snowflake/v00.00.00000/services/task.yaml + title: Snowflake Task API + version: v00.00.00000 + description: The Snowflake Task API is a REST API that you can use to access, + update, and perform certain actions on task resources in a Snowflake database. + user_defined_function: + id: user_defined_function:v00.00.00000 + name: user_defined_function + preferred: true + service: + $ref: snowflake/v00.00.00000/services/user-defined-function.yaml + title: Snowflake User Defined Function API + version: v00.00.00000 + description: The Snowflake User Defined Function API is a REST API that you can + use to access, update, and perform certain actions on User Defined Function + resource in a Snowflake database. + user: + id: user:v00.00.00000 + name: user + preferred: true + service: + $ref: snowflake/v00.00.00000/services/user.yaml + title: Snowflake User API + version: v00.00.00000 + description: The Snowflake User API is a REST API that you can use to access, + update, and perform certain action on Users in a Snowflake database. + view: + id: view:v00.00.00000 + name: view + preferred: true + service: + $ref: snowflake/v00.00.00000/services/view.yaml + title: Snowflake View API + version: v00.00.00000 + description: The Snowflake View API is a REST API that you can use to access, + update, and perform certain actions on View resource in a Snowflake database. + warehouse: + id: warehouse:v00.00.00000 + name: warehouse + preferred: true + service: + $ref: snowflake/v00.00.00000/services/warehouse.yaml + title: Snowflake Warehouse API + version: v00.00.00000 + description: The Snowflake Warehouse API is a REST API that you can use to access, + customize and manage virtual warehouse in a Snowflake account. +config: + auth: + type: bearer + credentialsenvvar: SNOWFLAKE_PAT diff --git a/providers/src/snowflake/v00.00.00000/services/account.yaml b/providers/src/snowflake/v00.00.00000/services/account.yaml new file mode 100644 index 00000000..96638367 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/account.yaml @@ -0,0 +1,1071 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Account API + description: The Snowflake Account API is a REST API that you can use to access, + update, and perform certain actions on Account resource in Snowflake. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/accounts: + get: + summary: List accounts. + tags: + - account + description: Lists the accessible accounts. + operationId: listAccounts + parameters: + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/showLimit' + - name: history + in: query + description: Optionally includes dropped accounts that have not yet been purged. + schema: + type: boolean + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Account' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create an account. + tags: + - account + description: Creates a account. You must provide the full account definition + when creating a account. + operationId: createAccount + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/accounts/{name}: + delete: + summary: Delete an account. + tags: + - account + description: 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. + operationId: deleteAccount + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: gracePeriodInDays + in: query + description: "Specifies the number of days during which the account can be\ + \ restored (\u201Cundropped\u201D). The minimum is 3 days and the maximum\ + \ is 90 days." + schema: + type: integer + required: true + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/accounts/{name}:undrop: + post: + summary: Restore an account. + tags: + - account + description: Restores a dropped account that has not yet been permanently deleted + (a dropped account that is within its grace period). + operationId: UndropAccount + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Account: + type: object + description: Snowflake account object. + properties: + organization_name: + type: string + readOnly: true + description: Name of the organization. + name: + $ref: '#/components/schemas/Identifier' + description: User-defined name that identifies an account within the organization. + region_group: + type: string + description: Region group where the account is located. Note - This column + is only displayed for organizations that span multiple region groups. + region: + type: 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). + edition: + type: string + description: Snowflake Edition of the account. + enum: + - STANDARD + - ENTERPRISE + - BUSINESS_CRITICAL + created_on: + type: string + format: date-time + readOnly: true + description: Date and time the account was created. + account_url: + type: string + readOnly: true + description: Preferred Snowflake account URL that includes the values of + organization_name and account_name. + account_locator: + type: string + readOnly: true + description: System-assigned identifier of the acccount. + account_locator_url: + type: string + readOnly: true + description: Legacy Snowflake account URL syntax that includes the region_name + and account_locator. + managed_accounts: + type: integer + readOnly: true + format: int64 + description: Indicates how many managed accounts have been created by the + account. + consumption_billing_entity_name: + type: string + readOnly: true + description: Name of the consumption billing entity. + marketplace_consumer_billing_entity_name: + type: string + readOnly: true + description: Name of the marketplace consumer billing entity. + marketplace_provider_billing_entity_name: + type: string + readOnly: true + description: Name of the marketplace provider billing entity. + old_account_url: + type: string + readOnly: true + description: 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 + comment: + type: string + description: Optional comment in which to store information related to the + account. + is_org_admin: + type: boolean + readOnly: true + description: Indicates whether the ORGADMIN role is enabled in an account. + If TRUE, the role is enabled. + retention_time: + type: integer + readOnly: true + description: Number of days that historical data is retained for Time Travel. + dropped_on: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time the account was dropped. + scheduled_deletion_time: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time when the account is scheduled to be permanently + deleted. Accounts are deleted within one hour after the scheduled time. + restored_on: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time when the account was last restored. + account_old_url_saved_on: + type: string + format: date-time + readOnly: true + description: 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_old_url_last_used: + type: string + format: date-time + readOnly: true + description: If the original account URL was saved when the account was + renamed, indicates the last time the account was accessed using the original + URL. + organization_old_url: + type: string + readOnly: true + description: "If the account\u2019s 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_saved_on: + type: string + readOnly: true + format: date-time + description: "If the account\u2019s 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." + organization_old_url_last_used: + type: string + readOnly: true + format: date-time + description: "If the account\u2019s 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_URL_expiration_on: + type: string + format: date-time + readOnly: true + nullable: true + description: "If the account\u2019s 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." + moved_on: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time when the account was moved to a different organization. + is_events_account: + type: boolean + readOnly: true + description: Indicates whether an account is an events account. For more + information, see Set up logging and event sharing for an application. + moved_to_organization: + type: string + readOnly: true + description: If the account was moved to a different organization, provides + the name of that organization. + admin_name: + type: string + description: Name of the account administrator. + writeOnly: true + nullable: true + admin_password: + type: string + description: Password for the account administrator. + writeOnly: true + format: password + admin_rsa_public_key: + type: string + description: RSA public key for the account administrator. + writeOnly: true + format: password + admin_user_type: + type: string + description: User type of the account administrator. + writeOnly: true + first_name: + type: string + description: First name of the account administrator. + writeOnly: true + last_name: + type: string + description: Last name of the account administrator. + writeOnly: true + email: + type: string + description: Email address of the account administrator. + writeOnly: true + nullable: true + must_change_password: + type: boolean + description: Indicates whether the account administrator must change the + password at the next login. + default: false + writeOnly: true + polaris: + type: boolean + description: Indicates whether the account is a Polaris account. + default: false + writeOnly: true + required: + - name + - admin_name + - email + - edition + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + accounts: + methods: + list_accounts: + operation: + $ref: '#/paths/~1api~1v2~1accounts/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_account: + operation: + $ref: '#/paths/~1api~1v2~1accounts/post' + response: + mediaType: '' + openAPIDocKey: '200' + delete_account: + operation: + $ref: '#/paths/~1api~1v2~1accounts~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_account: + operation: + $ref: '#/paths/~1api~1v2~1accounts~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/accounts/methods/list_accounts' + insert: + - $ref: '#/components/x-stackQL-resources/accounts/methods/create_account' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/accounts/methods/delete_account' + replace: [] + id: snowflake.account.accounts + name: accounts + title: Accounts +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] +tags: +- name: account diff --git a/providers/src/snowflake/v00.00.00000/services/alert.yaml b/providers/src/snowflake/v00.00.00000/services/alert.yaml new file mode 100644 index 00000000..77082efb --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/alert.yaml @@ -0,0 +1,1083 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Alert API + description: The Snowflake Alert API is a REST API that you can use to access, update, + and perform certain actions on Alert resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/alerts: + get: + summary: List alerts + tags: + - alert + description: List alerts + operationId: listAlerts + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Alert' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create an alert + tags: + - alert + description: Create an alert + operationId: createAlert + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Alert' + /api/v2/databases/{database}/schemas/{schema}/alerts/{name}: + get: + summary: Fetch an alert + tags: + - alert + description: Fetch an alert + operationId: fetchAlert + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/Alert' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete an alert + tags: + - alert + description: Delete an alert + operationId: deleteAlert + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/alerts/{name}:clone: + post: + summary: Create a new alert by cloning from the specified resource + tags: + - alert + description: Create a new alert by cloning from the specified resource + operationId: cloneAlert + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: targetDatabase + description: Database of the newly created resource. Defaults to the source's + database + in: query + required: true + schema: + type: string + - name: targetSchema + description: Schema of the newly created resource. Defaults to the source's + schema + in: query + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AlertClone' + /api/v2/databases/{database}/schemas/{schema}/alerts/{name}:execute: + post: + summary: Execute an alert + tags: + - alert + description: Execute an alert + operationId: executeAlert + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Alert: + type: object + description: A Snowflake alert + properties: + name: + type: string + description: Name of the alert + comment: + type: string + description: user comment associated to an object in the dictionary + schedule: + $ref: '#/components/schemas/Schedule' + description: The schedule the alert runs under + warehouse: + type: string + description: The warehouse the alert runs in + condition: + type: string + description: The SQL statement that must be evaluated to determine whether + to trigger the alert + action: + type: string + description: The SQL statement to execute when the alert is triggered + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the alert was created. + database_name: + type: string + readOnly: true + description: Database in which the alert is stored + schema_name: + type: string + readOnly: true + description: Schema in which the alert is stored + owner: + type: string + readOnly: true + description: Role that owns the alert + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the alert + state: + type: string + readOnly: true + description: The current state of the alert + required: + - name + - schedule + - condition + - action + Schedule: + type: object + properties: + schedule_type: + type: string + description: Type of the schedule, can be either CRON_TYPE or MINUTES_TYPE + required: + - schedule_type + discriminator: + propertyName: schedule_type + mapping: + CRON_TYPE: CronSchedule + SCHEDULE_TYPE: MinutesSchedule + CronSchedule: + type: object + allOf: + - $ref: '#/components/schemas/Schedule' + properties: + cron_expr: + type: string + description: A cron expression for the scheduled execution. + timezone: + type: string + description: The time zone for the schedule. + required: + - cron_expr + - timezone + MinutesSchedule: + type: object + allOf: + - $ref: '#/components/schemas/Schedule' + properties: + minutes: + type: integer + required: + - minutes + AlertClone: + type: object + properties: + name: + type: string + description: Name of the alert + point_of_time: + $ref: '#/components/schemas/PointOfTime' + description: 'Type of the point of time. Possible values include: + + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. + + - `offset`: Interval relative to ''now.'' Example: `1 day`. + + - `statement`: ID of a query statement to use as the reference point for + Time + Travel. + + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime. + + ' + required: + - name + PointOfTime: + type: object + properties: + point_of_time_type: + type: string + description: 'Type of the point of time. Possible values include: timestamp, + offset, statement' + reference: + type: string + enum: + - at + - before + x-enum-varnames: + - AT + - BEFORE + description: Relation to the point of time. Currently, the API supports + `at` and `before` + required: + - point_of_time_type + - reference + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + required: + - timestamp + PointOfTimeOffset: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + offset: + type: string + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + required: + - offset + PointOfTimeStatement: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + required: + - statement + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + alerts: + methods: + list_alerts: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_alert: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_alert: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_alert: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + clone_alert: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + execute_alert: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1alerts~1{name}:execute/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/alerts/methods/list_alerts' + - $ref: '#/components/x-stackQL-resources/alerts/methods/fetch_alert' + insert: + - $ref: '#/components/x-stackQL-resources/alerts/methods/create_alert' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/alerts/methods/delete_alert' + replace: [] + id: snowflake.alert.alerts + name: alerts + title: Alerts +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/api-integration.yaml b/providers/src/snowflake/v00.00.00000/services/api-integration.yaml new file mode 100644 index 00000000..a7b757aa --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/api-integration.yaml @@ -0,0 +1,1051 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake API Integration API + description: The Snowflake API Integration API is a REST API that you can use to + access, update, and perform certain actions on API Integration resource in a Snowflake + database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/api-integrations: + get: + summary: List API integrations + tags: + - api-integration + description: List API integrations + operationId: listAPIIntegrations + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create an API integration + tags: + - api-integration + description: Create an API integration + operationId: createAPIIntegration + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApiIntegration' + /api/v2/api-integrations/{name}: + get: + summary: Fetch an API integration + tags: + - api-integration + description: Fetch an API integration + operationId: fetchAPIIntegration + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create an (or alter an existing) API integration + tags: + - api-integration + description: Create an (or alter an existing) API integration. Note that API_KEY + is not currently altered by this operation and is supported for a newly-created + object only. Unsetting API_BLOCKED_PREFIXES is also unsupported. + operationId: createOrAlterAPIIntegration + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApiIntegration' + delete: + summary: Delete an API integration + tags: + - api-integration + description: Delete an API integration + operationId: deleteAPIIntegration + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + ApiIntegration: + type: object + description: A Snowflake API integration object. + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the API integration. + api_hook: + $ref: '#/components/schemas/ApiHook' + api_allowed_prefixes: + type: array + items: + type: string + description: A comma-separated list of endpoints and resources that Snowflake + can access. + api_blocked_prefixes: + type: array + items: + type: string + description: A comma-separated list of endpoints and resources that are + not allowed to be called from Snowflake. + nullable: true + enabled: + type: boolean + description: Whether the API integration is enabled. + comment: + type: string + description: Comment for the API integration. + nullable: true + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the API integration was created. + required: + - name + - api_hook + - api_allowed_prefixes + - enabled + ApiHook: + type: object + properties: + type: + type: string + enum: + - AWS + - AZURE + - GC + - GIT + description: Type of ApiHook, can be AWS, AZURE, GC or GIT. + required: + - type + discriminator: + propertyName: type + mapping: + AWS: AwsHook + AZURE: AzureHook + GC: GoogleCloudHook + GIT: GitHook + AwsHook: + type: object + allOf: + - $ref: '#/components/schemas/ApiHook' + properties: + api_provider: + type: string + enum: + - AWS_API_GATEWAY + - AWS_PRIVATE_API_GATEWAY + - AWS_GOV_API_GATEWAY + - AWS_GOV_PRIVATE_API_GATEWAY + api_aws_role_arn: + type: string + description: The ARN (Amazon resource name) of the IAM role. + api_key: + $ref: '#/components/schemas/ApiKey' + required: + - api_provider + - api_aws_role_arn + AzureHook: + type: object + allOf: + - $ref: '#/components/schemas/ApiHook' + properties: + api_provider: + type: string + enum: + - AZURE_API_MANAGEMENT + - AZURE_PRIVATE_API_MANAGEMENT + azure_tenant_id: + type: string + description: The ID of the Office 365 tenant that all Azure API Management + instances belong to. + azure_ad_application_id: + type: string + description: The application ID of the Azure Active Directory application. + api_key: + $ref: '#/components/schemas/ApiKey' + required: + - api_provider + - azure_tenant_id + - azure_ad_application_id + GoogleCloudHook: + type: object + allOf: + - $ref: '#/components/schemas/ApiHook' + properties: + api_provider: + type: string + enum: + - GOOGLE_API_GATEWAY + google_audience: + type: string + description: Used as an audience claim when generating the JTW (JSON Web + Token) to authenticate to the Google API Gateway. + api_key: + $ref: '#/components/schemas/ApiKey' + required: + - api_provider + - google_audience + GitHook: + type: object + allOf: + - $ref: '#/components/schemas/ApiHook' + properties: + allow_any_secret: + type: boolean + default: false + description: Whether to allow any Snowflake secret when accessing the Git + repository. This setting is ignored if allowed_authentication_secrets + is present. + allowed_authentication_secrets: + type: array + items: + type: string + description: A comma-separated list of fully-qualified Snowflake secret + names that UDF or procedure handler code can use when accessing the Git + repository. + nullable: true + allowed_api_authentication_integrations: + type: array + items: + type: string + description: A comma-separated list of Snowflake security integration names + that UDF or procedure handler code can use when accessing the Git repository. + If empty, allow no integrations. + nullable: true + ApiKey: + type: string + description: An alphanumeric string that is used to identify API clients and + control access to the API, also called a subscription key. + nullable: true + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + api_integrations: + methods: + list_api_integrations: + operation: + $ref: '#/paths/~1api~1v2~1api-integrations/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_api_integration: + operation: + $ref: '#/paths/~1api~1v2~1api-integrations/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_api_integration: + operation: + $ref: '#/paths/~1api~1v2~1api-integrations~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_api_integration: + operation: + $ref: '#/paths/~1api~1v2~1api-integrations~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_api_integration: + operation: + $ref: '#/paths/~1api~1v2~1api-integrations~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/api_integrations/methods/list_api_integrations' + - $ref: '#/components/x-stackQL-resources/api_integrations/methods/fetch_api_integration' + insert: + - $ref: '#/components/x-stackQL-resources/api_integrations/methods/create_api_integration' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/api_integrations/methods/delete_api_integration' + replace: + - $ref: '#/components/x-stackQL-resources/api_integrations/methods/create_or_alter_api_integration' + id: snowflake.api_integration.api_integrations + name: api_integrations + title: Api Integrations +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/catalog-integration.yaml b/providers/src/snowflake/v00.00.00000/services/catalog-integration.yaml new file mode 100644 index 00000000..541237dc --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/catalog-integration.yaml @@ -0,0 +1,1002 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Catalog Integration API + description: The Snowflake Catalog Integration API is a REST API that you can use + to access, update, and perform certain actions on Catalog Integration resource + in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/catalog-integrations: + get: + summary: List catalog integrations. + tags: + - catalog-integration + description: List catalog integrations. + operationId: listCatalogIntegrations + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CatalogIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a catalog integration. + tags: + - catalog-integration + description: Create a catalog integration. + operationId: createCatalogIntegration + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogIntegration' + /api/v2/catalog-integrations/{name}: + get: + summary: Fetch a catalog integration. + tags: + - catalog-integration + description: Fetch a catalog integration. + operationId: fetchCatalogIntegration + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a catalog integration. + tags: + - catalog-integration + description: Delete a catalog integration. + operationId: deleteCatalogIntegration + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + CatalogIntegration: + type: object + description: Catalog integration + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the catalog integration. + catalog: + $ref: '#/components/schemas/Catalog' + description: Type of catalog and its parameters. + table_format: + type: string + enum: + - ICEBERG + description: Table format of the catalog. + enabled: + type: boolean + description: 'whether this catalog integration is available to use for Iceberg + tables. ' + comment: + type: string + description: Comment. + type: + type: string + readOnly: true + description: Type of the integration. Always CATALOG. + category: + type: string + readOnly: true + description: Category of the integration. Always CATALOG. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the catalog integration was created. + required: + - name + - catalog + - table_format + - enabled + Catalog: + type: object + properties: + catalog_source: + type: string + enum: + - GLUE + - OBJECT_STORE + - POLARIS + description: Type of external catalog + required: + - catalog_source + discriminator: + propertyName: catalog_source + mapping: + GLUE: Glue + OBJECT_STORE: ObjectStore + POLARIS: Polaris + Glue: + type: object + allOf: + - $ref: '#/components/schemas/Catalog' + properties: + glue_aws_role_arn: + type: string + description: ARN for AWS role to assume + glue_catalog_id: + type: string + description: Glue catalog id + glue_region: + type: string + description: AWS region of the Glue catalog. Must be specified if the Snowflake + account is not hosted on AWS. + catalog_namespace: + type: string + description: default AWS Glue catalog namespace for all Iceberg table that + use this catalog integration + required: + - glue_aws_role_arn + - glue_catalog_id + - catalog_namespace + ObjectStore: + type: object + allOf: + - $ref: '#/components/schemas/Catalog' + Polaris: + type: object + allOf: + - $ref: '#/components/schemas/Catalog' + properties: + catalog_namespace: + type: string + description: Default Polaris namespace used by all Iceberg tables associated + with this catalog integration + rest_config: + $ref: '#/components/schemas/RestConfig' + description: Information about the Polaris catalog account and catalog name. + rest_authentication: + $ref: '#/components/schemas/RestAuthentication' + description: Authentication details that Snowflake uses to connect to the + Polaris catalog. + required: + - catalog_namespace + - rest_config + - rest_authentication + RestConfig: + type: object + properties: + catalog_uri: + type: string + description: Customer's Polaris account locator URL + warehouse: + type: string + description: Name of the catalog to use in Polaris + required: + - catalog_uri + - warehouse + RestAuthentication: + type: object + properties: + type: + type: string + enum: + - OAUTH + description: Authentication type. + required: + - type + discriminator: + propertyName: type + mapping: + OAUTH: OAuth + OAuth: + type: object + allOf: + - $ref: '#/components/schemas/RestAuthentication' + properties: + oauth_client_id: + type: string + description: The client ID of the OAuth2 credential associated with the + Polaris service connection. + oauth_client_secret: + type: string + description: The secret for the OAuth2 credential associated with the Polaris + service connection. + oauth_allowed_scopes: + type: array + items: + type: string + description: The scope of the OAuth token. Only one scope is included in + the Iceberg REST API specification, but catalogs can support more than + one scope in their implementation. + required: + - oauth_client_id + - oauth_client_secret + - oauth_allowed_scopes + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + catalog_integrations: + methods: + list_catalog_integrations: + operation: + $ref: '#/paths/~1api~1v2~1catalog-integrations/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_catalog_integration: + operation: + $ref: '#/paths/~1api~1v2~1catalog-integrations/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_catalog_integration: + operation: + $ref: '#/paths/~1api~1v2~1catalog-integrations~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_catalog_integration: + operation: + $ref: '#/paths/~1api~1v2~1catalog-integrations~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/catalog_integrations/methods/list_catalog_integrations' + - $ref: '#/components/x-stackQL-resources/catalog_integrations/methods/fetch_catalog_integration' + insert: + - $ref: '#/components/x-stackQL-resources/catalog_integrations/methods/create_catalog_integration' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/catalog_integrations/methods/delete_catalog_integration' + replace: [] + id: snowflake.catalog_integration.catalog_integrations + name: catalog_integrations + title: Catalog Integrations diff --git a/providers/src/snowflake/v00.00.00000/services/compute-pool.yaml b/providers/src/snowflake/v00.00.00000/services/compute-pool.yaml new file mode 100644 index 00000000..b1619ac2 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/compute-pool.yaml @@ -0,0 +1,1178 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Compute Pools API + description: The Snowflake Compute Pools API is a REST API that you can use to access, + update, and perform common actions on Compute Pool resources. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/compute-pools: + get: + summary: Lists compute pools. + tags: + - compute-pool + description: Lists the compute pools under the account. + operationId: listComputePools + parameters: + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ComputePool' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Creates a compute pool. + tags: + - compute-pool + description: Creates a compute pool, with standard create modifiers as query + parameters. See the Compute Pool component definition for what is required + to be provided in the request body. + operationId: createComputePool + parameters: + - $ref: '#/components/parameters/createMode' + - name: initiallySuspended + in: query + description: Specifies whether the compute pool is created initially in the + suspended state. + schema: + type: boolean + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}: + get: + summary: Fetches a compute pool. + tags: + - compute-pool + description: Fetches a named compute pool. You can get the name of the compute + pool from the `/api/v2/compute-pools` GET request. + operationId: fetchComputePool + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) compute pool. + tags: + - compute-pool + description: Create a (or alter an existing) compute pool. Even if the operation + is just an alter, the full property set must be provided. + operationId: createOrAlterComputePool + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Deletes a compute pool. + tags: + - compute-pool + description: Deletes a compute pool with the given name. If you enable the `ifExists` + parameter, the operation succeeds even if the object does not exist. Otherwise, + a 404 failure is returned if the object does not exist. + operationId: deleteComputePool + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:resume: + post: + summary: Resumes a suspended compute pool. + tags: + - compute-pool + description: Resume a compute pool, if suspended. If the specified compute pool + is already running, no action is taken. + operationId: resumeComputePool + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:suspend: + post: + summary: Suspends an active compute pool. + tags: + - compute-pool + description: Suspend a compute pool, if active. If the specified compute pool + is already suspended, no action is taken. + operationId: suspendComputePool + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:stopallservices: + post: + deprecated: true + summary: Stops all services on the compute pool. + tags: + - compute-pool + description: Stops all services in the compute pool. Deprecated - use :stop-all-services + instead. + operationId: stopAllServicesInComputePoolDeprecated + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:stop-all-services: + post: + summary: Stops all services on the compute pool. + tags: + - compute-pool + description: Stops all services in the compute pool. + operationId: stopAllServicesInComputePool + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + ComputePool: + type: object + description: A Snowflake compute pool definition. + properties: + name: + $ref: '#/components/schemas/Identifier' + min_nodes: + type: integer + description: Minimum number of nodes for the compute pool. + max_nodes: + type: integer + description: Maximum number of nodes for the compute pool. + instance_family: + type: string + description: Instance family for the compute pool. + auto_resume: + type: boolean + description: Whether Snowflake automatically resumes the compute pool when + any statement that requires the compute pool is submitted. + comment: + type: string + description: Comment describing the compute pool. + state: + type: string + description: Current state of the compute pool. Possible values include + UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, and RESIZING. + readOnly: true + enum: + - UNKNOWN + - STARTING + - IDLE + - ACTIVE + - STOPPING + - SUSPENDED + - RESIZING + num_services: + type: integer + description: Number of services on the compute pool. + readOnly: true + num_jobs: + type: integer + description: Number of jobs on the compute pool. + readOnly: true + auto_suspend_secs: + type: integer + description: Number of seconds until the compute pool automatically suspends. + format: int64 + active_nodes: + type: integer + description: Number of currently active nodes on the compute pool. + readOnly: true + idle_nodes: + type: integer + description: Number of currently idle nodes on the compute pool. + readOnly: true + target_nodes: + type: integer + description: Number of target nodes on the compute pool. + readOnly: true + created_on: + type: string + description: Time the compute pool was created. + format: date-time + readOnly: true + resumed_on: + type: string + description: Time the compute pool was last resumed. + format: date-time + readOnly: true + updated_on: + type: string + description: Time the compute pool was last updated. + format: date-time + readOnly: true + owner: + type: string + description: Identifier for the current owner of the compute pool. + readOnly: true + is_exclusive: + type: boolean + description: Whether a compute pool is created exclusively for a Snowflake + Native App. + readOnly: true + application: + type: string + description: Name of the Snowflake Native App if the compute pool is created + exclusively for the app. + readOnly: true + budget: + type: string + description: The name of the budget monitoring the credit usage of the compute + pool. + readOnly: true + error_code: + type: string + description: Current error the compute pool hit if any. + readOnly: true + status_message: + type: string + description: Current status of the compute pool if any. + readOnly: true + example: + name: compute_pool_name + warehouse: test_wh + min_nodes: 4 + max_nodes: 5 + instance_family: compute_pool_family + auto_resume: false + comment: test_comment + state: STARTING + num_services: 1 + num_jobs: 3 + auto_suspend_secs: 10 + active_nodes: 2 + idle_nodes: 2 + target_nodes: 4 + created_on: '2024-06-18T01:01:01.111111' + updated_on: '2024-06-18T01:01:01.111111' + resumed_on: '2024-06-18T01:01:01.111111' + owner: POOL_ADMIN + is_exclusive: true + application: testapp + budget: testbudget + error_code: '392507' + status_message: Compute Pool is resizing for last 10 minutes. We have observed + CAPACITY_ERROR. Please refer to our documentation. + required: + - name + - instance_family + - min_nodes + - max_nodes + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + compute_pools: + methods: + list_compute_pools: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + resume_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}:resume/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}:suspend/post' + response: + mediaType: '' + openAPIDocKey: '200' + stop_all_services_in_compute_pool_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}:stopallservices/post' + response: + mediaType: '' + openAPIDocKey: '200' + stop_all_services_in_compute_pool: + operation: + $ref: '#/paths/~1api~1v2~1compute-pools~1{name}:stop-all-services/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/compute_pools/methods/list_compute_pools' + - $ref: '#/components/x-stackQL-resources/compute_pools/methods/fetch_compute_pool' + insert: + - $ref: '#/components/x-stackQL-resources/compute_pools/methods/create_compute_pool' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/compute_pools/methods/delete_compute_pool' + replace: + - $ref: '#/components/x-stackQL-resources/compute_pools/methods/create_or_alter_compute_pool' + id: snowflake.compute_pool.compute_pools + name: compute_pools + title: Compute Pools +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] +tags: +- name: compute-pool diff --git a/providers/src/snowflake/v00.00.00000/services/database-role.yaml b/providers/src/snowflake/v00.00.00000/services/database-role.yaml new file mode 100644 index 00000000..e0575a8d --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/database-role.yaml @@ -0,0 +1,1328 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Database Role API + description: The Snowflake Database Role API is a REST API that you can use to access, + update, and perform certain actions on Database Role resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/database-roles: + get: + summary: List database roles + tags: + - database-role + description: List database roles + operationId: listDatabaseRoles + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DatabaseRole' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a database role + tags: + - database-role + description: Create a database role + operationId: createDatabaseRole + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseRole' + /api/v2/databases/{database}/database-roles/{name}: + delete: + summary: Delete a database role + tags: + - database-role + description: Delete a database role + operationId: deleteDatabaseRole + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/database-roles/{name}:clone: + post: + summary: Create a new database role by cloning from the specified resource + tags: + - database-role + description: Create a new database role by cloning from the specified resource + operationId: cloneDatabaseRole + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: targetDatabase + description: Database of the target resource. Defaults to the source's database + in: query + required: false + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseRoleClone' + /api/v2/databases/{database}/database-roles/{name}/grants: + get: + summary: List all grants to the role + tags: + - database-role + description: List all grants to the role + operationId: listGrants + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Grant privileges to the role + tags: + - database-role + description: Grant privileges to the role + operationId: grantPrivileges + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/databases/{database}/database-roles/{name}/grants:revoke: + post: + summary: Revoke grants from the role + tags: + - database-role + description: Revoke grants from the role + operationId: revokeGrants + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/mode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/databases/{database}/database-roles/{name}/future-grants: + get: + summary: List all future grants to the role + tags: + - database-role + description: List all future grants to the role + operationId: listFutureGrants + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Grant future privileges to the role + tags: + - database-role + description: Grant future privileges to the role + operationId: grantFuturePrivileges + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/databases/{database}/database-roles/{name}/future-grants:revoke: + post: + summary: Revoke future grants from the role + tags: + - database-role + description: Revoke future grants from the role + operationId: revokeFutureGrants + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/mode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' +components: + schemas: + DatabaseRole: + type: object + description: A Snowflake database role + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the database role + comment: + type: string + description: User comment associated to an object in the dictionary + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the database role was created + granted_to_roles: + type: integer + format: int64 + readOnly: true + description: How many roles this database role has been granted to + granted_to_database_roles: + type: integer + format: int64 + readOnly: true + description: How many database roles this database role has been granted + to + granted_database_roles: + type: integer + format: int64 + readOnly: true + description: How many database roles this database role has been granted + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the database role + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the database role + required: + - name + DatabaseRoleClone: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the database role + required: + - name + Grant: + type: object + properties: + securable: + $ref: '#/components/schemas/Securable' + description: Securable of the grant + containing_scope: + $ref: '#/components/schemas/ContainingScope' + description: Containing scope of the grant + securable_type: + type: string + description: Type of the securable to be granted. + grant_option: + type: boolean + description: If true, allows the recipient role to grant the privileges + to other roles. + privileges: + type: array + items: + type: string + description: List of privileges to be granted. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the grant was created + granted_by: + type: string + readOnly: true + description: The role that granted this privilege to this grantee + required: + - securable_type + Securable: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable if applicable. + service: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Service name of the securable if applicable. + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the securable if applicable. + required: + - name + ContainingScope: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable scope if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable scope if applicable. + required: + - database + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + database_roles: + methods: + list_database_roles: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_database_role: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles/post' + response: + mediaType: '' + openAPIDocKey: '200' + delete_database_role: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + clone_database_role: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/database_roles/methods/list_database_roles' + insert: + - $ref: '#/components/x-stackQL-resources/database_roles/methods/create_database_role' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/database_roles/methods/delete_database_role' + replace: [] + id: snowflake.database_role.database_roles + name: database_roles + title: Database Roles + grants: + methods: + list_grants: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1grants/get' + response: + mediaType: application/json + openAPIDocKey: '200' + grant_privileges: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1grants/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_grants: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1grants:revoke/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants/methods/list_grants' + insert: + - $ref: '#/components/x-stackQL-resources/grants/methods/grant_privileges' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/grants/methods/revoke_grants' + replace: [] + id: snowflake.database_role.grants + name: grants + title: Grants + future_grants: + methods: + list_future_grants: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1future-grants/get' + response: + mediaType: application/json + openAPIDocKey: '200' + grant_future_privileges: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1future-grants/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_future_grants: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1database-roles~1{name}~1future-grants:revoke/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/list_future_grants' + insert: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/grant_future_privileges' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/revoke_future_grants' + replace: [] + id: snowflake.database_role.future_grants + name: future_grants + title: Future Grants +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/database.yaml b/providers/src/snowflake/v00.00.00000/services/database.yaml new file mode 100644 index 00000000..f76cce4c --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/database.yaml @@ -0,0 +1,1596 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Database API + description: The Snowflake Database API is a REST API that you can use to access, + update, and perform certain actions on Database resource in Snowflake. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases: + get: + summary: List databases. + tags: + - database + description: Lists the accessible databases. + operationId: listDatabases + parameters: + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: history + in: query + description: Optionally includes dropped databases that have not yet been + purged. + schema: + type: boolean + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Database' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a database. + tags: + - database + description: Creates a database, with modifiers as query parameters. You must + provide the full database definition when creating a database. + operationId: createDatabase + parameters: + - $ref: '#/components/parameters/createMode' + - name: kind + in: query + description: Type of database to create. Currently, Snowflake supports only + `transient` and `permanent` (also represented by the empty string). + schema: + type: string + deprecated: true + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Database' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases:from-share: + post: + summary: Create a database from a share. + tags: + - database + description: Creates a database from a given share. + operationId: createDatabaseFromShare + parameters: + - $ref: '#/components/parameters/createMode' + - name: share + in: query + description: ID of the share from which to create the database, in the form + ".". + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseFromShare' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}:from_share: + post: + summary: Create a database from a share. + tags: + - database + description: Creates a database from a given share. + operationId: createDatabaseFromShareDeprecated + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: share + in: query + description: ID of the share from which to create the database, in the form + ".". + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + deprecated: true + /api/v2/databases/{name}:clone: + post: + summary: Clone a database. + tags: + - database + description: Clones an existing database, with modifiers as query parameters. + You must provide the full database definition when cloning an existing database. + operationId: cloneDatabase + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: kind + in: query + description: Type of database to create. Currently, Snowflake supports only + `transient` and `permanent` (also represented by the empty string). + schema: + type: string + deprecated: true + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseClone' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}: + get: + tags: + - database + description: Fetches a database. + operationId: fetchDatabase + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Database' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a new, or alters an existing, database. + tags: + - database + description: Creates a new, or alters an existing, database. You must provide + the full database definition even when altering an existing database. + operationId: createOrAlterDatabase + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Database' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a database. + tags: + - database + description: Deletes the specified database. If you enable the `ifExists` parameter, + the operation succeeds even if the database does not exist. Otherwise, a 404 + failure is returned if the database does not exist. if the drop is unsuccessful. + operationId: deleteDatabase + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: restrict + in: query + description: 'Whether to drop the database if foreign keys exist that reference + any tables in the database. + + - `true`: Return a warning about existing foreign key references and don''t + drop the database. + + - `false`: Drop the database and all objects in the database, including + tables with primary or unique keys that are referenced by foreign keys in + other tables.' + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}:undrop: + post: + summary: Undrop a database. + tags: + - database + description: Undrops database. + operationId: undropDatabase + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/replication:enable: + post: + summary: Enable database replication. + tags: + - database + description: Promotes a local database to serve as a primary database for replication. + A primary database can be replicated in one or more accounts, allowing users + in those accounts to query objects in each secondary (i.e. replica) database. + operationId: enableDatabaseReplication + parameters: + - $ref: '#/components/parameters/name' + - name: ignore_edition_check + in: query + description: 'Whether to allow replicating data to accounts on lower editions. + Default: `true`. + + For more information, see the + ALTER DATABASE reference.' + schema: + type: boolean + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccountIdentifiers' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/replication:disable: + post: + summary: Disable database replication. + tags: + - database + description: Disables replication for this primary database, meaning no replica + of this database (i.e. secondary database) in another account can be refreshed. + Any secondary databases remain linked to the primary database, but requests + to refresh a secondary database are denied. + operationId: disableDatabaseReplication + parameters: + - $ref: '#/components/parameters/name' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountIdentifiers' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/replication:refresh: + post: + summary: Refresh database replications. + tags: + - database + description: 'Refreshes a secondary database from a snapshot of its primary + database. A snapshot includes changes to the objects and data. + + If you call this endpoint while another refresh for the same replica database + is running, it fails and returns an error. Snowflake ensures only one refresh + is executed at any given time.' + operationId: refreshDatabaseReplication + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/failover:enable: + post: + summary: Enable database failover. + tags: + - database + description: Specifies a comma-separated list of accounts in your organization + where a replica of this primary database can be promoted to serve as the primary + database. + operationId: enableDatabaseFailover + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccountIdentifiers' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/failover:disable: + post: + summary: Disable database failover. + tags: + - database + description: Disables failover for this primary database, meaning no replica + of this database (i.e. secondary database) can be promoted to serve as the + primary database. + operationId: disableDatabaseFailover + parameters: + - $ref: '#/components/parameters/name' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountIdentifiers' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{name}/failover:primary: + post: + summary: Set a primary database. + tags: + - database + description: Promotes the specified secondary (replica) database to serve as + the primary database. When promoted, the database becomes writeable. At the + same time, the previous primary database becomes a read-only secondary database. + operationId: primaryDatabaseFailover + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + AccountIdentifiers: + type: object + description: Array of unique account identifiers. + properties: + accounts: + type: array + items: + type: string + minLength: 1 + example: + accounts: + - accountName1 + - accountName2 + required: + - accounts + Database: + type: object + description: Snowflake database object. + properties: + created_on: + type: string + format: date-time + readOnly: true + description: Date and time the database was created. + name: + $ref: '#/components/schemas/Identifier' + description: Name of the database. + kind: + type: string + enum: + - PERMANENT + - TRANSIENT + default: PERMANENT + description: Database type, permanent (default) or transient. + is_default: + type: boolean + readOnly: true + description: Whether the database is the default database for a user. + is_current: + type: boolean + readOnly: true + description: Current database for the session. + origin: + type: string + readOnly: true + owner: + type: string + readOnly: true + description: Name of the role that owns the database. + comment: + type: string + description: Optional comment in which to store information related to the + database. + options: + type: string + readOnly: true + retention_time: + type: integer + readOnly: true + description: Number of days that historical data is retained for Time Travel. + dropped_on: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time the database was dropped. + budget: + type: string + readOnly: true + description: Budget that defines a monthly spending limit on the compute + costs for a Snowflake account or a custom group of Snowflake objects. + owner_role_type: + type: string + readOnly: true + description: Type of role that owns the object, either ROLE or DATABASE_ROLE + data_retention_time_in_days: + type: integer + description: Specifies the number of days for which Time Travel actions + (CLONE and UNDROP) can be performed on the database, as well as specifying + the default Time Travel retention time for all schemas created in the + database. + default_ddl_collation: + type: string + description: Default collation specification for all schemas and tables + added to the database. You an override the default at the schema and individual + table levels. + log_level: + type: string + description: Severity level of messages that should be ingested and made + available in the active event table. Currently, Snowflake supports only + `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + max_data_extension_time_in_days: + type: integer + description: Maximum number of days for which Snowflake can extend the data + retention period for tables in the database to prevent streams on the + tables from becoming stale. + suspend_task_after_num_failures: + type: integer + description: Maximum number of consecutive failed task runs before the current + task is suspended automatically. + trace_level: + type: string + description: How trace events are ingested into the event table. Currently, + Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + user_task_managed_initial_warehouse_size: + type: string + description: Size of the compute resources to provision for the first run + of the serverless task, before a task history is available for Snowflake + to determine an ideal size. + serverless_task_min_statement_size: + type: string + description: Specifies the minimum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. + serverless_task_max_statement_size: + type: string + description: Specifies the maximum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. + user_task_timeout_ms: + type: integer + description: Time limit, in milliseconds, for a single run of the task before + it times out. + required: + - name + DatabaseClone: + type: object + description: Clone database. + allOf: + - $ref: '#/components/schemas/Database' + properties: + point_of_time: + $ref: '#/components/schemas/PointOfTime' + DatabaseFromShare: + type: object + description: Database from share. + properties: + name: + $ref: '#/components/schemas/Identifier' + description: Name of the database. + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + databases: + methods: + list_databases: + operation: + $ref: '#/paths/~1api~1v2~1databases/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_database: + operation: + $ref: '#/paths/~1api~1v2~1databases/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_database_from_share: + operation: + $ref: '#/paths/~1api~1v2~1databases:from-share/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_database_from_share_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}:from_share/post' + response: + mediaType: '' + openAPIDocKey: '200' + clone_database: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_database: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_database: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_database: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_database: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + enable_database_replication: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1replication:enable/post' + response: + mediaType: '' + openAPIDocKey: '200' + disable_database_replication: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1replication:disable/post' + response: + mediaType: '' + openAPIDocKey: '200' + refresh_database_replication: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1replication:refresh/post' + response: + mediaType: '' + openAPIDocKey: '200' + enable_database_failover: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1failover:enable/post' + response: + mediaType: '' + openAPIDocKey: '200' + disable_database_failover: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1failover:disable/post' + response: + mediaType: '' + openAPIDocKey: '200' + primary_database_failover: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{name}~1failover:primary/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/databases/methods/list_databases' + - $ref: '#/components/x-stackQL-resources/databases/methods/fetch_database' + insert: + - $ref: '#/components/x-stackQL-resources/databases/methods/create_database' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/databases/methods/delete_database' + replace: + - $ref: '#/components/x-stackQL-resources/databases/methods/create_or_alter_database' + id: snowflake.database.databases + name: databases + title: Databases +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/dynamic-table.yaml b/providers/src/snowflake/v00.00.00000/services/dynamic-table.yaml new file mode 100644 index 00000000..8178d0ed --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/dynamic-table.yaml @@ -0,0 +1,1438 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Dynamic Table API + description: The Snowflake Dynamic Table API is a REST API that you can use to access, + update, and perform certain actions on Dynamic Tables resource in a Snowflake + database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables: + get: + summary: List dynamic tables + tags: + - dynamic-table + description: Lists the dynamic tables under the database and schema. + operationId: listDynamicTables + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: deep + description: Optionally includes dependency information of the dynamic table. + in: query + required: false + schema: + type: boolean + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DynamicTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a dynamic table + tags: + - dynamic-table + description: Create a dynamic table, with standard create modifiers as query + parameters. See the Dynamic Table component definition for what is required + to be provided in the request body. + operationId: createDynamicTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicTable' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}: + get: + summary: Fetch a dynamic table. + tags: + - dynamic-table + description: Fetch a Dynamic Table. + operationId: fetchDynamicTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Delete a dynamic table + tags: + - dynamic-table + description: Delete a dynamic table with the given name. If ifExists is used, + the operation will succeed even if the object does not exist. Otherwise, there + will be a failure if the drop is unsuccessful. + operationId: deleteDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:clone: + post: + summary: Clone dynamic table + tags: + - dynamic-table + description: Create a new dynamic table by cloning from the specified resource + operationId: cloneDynamicTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: targetDatabase + in: query + description: Database of the newly created dynamic table. Defaults to the + source table's database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the newly created dynamic table. Defaults to the source + table's schema. + schema: + $ref: '#/components/schemas/Identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicTableClone' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:undrop: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + summary: Undrop a dynamic table + tags: + - dynamic-table + description: Undrop specified dynamic table + operationId: undropDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:suspend: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Suspend refreshes on the dynamic table + tags: + - dynamic-table + description: Suspend refreshes on the dynamic table + operationId: suspendDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:resume: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Resume refreshes on the dynamic table + tags: + - dynamic-table + description: Resume refreshes on the dynamic table + operationId: resumeDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:refresh: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Refresh the dynamic table + tags: + - dynamic-table + description: Specifies that the dynamic table should be manually refreshed + operationId: refreshDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:suspend-recluster: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Suspend recluster of a dynamic table + tags: + - dynamic-table + description: Suspend recluster of a dynamic table + operationId: suspendReclusterDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:resume-recluster: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Resume recluster of a dynamic table + tags: + - dynamic-table + description: Resume recluster of a dynamic table + operationId: resumeReclusterDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/dynamic-tables/{name}:swap-with: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: targetName + description: The name of the target dynamic table to be swapped with. + in: query + required: true + schema: + $ref: '#/components/schemas/Identifier' + - name: targetDatabase + in: query + description: Database of the target dynamic table. Defaults to the source + table's database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the target dynamic table. Defaults to the source table's + schema. + schema: + $ref: '#/components/schemas/Identifier' + summary: Swap with another dynamic table + tags: + - dynamic-table + description: Swap with another dynamic table + operationId: swapWithDynamicTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + DynamicTable: + type: object + description: A Snowflake dynamic table object. + properties: + name: + type: string + description: Specifies the name for the dynamic table, must be unique for + the schema in which the dynamic table is created + kind: + type: string + enum: + - PERMANENT + - TRANSIENT + default: PERMANENT + description: Specifies the dynamic table type, permanent (default) or transient. + columns: + type: array + items: + $ref: '#/components/schemas/DynamicTableColumn' + target_lag: + $ref: '#/components/schemas/TargetLag' + refresh_mode: + type: string + description: Specifies the refresh type for the dynamic table + enum: + - AUTO + - FULL + - INCREMENTAL + initialize: + type: string + description: Specifies the behavior of the initial refresh of the dynamic + table + enum: + - ON_CREATE + - ON_SCHEDULE + warehouse: + type: string + description: Specifies the name of the warehouse that provides the compute + resources for refreshing the dynamic table + example: test_wh + cluster_by: + type: array + description: Specifies one or more columns or column expressions in the + dynamic table as the clustering key + items: + type: string + query: + type: string + description: Specifies the query whose results the dynamic table should + contain + example: SELECT * FROM foo + data_retention_time_in_days: + type: integer + description: Specifies the retention period for the dynamic table so that + Time Travel actions (SELECT, CLONE) can be performed on historical data + in the dynamic table + max_data_extension_time_in_days: + type: integer + description: Specifies the retention period for the dynamic table so that + Time Travel actions (SELECT, CLONE) can be performed on historical data + in the dynamic table + comment: + type: string + description: Specifies a comment for the dynamic table. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the dynamic table was created. + database_name: + type: string + readOnly: true + description: Database in which the dynamic table is stored + schema_name: + type: string + readOnly: true + description: Schema in which the dynamic table is stored + rows: + type: integer + format: int64 + readOnly: true + description: Number of rows in the dynamic table. + bytes: + type: integer + format: int64 + readOnly: true + description: Number of bytes that will be scanned if the entire table is + scanned in a query. Note that this number may be different than the number + of actual physical bytes stored on-disk for the table + scheduling_state: + type: string + enum: + - RUNNING + - SUSPENDED + readOnly: true + description: Scheduling state (RUNNING or SUSPENDED) + automatic_clustering: + type: boolean + readOnly: true + description: If Automatic Clustering is enabled for your account, specifies + whether it is explicitly enabled or disabled for the dynamic table. + owner: + type: string + readOnly: true + description: Role that owns the table + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the object. + budget: + type: string + readOnly: true + description: Name of the budget if the object is monitored by a budget + required: + - name + - target_lag + - warehouse + - query + DynamicTableColumn: + type: object + description: A column in the dynamic table + properties: + name: + type: string + description: Column name + datatype: + type: string + description: The data type for the column + comment: + type: string + description: Specifies a comment for the column + required: + - name + DynamicTableClone: + type: object + description: Clone dynamic table + properties: + name: + type: string + description: Specifies the name for the dynamic table, must be unique for + the schema in which the dynamic table is created + target_lag: + $ref: '#/components/schemas/TargetLag' + warehouse: + type: string + description: Specifies the name of the warehouse that provides the compute + resources for refreshing the dynamic table + point_of_time: + $ref: '#/components/schemas/PointOfTime' + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + dynamic_tables: + methods: + list_dynamic_tables: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + clone_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:suspend/post' + response: + mediaType: '' + openAPIDocKey: '200' + resume_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:resume/post' + response: + mediaType: '' + openAPIDocKey: '200' + refresh_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:refresh/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_recluster_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:suspend-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + resume_recluster_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:resume-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + swap_with_dynamic_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1dynamic-tables~1{name}:swap-with/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/dynamic_tables/methods/list_dynamic_tables' + - $ref: '#/components/x-stackQL-resources/dynamic_tables/methods/fetch_dynamic_table' + insert: + - $ref: '#/components/x-stackQL-resources/dynamic_tables/methods/create_dynamic_table' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/dynamic_tables/methods/delete_dynamic_table' + replace: [] + id: snowflake.dynamic_table.dynamic_tables + name: dynamic_tables + title: Dynamic Tables +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/event-table.yaml b/providers/src/snowflake/v00.00.00000/services/event-table.yaml new file mode 100644 index 00000000..c44f9dea --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/event-table.yaml @@ -0,0 +1,1040 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Event Table API + description: The Snowflake Event Table API is a REST API that you can use to access, + update, and perform certain actions on Event Table resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/event-tables: + get: + summary: List event tables + tags: + - event-table + description: List event tables + operationId: listEventTables + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EventTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create an event table + tags: + - event-table + description: Create an event table + operationId: createEventTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventTable' + /api/v2/databases/{database}/schemas/{schema}/event-tables/{name}: + get: + summary: Fetch an event table + tags: + - event-table + description: Fetch an event table + operationId: fetchEventTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/EventTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete an event table + tags: + - event-table + description: Delete an event table + operationId: deleteEventTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/event-tables/{name}:rename: + post: + summary: Rename the event table + tags: + - event-table + description: Rename the event table + operationId: renameEventTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: targetName + description: Specify the name of the target resource to be renamed to. + in: query + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + EventTable: + type: object + description: A Snowflake event table + properties: + name: + type: string + description: Name of the event table + cluster_by: + type: array + items: + type: string + description: Cluster key column(s) or expression + data_retention_time_in_days: + type: integer + description: number of days to retain the old version of deleted/updated + data + max_data_extension_time_in_days: + type: integer + description: Maximum number of days to extend data retention beyond the + retention period to prevent a stream becoming stale. + change_tracking: + type: boolean + description: True if change tracking is enabled, allowing streams and CHANGES + to be used on the entity. + default_ddl_collation: + type: string + description: Collation that is used for all the new columns created by the + DDL statements (if not specified) + comment: + type: string + description: user comment associated to an object in the dictionary + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the event table was created. + database_name: + type: string + readOnly: true + description: Database in which the event table is stored + schema_name: + type: string + readOnly: true + description: Schema in which the event table is stored + owner: + type: string + readOnly: true + description: Role that owns the event table + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the event table + rows: + type: integer + format: int64 + readOnly: true + description: Number of rows in the table. + bytes: + type: integer + format: int64 + readOnly: true + description: Number of bytes that will be scanned if the entire table is + scanned in a query.Note that this number may be different than the number + of actual physical bytes stored on-disk for the table + automatic_clustering: + type: boolean + readOnly: true + description: If Automatic Clustering is enabled for your account, specifies + whether it is explicitly enabled or disabled for the table. + search_optimization: + type: boolean + readOnly: true + description: If ON, the table has the search optimization service enabled + search_optimization_progress: + type: integer + format: int64 + readOnly: true + description: Percentage of the table that has been optimized for search + search_optimization_bytes: + type: integer + format: int64 + readOnly: true + description: Number of additional bytes of storage that the search optimization + service consumes for this table + columns: + type: array + items: + $ref: '#/components/schemas/EventTableColumn' + readOnly: true + required: + - name + EventTableColumn: + type: object + properties: + name: + type: string + description: Column name + datatype: + type: string + description: The data type for the column + nullable: + type: boolean + description: Specifies that the column does allow NULL values or not + default: + type: string + description: Specifies whether a default value is automatically inserted + in the column if a value is not explicitly specified via an INSERT or + CREATE TABLE AS SELECT statement + primary_key: + type: boolean + description: A primary key is the column or columns that contain values + that uniquely identify each row in a table + unique_key: + type: boolean + description: Unique keys are columns in a table that uniquely identify items + in the rows. This sounds a lot like a primary key, but the main difference + is that unique keys can have NULL values. + check: + type: string + description: '' + expression: + type: string + description: '' + comment: + type: string + description: Specifies a comment for the column + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + event_tables: + methods: + list_event_tables: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1event-tables/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_event_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1event-tables/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_event_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1event-tables~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_event_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1event-tables~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + rename_event_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1event-tables~1{name}:rename/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/event_tables/methods/list_event_tables' + - $ref: '#/components/x-stackQL-resources/event_tables/methods/fetch_event_table' + insert: + - $ref: '#/components/x-stackQL-resources/event_tables/methods/create_event_table' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/event_tables/methods/delete_event_table' + replace: [] + id: snowflake.event_table.event_tables + name: event_tables + title: Event Tables +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/external-volume.yaml b/providers/src/snowflake/v00.00.00000/services/external-volume.yaml new file mode 100644 index 00000000..04247cb7 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/external-volume.yaml @@ -0,0 +1,1055 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake External Volume API + description: The Snowflake External Volume API is a REST API that you can use to + access, update, and perform certain actions on External Volume resource in a Snowflake + database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/external-volumes: + get: + summary: List external volumes + tags: + - external-volume + description: List external volumes + operationId: listExternalVolumes + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExternalVolume' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create an external volume + tags: + - external-volume + description: Create an external volume + operationId: createExternalVolume + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalVolume' + /api/v2/external-volumes/{name}: + get: + summary: Fetch an external volume + tags: + - external-volume + description: Fetch an external volume + operationId: fetchExternalVolume + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalVolume' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete an external volume + tags: + - external-volume + description: Delete an external volume + operationId: deleteExternalVolume + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/external-volumes/{name}:undrop: + post: + summary: Undrop an external volume + tags: + - external-volume + description: Undrop an external volume + operationId: undropExternalVolume + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + ExternalVolume: + type: object + description: A Snowflake external volume + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: String that specifies the identifier (the name) for the external + volume; must be unique in your account. + storage_locations: + type: array + items: + $ref: '#/components/schemas/StorageLocation' + description: Set of named cloud storage locations in different regions and, + optionally, cloud platforms. + allow_writes: + type: boolean + description: Specifies whether write operations are allowed for the external + volume; must be set to TRUE for Iceberg tables that use Snowflake as the + catalog. + comment: + type: string + description: String (literal) that specifies a comment for the external + volume. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the external volume was created. + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the external volume + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the external volume + required: + - name + - storage_locations + StorageLocation: + type: object + properties: + name: + type: string + description: '' + storage_provider: + type: string + enum: + - S3 + - S3GOV + - GCS + - AZURE + description: Specifies the cloud storage provider that stores your data + files. + required: + - name + - storage_provider + discriminator: + propertyName: storage_provider + mapping: + S3: StorageLocationS3 + S3GOV: StorageLocationS3Gov + GCS: StorageLocationGcs + AZURE: StorageLocationAzure + StorageLocationS3: + allOf: + - $ref: '#/components/schemas/StorageLocation' + properties: + storage_aws_role_arn: + type: string + description: Specifies the case-sensitive Amazon Resource Name (ARN) of + the AWS identity and access management (IAM) role that grants privileges + on the S3 bucket containing your data files. + storage_base_url: + type: string + description: Specifies the base URL for your cloud storage location. + storage_aws_external_id: + type: string + description: Optionally specifies an external ID that Snowflake uses to + establish a trust relationship with AWS. + encryption: + $ref: '#/components/schemas/Encryption' + description: Specifies the properties needed to encrypt data on the external + volume. + required: + - storage_aws_role_arn + - storage_base_url + Encryption: + type: object + properties: + type: + type: string + enum: + - NONE + - AWS_SSE_S3 + - AWS_SSE_KMS + - GCS_SSE_KMS + description: Specifies the encryption type used. + kms_key_id: + type: string + description: Specifies the ID for the Cloud KMS-managed key used to encrypt + files written to the bucket. + required: + - type + StorageLocationS3Gov: + allOf: + - $ref: '#/components/schemas/StorageLocation' + properties: + storage_aws_role_arn: + type: string + description: Specifies the case-sensitive Amazon Resource Name (ARN) of + the AWS identity and access management (IAM) role that grants privileges + on the S3 bucket containing your data files. + storage_base_url: + type: string + description: Specifies the base URL for your cloud storage location. + storage_aws_external_id: + type: string + description: Optionally specifies an external ID that Snowflake uses to + establish a trust relationship with AWS. + encryption: + $ref: '#/components/schemas/Encryption' + description: Specifies the properties needed to encrypt data on the external + volume. + required: + - storage_aws_role_arn + - storage_base_url + StorageLocationGcs: + allOf: + - $ref: '#/components/schemas/StorageLocation' + properties: + storage_base_url: + type: string + description: Specifies the base URL for your cloud storage location. + encryption: + $ref: '#/components/schemas/Encryption' + description: Specifies the properties needed to encrypt data on the external + volume. + required: + - storage_base_url + StorageLocationAzure: + allOf: + - $ref: '#/components/schemas/StorageLocation' + properties: + azure_tenant_id: + type: string + description: Specifies the ID for your Office 365 tenant that the allowed + and blocked storage accounts belong to. + storage_base_url: + type: string + description: Specifies the base URL for your cloud storage location. + required: + - azure_tenant_id + - storage_base_url + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + external_volumes: + methods: + list_external_volumes: + operation: + $ref: '#/paths/~1api~1v2~1external-volumes/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_external_volume: + operation: + $ref: '#/paths/~1api~1v2~1external-volumes/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_external_volume: + operation: + $ref: '#/paths/~1api~1v2~1external-volumes~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_external_volume: + operation: + $ref: '#/paths/~1api~1v2~1external-volumes~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_external_volume: + operation: + $ref: '#/paths/~1api~1v2~1external-volumes~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/external_volumes/methods/list_external_volumes' + - $ref: '#/components/x-stackQL-resources/external_volumes/methods/fetch_external_volume' + insert: + - $ref: '#/components/x-stackQL-resources/external_volumes/methods/create_external_volume' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/external_volumes/methods/delete_external_volume' + replace: [] + id: snowflake.external_volume.external_volumes + name: external_volumes + title: External Volumes +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/function.yaml b/providers/src/snowflake/v00.00.00000/services/function.yaml new file mode 100644 index 00000000..87ca0417 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/function.yaml @@ -0,0 +1,1000 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Function API + description: The Snowflake Function API is a REST API that allows caller to create, + execute and drop functions in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/functions: + get: + summary: List Functions + tags: + - function + description: Lists the user functions under the database and schema. + operationId: listFunctions + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Function' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a Function + tags: + - function + description: Create a function. + operationId: createFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Function' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/functions/{nameWithArgs}: + get: + summary: Fetch a Function. + tags: + - function + description: Fetch a Function using the describe command output. + operationId: fetchFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Function' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + - $ref: '#/components/parameters/ifExists' + summary: Delete a function + tags: + - function + description: Delete a function with the given name and args. + operationId: deleteFunction + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/functions/{name}:execute: + post: + summary: Execute a Function. + tags: + - function + description: Execute a Function. + operationId: executeFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionArguments' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: object + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Function: + type: object + description: A Snowflake function + discriminator: + propertyName: function_type + mapping: + service-function: '#/components/schemas/ServiceFunction' + properties: + function_type: + type: string + default: service-function + name: + type: string + description: Specifies the name for the function, must be unique for the + schema in which the function is created + arguments: + type: array + items: + $ref: '#/components/schemas/FunctionArgument' + returns: + type: string + description: Specifies the type for the function return value. + enum: + - FIXED + - INT + - REAL + - NUMBER + - TEXT + - BOOLEAN + - DATE + - TIME + - TIMESTAMP_TZ + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + default: TEXT + max_batch_rows: + type: integer + description: Specifies the max rows for batch operation. + created_on: + type: string + format: date-time + description: Date and time when the function was created. + signature: + type: string + description: Function's arguments. + language: + type: string + description: Function's language. + body: + type: string + description: Function's body. + required: + - name + - arguments + FunctionArgument: + type: object + description: An argument of function + properties: + name: + type: string + description: Argument's name + datatype: + description: Argument's type + type: string + enum: + - FIXED + - INT + - REAL + - NUMBER + - TEXT + - BOOLEAN + - DATE + - TIME + - TIMESTAMP_TZ + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + default: TEXT + value: + description: Argument's value + FunctionArguments: + type: array + items: + $ref: '#/components/schemas/FunctionArgument' + ServiceFunction: + allOf: + - $ref: '#/components/schemas/Function' + description: Service based function + required: + - service + - endpoint + - path + properties: + service: + $ref: '#/components/schemas/Identifier' + description: Service's name + service_database: + $ref: '#/components/schemas/Identifier' + description: Service's database name + service_schema: + $ref: '#/components/schemas/Identifier' + description: Service's schema name + endpoint: + type: string + description: Function's endpoint + path: + type: string + description: Function's path + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + functions: + methods: + list_functions: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1functions/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1functions/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1functions~1{nameWithArgs}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1functions~1{nameWithArgs}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + execute_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1functions~1{name}:execute/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/functions/methods/list_functions' + - $ref: '#/components/x-stackQL-resources/functions/methods/fetch_function' + insert: + - $ref: '#/components/x-stackQL-resources/functions/methods/create_function' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/functions/methods/delete_function' + replace: [] + id: snowflake.function.functions + name: functions + title: Functions +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/grant.yaml b/providers/src/snowflake/v00.00.00000/services/grant.yaml new file mode 100644 index 00000000..60e8ff42 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/grant.yaml @@ -0,0 +1,1204 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Grant API + description: The Snowflake Grant API is a REST API that you can use to show or manage + privileges that have been provided to users and roles in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/grants/{granteeType}/{granteeName}/{securableType}/{securableName}/privileges: + post: + summary: Grant the specified privilege(s) on the named securable to the named + grantee. + description: Endpoint to indicate that the privileges listed in the request + body should be granted. + operationId: grantPrivilege + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/securableType' + - $ref: '#/components/parameters/securableName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/grants/{granteeType}/{granteeName}/{bulkGrantType}/{securableTypePlural}/{scopeType}/{scopeName}/privileges: + post: + summary: Grant the specified privilege(s) on all/future (as specified by bulkGrantType) + securables of this type in a given scope to the named grantee. + description: Endpoint to indicate that the privileges listed in the request + body should be granted to all securables of this type in the given scope. + operationId: grantGroupPrivilege + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/bulkGrantType' + - $ref: '#/components/parameters/securableTypePlural' + - $ref: '#/components/parameters/scopeType' + - $ref: '#/components/parameters/scopeName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/grants/{granteeType}/{granteeName}/{securableType}/{securableName}/privileges/{privilege}: + delete: + summary: Revoke the specified privilege on the named securable from the named + grantee. + description: Endpoint to indicate that the privilege listed in the path should + be revoked. + operationId: revokePrivilege + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/securableType' + - $ref: '#/components/parameters/securableName' + - $ref: '#/components/parameters/privilege' + - $ref: '#/components/parameters/deleteMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/grants/{granteeType}/{granteeName}/{securableType}/{securableName}/privileges/{privilege}/grant-option: + delete: + summary: Revoke the grant option for the specified privilege on the named securable + from the named grantee. + description: Endpoint to indicate that the grant option for the privilege listed + in the path should be revoked. + operationId: revokePrivilegeGrantOption + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/securableType' + - $ref: '#/components/parameters/securableName' + - $ref: '#/components/parameters/privilege' + - $ref: '#/components/parameters/deleteMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + ? /api/v2/grants/{granteeType}/{granteeName}/{bulkGrantType}/{securableTypePlural}/{scopeType}/{scopeName}/privileges/{privilege} + : delete: + summary: Revoke the specified privilege on the specified all/future securable + in the given scope from the named grantee. + description: Endpoint to indicate that the privilege listed on the group securable + in the given scope should be revoked. + operationId: revokeGroupPrivilege + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/bulkGrantType' + - $ref: '#/components/parameters/securableTypePlural' + - $ref: '#/components/parameters/scopeType' + - $ref: '#/components/parameters/scopeName' + - $ref: '#/components/parameters/privilege' + - $ref: '#/components/parameters/deleteMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + ? /api/v2/grants/{granteeType}/{granteeName}/{bulkGrantType}/{securableTypePlural}/{scopeType}/{scopeName}/privileges/{privilege}/grant-option + : delete: + summary: Revoke the grant option for the specified privilege on the specified + all/future securable in the given scope from the named grantee. + description: Endpoint to indicate that the grant option for the privilege listed + on the group securable in the given scope should be revoked. + operationId: revokeGroupPrivilegeGrantOption + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/bulkGrantType' + - $ref: '#/components/parameters/securableTypePlural' + - $ref: '#/components/parameters/scopeType' + - $ref: '#/components/parameters/scopeName' + - $ref: '#/components/parameters/privilege' + - $ref: '#/components/parameters/deleteMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/grants/{granteeType}/{granteeName}: + get: + summary: List of privileges associated with this grantee type and name + description: List the roles and privileges granted to the specified grantee + using the output of SHOW GRANTS TO + operationId: listGrantsTo + deprecated: true + tags: + - grant + parameters: + - $ref: '#/components/parameters/granteeType' + - $ref: '#/components/parameters/granteeName' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + parameters: + granteeType: + name: granteeType + description: String that specifies the type of resource that is the privilege + grantee. + required: true + in: path + schema: + example: role + type: string + enum: + - user + - role + - application-role + - database-role + - share + granteeName: + name: granteeName + description: String that specifies the name of the privilege grantee. + required: true + in: path + schema: + example: SYSADMIN + type: string + securableType: + name: securableType + description: String that specifies the type of resource that is being secured + by a privilege. + required: true + in: path + schema: + example: DATABASE + type: string + securableName: + name: securableName + description: String that specifies the name of resource that is being secured + by a privilege. + required: true + in: path + schema: + example: MY_DB + type: string + bulkGrantType: + name: bulkGrantType + description: String that species whether this group privilege should be on ALL + or FUTURE resources of the specified plural type + required: true + in: path + schema: + example: all + type: string + enum: + - all + - future + securableTypePlural: + name: securableTypePlural + description: String that specifies the plural of the type of resource that is + being secured by an ALL/FUTURE privilege. Must be either "schemas" or any + plural object type that can nest under a schema such as "tables" + required: true + in: path + schema: + example: tables + type: string + scopeType: + name: scopeType + description: String that specifies the type of resource that is the scope of + an ALL/FUTURE privilege. Can only be DATABASE or SCHEMA + required: true + in: path + schema: + example: schema + type: string + enum: + - database + - schema + scopeName: + name: scopeName + description: String that specifies the name of resource that is the scope of + an ALL/FUTURE privilege + required: true + in: path + schema: + example: MY_DB.MY_SC + type: string + privilege: + name: privilege + description: String that specifies a privilege to be revoked + required: true + in: path + schema: + example: SELECT + type: string + deleteMode: + name: deleteMode + description: If "cascade", recursively revoke the grant from sub-grantees to + which this privilege was re-granted. Acceptable values are "restrict" or "cascade". + required: false + in: query + schema: + type: string + example: restrict + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + schemas: + Grant: + description: Properties of a grant that can be granted to a role or user. + type: object + properties: + privileges: + type: array + description: Privilege type + items: + type: string + example: + - CREATE DATABASE + - EXECUTE TASK + grant_option: + type: boolean + description: Can grantee pass this privilege down? + created_on: + type: string + format: date-time + grantee_type: + type: string + description: Entity type being granted to + example: ROLE + grantee_name: + type: string + description: Specific name of object being granted to + example: ACCOUNTADMIN + securable_type: + type: string + description: Type of object granted on + example: ACCOUNT + securable_name: + type: string + description: Name of specific object granted on (not name of privilege!) + granted_by_role_type: + type: string + description: Type of role that granted this privilege to this grantee + example: ROLE + granted_by_name: + type: string + description: The role that granted this privilege to this grantee + example: SUBADMIN + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + privileges: + methods: + grant_privilege: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{securableType}~1{securableName}~1privileges/post' + response: + mediaType: '' + openAPIDocKey: '200' + grant_group_privilege: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{bulkGrantType}~1{securableTypePlural}~1{scopeType}~1{scopeName}~1privileges/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_privilege: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{securableType}~1{securableName}~1privileges~1{privilege}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_group_privilege: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{bulkGrantType}~1{securableTypePlural}~1{scopeType}~1{scopeName}~1privileges~1{privilege}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: [] + insert: + - $ref: '#/components/x-stackQL-resources/privileges/methods/grant_privilege' + - $ref: '#/components/x-stackQL-resources/privileges/methods/grant_group_privilege' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/privileges/methods/revoke_privilege' + - $ref: '#/components/x-stackQL-resources/privileges/methods/revoke_group_privilege' + replace: [] + id: snowflake.grant.privileges + name: privileges + title: Privileges + grant_options: + methods: + revoke_privilege_grant_option: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{securableType}~1{securableName}~1privileges~1{privilege}~1grant-option/delete' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_group_privilege_grant_option: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}~1{bulkGrantType}~1{securableTypePlural}~1{scopeType}~1{scopeName}~1privileges~1{privilege}~1grant-option/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: [] + insert: [] + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/grant_options/methods/revoke_privilege_grant_option' + - $ref: '#/components/x-stackQL-resources/grant_options/methods/revoke_group_privilege_grant_option' + replace: [] + id: snowflake.grant.grant_options + name: grant_options + title: Grant Options + grants_to: + methods: + list_grants_to: + operation: + $ref: '#/paths/~1api~1v2~1grants~1{granteeType}~1{granteeName}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants_to/methods/list_grants_to' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.grant.grants_to + name: grants_to + title: Grants To +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/iceberg-table.yaml b/providers/src/snowflake/v00.00.00000/services/iceberg-table.yaml new file mode 100644 index 00000000..2aaa5d95 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/iceberg-table.yaml @@ -0,0 +1,1945 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Iceberg Table API + description: The Snowflake Iceberg Table API is a REST API that you can use to access, + update, and perform certain actions on Iceberg Table resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables: + get: + summary: List iceberg tables + tags: + - iceberg-table + description: "Lists the Apache Iceberg\u2122 tables for which you have access\ + \ privileges." + operationId: listIcebergTables + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: deep + description: Optionally includes dependency information of the table. + in: query + required: false + schema: + type: boolean + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IcebergTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a snowflake managed iceberg table (clone and undrop are separate + subresources) + tags: + - iceberg-table + description: Create a snowflake managed iceberg table (clone and undrop are + separate subresources) + operationId: createSnowflakeManagedIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTable' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables:as-select: + post: + summary: Create a snowflake managed iceberg table as select + tags: + - iceberg-table + description: Create a snowflake managed iceberg table as select + operationId: createSnowflakeManagedIcebergTableAsSelect + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: query + in: query + required: true + description: The SQL select query to run to set up the table values (and possibly + columns). + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableAsSelect' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables:from-aws-glue-catalog: + post: + summary: Create an unmanaged iceberg table from AWS Glue catalog + tags: + - iceberg-table + description: Create an unmanaged iceberg table from AWS Glue catalog + operationId: createUnmanagedIcebergTableFromAWSGlueCatalog + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableFromAWSGlueCatalog' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables:from-delta: + post: + summary: Create an unmanaged iceberg table from Delta + tags: + - iceberg-table + description: Create an unmanaged iceberg table from Delta + operationId: createUnmanagedIcebergTableFromDelta + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableFromDelta' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables:from-iceberg-files: + post: + summary: Create an unmanaged iceberg table from Iceberg files + tags: + - iceberg-table + description: Create an unmanaged iceberg table from Iceberg files + operationId: createUnmanagedIcebergTableFromIcebergFiles + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableFromIcebergFiles' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables:from-iceberg-rest: + post: + summary: Create an unmanaged iceberg table from Iceberg REST + tags: + - iceberg-table + description: Create an unmanaged iceberg table from Iceberg REST + operationId: createUnmanagedIcebergTableFromIcebergRest + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableFromIcebergRest' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}: + get: + summary: Describe iceberg table + tags: + - iceberg-table + description: Describe an iceberg table + operationId: fetchIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTable' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Drop iceberg table + tags: + - iceberg-table + description: Drop an iceberg table + operationId: dropIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: type + description: Specifies whether the table can be dropped if foreign keys exist + that reference the table. + in: query + required: false + schema: + type: string + enum: + - CASCADE + - RESTRICT + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:resume-recluster: + post: + summary: Resume recluster of an iceberg table + tags: + - iceberg-table + description: Resume recluster of an iceberg table (iceberg tables managed by + an external catalog do not allow clustering) + operationId: resumeReclusterIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:suspend-recluster: + post: + summary: Suspend recluster of an iceberg table + tags: + - iceberg-table + description: Suspend recluster of an iceberg table (iceberg tables managed by + an external catalog do not allow clustering) + operationId: suspendReclusterIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:refresh: + post: + summary: Refreshes the metadata for an Apache Iceberg table that uses an external + Iceberg catalog + tags: + - iceberg-table + description: Refreshes the metadata for an Apache Iceberg table that uses an + external Iceberg catalog + operationId: refreshIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RefreshIcebergTableRequest' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:convert-to-managed: + post: + summary: "Converts an Apache Iceberg\u2122 table that uses an external Iceberg\ + \ catalog into a table that uses Snowflake as the catalog" + tags: + - iceberg-table + description: Convert unmanaged iceberg table to managed iceberg table + operationId: convertToManagedIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConvertToManagedIcebergTableRequest' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:undrop: + post: + summary: Undrop iceberg table + tags: + - iceberg-table + description: Undrop an iceberg table + operationId: undropIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:clone: + post: + summary: Clone a snowflake managed iceberg table + tags: + - iceberg-table + description: Clone a snowflake managed iceberg table + operationId: cloneSnowflakeManagedIcebergTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: targetDatabase + in: query + description: Database of the newly created table. Defaults to the source table's + database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the newly created table. Defaults to the source table's + schema. + schema: + $ref: '#/components/schemas/Identifier' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableClone' + /api/v2/databases/{database}/schemas/{schema}/iceberg-tables/{name}:create-like: + post: + summary: Create iceberg table like + tags: + - iceberg-table + description: Creates a new table with the same column definitions as an existing + table, but without copying data from the existing table. + operationId: createSnowflakeManagedIcebergTableLike + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: targetDatabase + in: query + description: Database of the newly created table. Defaults to the source table's + database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the newly created table. Defaults to the source table's + schema. + schema: + $ref: '#/components/schemas/Identifier' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergTableLike' +components: + schemas: + RefreshIcebergTableRequest: + type: object + description: Request model for refreshing iceberg table + properties: + metadata_file_relative_path: + type: string + description: Specifies a metadata file path for a table created from Iceberg + files in object storage. + ConvertToManagedIcebergTableRequest: + type: object + description: Request model for convert to managed iceberg table + properties: + base_location: + type: string + description: The path to a directory where Snowflake can write data and + metadata files for the table. + storage_serialization_policy: + type: string + description: Specifies the storage serialization policy for the table. + enum: + - COMPATIBLE + - OPTIMIZED + IcebergTable: + type: object + description: A Snowflake iceberg table + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the iceberg table + comment: + type: string + description: user comment associated to an object in the dictionary + change_tracking: + type: boolean + description: True if change tracking is enabled, allowing streams and CHANGES + to be used on the entity. + max_data_extension_time_in_days: + type: integer + description: Maximum number of days to extend data retention beyond the + retention period to prevent a stream becoming stale. + external_volume: + type: string + description: Name of an external volume that will be used for persisted + Iceberg metadata and data files. + data_retention_time_in_days: + type: integer + description: number of days to retain the old version of deleted/updated + data + catalog_sync: + type: string + description: Name of the catalog integration to sync this table + catalog: + type: string + description: Name of the catalog integration to use for iceberg tables + storage_serialization_policy: + type: string + description: Storage serialization policy used for managed Iceberg table. + This include encodings and compressions + enum: + - COMPATIBLE + - OPTIMIZED + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the iceberg table was created. + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Database in which the iceberg table is stored + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Schema in which the iceberg table is stored + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the iceberg table + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the iceberg table + iceberg_table_type: + type: string + readOnly: true + description: Type of Iceberg table. UNMANAGED if the table is not managed + by Snowflake. NOT ICEBERG otherwise. + catalog_table_name: + type: string + description: Name of the table as recognized by the catalog. + catalog_namespace: + type: string + description: "Catalog namespace for the table. The namespace defined when\ + \ the table was created. Otherwise, the default namespace associated with\ + \ the catalog integration used by the table. If you\u2019re syncing the\ + \ table to Snowflake Open Catalog, the default is null." + can_write_metadata: + type: string + readOnly: true + description: Signifies whether Snowflake can write metadata to the location + specified by the file_path. + cluster_by: + type: array + items: + type: string + description: Specifies one or more columns or column expressions in the + table as the clustering key. + columns: + type: array + items: + $ref: '#/components/schemas/IcebergTableColumn' + base_location: + type: string + description: The path to a directory where Snowflake can write data and + metadata files for the table. + replace_invalid_characters: + type: boolean + description: Specifies whether to replace invalid characters in the column + names + auto_refresh: + readOnly: true + type: boolean + description: Specifies whether to automatically refresh the table metadata + metadata_file_path: + type: string + description: Specifies the relative path of the Iceberg metadata file to + use for column definitions. + constraints: + type: array + items: + $ref: '#/components/schemas/Constraint' + required: + - name + IcebergTableAsSelect: + type: object + description: Create iceberg table as select + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + columns: + type: array + items: + $ref: '#/components/schemas/IcebergTableColumn' + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + cluster_by: + type: array + description: Specifies one or more columns or column expressions in the + table as the clustering key + items: + type: string + base_location: + type: string + description: Specifies the path to a directory where Snowflake can write + data and metadata files for the table + comment: + type: string + description: Specifies a comment for the table + required: + - name + - base_location + IcebergTableLike: + type: object + description: Create iceberg table as select + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + cluster_by: + type: array + description: Specifies one or more columns or column expressions in the + table as the clustering key + items: + type: string + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + base_location: + type: string + description: Specifies the path to a directory where Snowflake can write + data and metadata files for the table + comment: + type: string + description: Specifies a comment for the table + required: + - name + IcebergTableClone: + type: object + description: Clone iceberg table + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + point_of_time: + $ref: '#/components/schemas/PointOfTime' + required: + - name + IcebergTableFromAWSGlueCatalog: + type: object + description: Create iceberg table from AWS Glue catalog + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + catalog_table_name: + type: string + description: Specifies the table name as recognized by the AWS Glue Data + Catalog. + catalog_namespace: + type: string + description: Specifies the catalog namespace for the table. + replace_invalid_characters: + type: boolean + description: Specifies whether to replace invalid characters in the column + names + auto_refresh: + type: boolean + description: Specifies whether to automatically refresh the table metadata + catalog: + type: string + description: Specifies the name of the catalog integration to use for the + table + comment: + type: string + description: Specifies a comment for the table + required: + - name + - catalog_table_name + IcebergTableFromIcebergFiles: + type: object + description: Create iceberg table from Iceberg files + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + replace_invalid_characters: + type: boolean + description: Specifies whether to replace invalid characters in the column + names + metadata_file_path: + type: string + description: Specifies the relative path of the Iceberg metadata file to + use for column definitions. + catalog: + type: string + description: Specifies the name of the catalog integration to use for the + table + comment: + type: string + description: Specifies a comment for the table + required: + - name + - metadata_file_path + IcebergTableFromDelta: + type: object + description: Create iceberg table from Delta + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + replace_invalid_characters: + type: boolean + description: Specifies whether to replace invalid characters in the column + names + base_location: + type: string + description: "Specifies a relative path from the table\u2019s EXTERNAL_VOLUME\ + \ location to a directory where Snowflake can access your Delta table\ + \ files." + catalog: + type: string + description: Specifies the name of the catalog integration to use for the + table + comment: + type: string + description: Specifies a comment for the table + required: + - name + - base_location + IcebergTableFromIcebergRest: + type: object + description: "Creates or replaces an Apache Iceberg\u2122 table in the current/specified\ + \ schema for an Iceberg REST catalog." + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + external_volume: + type: string + description: Specifies the name of the external volume to use for the table + catalog_table_name: + type: string + description: Specifies the table name as recognized by the AWS Glue Data + Catalog. + catalog_namespace: + type: string + description: Specifies the catalog namespace for the table. + replace_invalid_characters: + type: boolean + description: Specifies whether to replace invalid characters in the column + names + auto_refresh: + type: boolean + description: Specifies whether to automatically refresh the table metadata + catalog: + type: string + description: Specifies the name of the catalog integration to use for the + table + comment: + type: string + description: Specifies a comment for the table + required: + - name + - catalog_table_name + IcebergTableColumn: + type: object + description: A column in the snowflake catalog iceberg table + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Column name + datatype: + type: string + description: The data type for the column + comment: + type: string + description: Specifies a comment for the column + nullable: + type: boolean + description: Argument null return acceptance criteria + default_value: + type: string + description: Default value for the column + required: + - name + - datatype + Constraint: + type: object + description: Constraints define integrity and consistency rules for data stored + in tables. + properties: + name: + type: string + description: Name of the Constraint + column_names: + type: array + items: + type: string + description: Column name for the constraint + constraint_type: + type: string + description: Type of the constraint + discriminator: + propertyName: constraint_type + mapping: + PRIMARY KEY: PrimaryKey + FOREIGN KEY: ForeignKey + UNIQUE: UniqueKey + PrimaryKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: A primary key is the column or columns that contain values that + uniquely identify each row in a table. + UniqueKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: Unique keys are columns in a table that uniquely identify items + in the rows. This sounds a lot like a primary key, but the main difference + is that unique keys can have NULL values. + ForeignKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: Foreign keys link data in one table to the data in another table. + properties: + referenced_table_name: + type: string + referenced_column_names: + type: array + items: + type: string + required: + - referenced_table_name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + iceberg_tables: + methods: + list_iceberg_tables: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_snowflake_managed_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_snowflake_managed_iceberg_table_as_select: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables:as-select/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_unmanaged_iceberg_table_from_aws_glue_catalog: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables:from-aws-glue-catalog/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_unmanaged_iceberg_table_from_delta: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables:from-delta/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_unmanaged_iceberg_table_from_iceberg_files: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables:from-iceberg-files/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_unmanaged_iceberg_table_from_iceberg_rest: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables:from-iceberg-rest/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + drop_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + resume_recluster_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:resume-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_recluster_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:suspend-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + refresh_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:refresh/post' + response: + mediaType: '' + openAPIDocKey: '200' + convert_to_managed_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:convert-to-managed/post' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + clone_snowflake_managed_iceberg_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_snowflake_managed_iceberg_table_like: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1iceberg-tables~1{name}:create-like/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/iceberg_tables/methods/list_iceberg_tables' + - $ref: '#/components/x-stackQL-resources/iceberg_tables/methods/fetch_iceberg_table' + insert: + - $ref: '#/components/x-stackQL-resources/iceberg_tables/methods/create_snowflake_managed_iceberg_table' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/iceberg_tables/methods/drop_iceberg_table' + replace: [] + id: snowflake.iceberg_table.iceberg_tables + name: iceberg_tables + title: Iceberg Tables +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/image-repository.yaml b/providers/src/snowflake/v00.00.00000/services/image-repository.yaml new file mode 100644 index 00000000..41729eb1 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/image-repository.yaml @@ -0,0 +1,977 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Image Repository API + description: The Snowflake Image Repository API is a REST API that you can use to + access, update, and perform common actions on Image Repository resource in Snowflake. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/image-repositories: + get: + summary: Lists image repositories. + tags: + - image-repository + description: Lists the image repositories under a specified database and schema. + operationId: listImageRepositories + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageRepository' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Creates an image repository in the specified database and schema. + tags: + - image-repository + description: Creates an image repository in the specified database, schema, + and create mode. The `createMode` query parameter specifies what action to + take based on whether the repository already exists. See the ImageRepository + component definition for what is required to be provided in the request body. + operationId: createImageRepository + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ImageRepository' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/image-repositories/{name}: + get: + summary: Fetches an image repository. + tags: + - image-repository + description: Fetches a named image repository in a specified database and schema. + operationId: fetchImageRepository + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/ImageRepository' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Deletes an image repository. + tags: + - image-repository + description: Deletes an image repository with the given name. If you enable + the `ifExists` query parameter, the operation succeeds even if the object + does not exist. Otherwise, a 404 failure is returned if the object does not + exist. + operationId: deleteImageRepository + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/image-repositories/{name}/images: + get: + summary: List images in the image repository. + tags: + - image-repository + description: List images in the given image repository. + operationId: listImagesInRepository + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Image' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Image: + type: object + description: A image in a Snowflake image repository. + properties: + created_on: + type: string + description: Date and time when the image was uploaded to the image repository. + readOnly: true + image_name: + type: string + description: Image name. + readOnly: true + tags: + type: string + description: Image tags. + readOnly: true + digest: + type: string + description: SHA256 digest of the image. + readOnly: true + image_path: + type: string + description: Image path (database_name/schema_name/repository_name/image_name:image_tag). + readOnly: true + ImageRepository: + type: object + description: A Snowflake image repository. + properties: + name: + $ref: '#/components/schemas/Identifier' + database_name: + $ref: '#/components/schemas/Identifier' + readOnly: true + schema_name: + $ref: '#/components/schemas/Identifier' + readOnly: true + created_on: + type: string + description: Time the image repository was created. + format: date-time + readOnly: true + repository_url: + type: string + description: Current URL of the image repository. + readOnly: true + owner: + type: string + description: Identifier for the current owner of the image repository. + readOnly: true + owner_role_type: + type: string + description: Role type of the image repository owner. + readOnly: true + example: + name: image_repository_name + database_name: test_db + schema_name: test_schema + created_on: '2024-06-18T01:01:01.111111' + repository_url: https://www.snowflake.com + owner: IMAGE_ADMIN + owner_role_type: ADMIN + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + image_repositories: + methods: + list_image_repositories: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1image-repositories/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_image_repository: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1image-repositories/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_image_repository: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1image-repositories~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_image_repository: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1image-repositories~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/image_repositories/methods/list_image_repositories' + - $ref: '#/components/x-stackQL-resources/image_repositories/methods/fetch_image_repository' + insert: + - $ref: '#/components/x-stackQL-resources/image_repositories/methods/create_image_repository' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/image_repositories/methods/delete_image_repository' + replace: [] + id: snowflake.image_repository.image_repositories + name: image_repositories + title: Image Repositories + images: + methods: + list_images_in_repository: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1image-repositories~1{name}~1images/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/images/methods/list_images_in_repository' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.image_repository.images + name: images + title: Images +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/managed-account.yaml b/providers/src/snowflake/v00.00.00000/services/managed-account.yaml new file mode 100644 index 00000000..9bfb1b87 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/managed-account.yaml @@ -0,0 +1,864 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Managed Account API + description: The Snowflake Managed Account API is a REST API that you can use to + access, update, and perform certain actions on Managed Account resource in Snowflake. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/managed-accounts: + get: + summary: List managed accounts. + tags: + - managed-account + description: Lists the accessible managed accounts. + operationId: listManagedAccounts + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ManagedAccount' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a managed accounts. + tags: + - managed-account + description: Creates a managed account. You must provide the full managed account + definition when creating a managed account. + operationId: createManagedAccount + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ManagedAccount' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/managed-accounts/{name}: + delete: + summary: Delete a managed account. + tags: + - managed-account + description: Removes a managed account, including all objects created in the + account, and immediately restricts access to the account. Currently used by + data providers to create reader accounts for their consumers. For more details, + see Manage reader accounts. + operationId: deleteManagedAccount + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + ManagedAccount: + type: object + description: Snowflake account object. + properties: + name: + $ref: '#/components/schemas/Identifier' + description: Name of the account. + cloud: + type: string + readOnly: true + description: Cloud in which the managed account is located. For reader accounts, + this is always the same as the cloud for the provider account. + region: + type: string + readOnly: true + description: Region in which the managed account is located. For reader + accounts, this is always the same as the region for the provider account. + locator: + type: string + readOnly: true + description: Legacy identifier for the account. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time the account was created. + url: + type: string + readOnly: true + description: Account URL that is used to connect to the account, in the + account name format. The account identifier in this format follows the + pattern -. + account_locator_url: + type: string + readOnly: true + description: Account URL that is used to connect to the account, in the + legacy account locator format. + comment: + type: string + description: Optional comment in which to store information related to the + account. + admin_name: + type: string + description: Name of the account administrator. + writeOnly: true + nullable: true + admin_password: + type: string + description: Password for the account administrator. + writeOnly: true + nullable: true + format: password + account_type: + type: string + description: Type of the account. + enum: + - READER + default: READER + required: + - name + - admin_name + - admin_password + - account_type + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + managed_accounts: + methods: + list_managed_accounts: + operation: + $ref: '#/paths/~1api~1v2~1managed-accounts/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_managed_account: + operation: + $ref: '#/paths/~1api~1v2~1managed-accounts/post' + response: + mediaType: '' + openAPIDocKey: '200' + delete_managed_account: + operation: + $ref: '#/paths/~1api~1v2~1managed-accounts~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/managed_accounts/methods/list_managed_accounts' + insert: + - $ref: '#/components/x-stackQL-resources/managed_accounts/methods/create_managed_account' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/managed_accounts/methods/delete_managed_account' + replace: [] + id: snowflake.managed_account.managed_accounts + name: managed_accounts + title: Managed Accounts +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] +tags: +- name: managed-account diff --git a/providers/src/snowflake/v00.00.00000/services/network-policy.yaml b/providers/src/snowflake/v00.00.00000/services/network-policy.yaml new file mode 100644 index 00000000..c9494684 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/network-policy.yaml @@ -0,0 +1,893 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Network Policy API + description: The Snowflake Network Policy API is a REST API that you can use to + access, update, and perform certain actions on Network Policy resource in a Snowflake + database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/network-policies: + get: + summary: List network policies + tags: + - network-policy + description: List network policies + operationId: listNetworkPolicies + parameters: [] + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NetworkPolicy' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a network policy + tags: + - network-policy + description: Create a network policy + operationId: createNetworkPolicy + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkPolicy' + /api/v2/network-policies/{name}: + get: + summary: Fetch a network policy + tags: + - network-policy + description: Fetch a network policy + operationId: fetchNetworkPolicy + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkPolicy' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a network policy + tags: + - network-policy + description: Delete a network policy + operationId: deleteNetworkPolicy + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + NetworkPolicy: + type: object + description: A Snowflake network policy + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the network policy + allowed_network_rule_list: + type: array + items: + type: string + description: List of names of allowed network rules in a network policy + blocked_network_rule_list: + type: array + items: + type: string + description: List of names of blocked network rules in a network policy + allowed_ip_list: + type: array + items: + type: string + description: List of allowed IPs in a network policy + blocked_ip_list: + type: array + items: + type: string + description: List of blocked IPs in a network policy + comment: + type: string + description: user comment associated to an object in the dictionary + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the network policy was created. + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the network policy + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the network policy + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + network_policies: + methods: + list_network_policies: + operation: + $ref: '#/paths/~1api~1v2~1network-policies/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_network_policy: + operation: + $ref: '#/paths/~1api~1v2~1network-policies/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_network_policy: + operation: + $ref: '#/paths/~1api~1v2~1network-policies~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_network_policy: + operation: + $ref: '#/paths/~1api~1v2~1network-policies~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/network_policies/methods/list_network_policies' + - $ref: '#/components/x-stackQL-resources/network_policies/methods/fetch_network_policy' + insert: + - $ref: '#/components/x-stackQL-resources/network_policies/methods/create_network_policy' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/network_policies/methods/delete_network_policy' + replace: [] + id: snowflake.network_policy.network_policies + name: network_policies + title: Network Policies diff --git a/providers/src/snowflake/v00.00.00000/services/notebook.yaml b/providers/src/snowflake/v00.00.00000/services/notebook.yaml new file mode 100644 index 00000000..a43abca9 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/notebook.yaml @@ -0,0 +1,1237 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Notebook API + description: The Snowflake Notebook API is a REST API that you can use to access, + update, and perform certain actions on Notebook resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/notebooks: + get: + summary: List notebooks + tags: + - notebook + description: List notebooks + operationId: listNotebooks + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Notebook' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a notebook + tags: + - notebook + description: Create a notebook + operationId: createNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Notebook' + /api/v2/databases/{database}/schemas/{schema}/notebooks/{name}: + get: + summary: Fetch a notebook + tags: + - notebook + description: Fetch a notebook + operationId: fetchNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Notebook' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a notebook + tags: + - notebook + description: Delete a notebook + operationId: deleteNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/notebooks/{name}:execute: + post: + summary: Execute a Notebook + tags: + - notebook + description: Execute a Notebook + operationId: executeNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/asyncExec' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/notebooks/{name}:rename: + post: + summary: Changes the name of the notebook to new name. + tags: + - notebook + description: Changes the name of the notebook to new name. The new identifier + must be unique for the schema. + operationId: renameNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: targetDatabase + description: Database of the target resource. Defaults to the source's database + in: query + required: false + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - name: targetSchema + description: Schema of the target resource. Defaults to the source's schema + in: query + required: false + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - name: targetName + description: Name of the target resource. + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/notebooks/{name}:add-live-version: + post: + summary: Adds a LIVE version to the notebook + tags: + - notebook + description: Adds a LIVE version to the notebook + operationId: addLiveVersionNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - name: fromLast + description: Sets the LIVE version to the LAST version of the notebook + in: query + required: false + schema: + type: boolean + - name: comment + description: Sets a comment for the notebook or version of the notebook + in: query + required: false + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/notebooks/{name}:commit: + post: + summary: Commits the LIVE version of the notebook + tags: + - notebook + description: If a Git connection is set up for the notebook, commits the LIVE + version of the notebook to the Git repository + operationId: commitNotebook + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - name: version + description: live version of the alias + in: query + required: false + schema: + type: string + - name: comment + description: Sets a comment for the notebook or version of the notebook + in: query + required: false + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Notebook: + type: object + description: A Snowflake notebook + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the notebook + version: + type: string + description: User specified version alias + fromLocation: + type: string + description: Location to copy the file from. This must be a Snowflake stage + location. + main_file: + type: string + description: Name + path of the file for the Notebook + comment: + type: string + description: user comment associated to an object in the dictionary + default_version: + type: string + description: The default version name of a file based entity. + query_warehouse: + type: string + description: Warehouse against which the queries issued by the Streamlit + app are run against + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the notebook was created. + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Database in which the notebook is stored + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Schema in which the notebook is stored + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the notebook + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the notebook + url_id: + type: string + readOnly: true + description: Unique ID associated with the notebook object. + title: + type: string + readOnly: true + description: User facing title of the Streamlit app or an Organization Profile + default_packages: + type: string + readOnly: true + description: Default packages of the notebook + user_packages: + type: string + readOnly: true + description: User packages of the notebook + runtime_name: + type: string + readOnly: true + description: The runtime to run the Streamlit or Notebook on. If this is + not set, the warehouse is assumed + compute_pool: + type: string + readOnly: true + description: Compute pool name where the snowservice runs + import_urls: + type: array + items: + type: string + readOnly: true + description: List of urls + external_access_integrations: + type: array + items: + type: string + readOnly: true + description: List of external access integrations attached to this function + external_access_secrets: + type: string + readOnly: true + description: Secrets to be used with this function for external access + idle_auto_shutdown_time_seconds: + type: integer + format: int64 + readOnly: true + description: Sets the time in seconds for when to shutdown an idle Notebook. + default_version_details: + $ref: '#/components/schemas/VersionDetails' + readOnly: true + last_version_details: + $ref: '#/components/schemas/VersionDetails' + readOnly: true + live_version_location_uri: + type: string + readOnly: true + description: The current version location + budget: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Name of the budget if the notebook is monitored by a budget + required: + - name + VersionDetails: + type: object + description: The version details of a file based entity + properties: + name: + type: string + readOnly: true + description: The last version name + alias: + type: string + readOnly: true + description: The default/last version alias of a file based entity. + location_url: + type: string + readOnly: true + description: The default/last version location. + source_location_uri: + type: string + readOnly: true + description: The default/last version source location. + git_commit_hash: + type: string + readOnly: true + description: The default/last version git commit# + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + notebooks: + methods: + list_notebooks: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + execute_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}:execute/post' + response: + mediaType: '' + openAPIDocKey: '200' + rename_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}:rename/post' + response: + mediaType: '' + openAPIDocKey: '200' + add_live_version_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}:add-live-version/post' + response: + mediaType: '' + openAPIDocKey: '200' + commit_notebook: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1notebooks~1{name}:commit/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/notebooks/methods/list_notebooks' + - $ref: '#/components/x-stackQL-resources/notebooks/methods/fetch_notebook' + insert: + - $ref: '#/components/x-stackQL-resources/notebooks/methods/create_notebook' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/notebooks/methods/delete_notebook' + replace: [] + id: snowflake.notebook.notebooks + name: notebooks + title: Notebooks +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/notification-integration.yaml b/providers/src/snowflake/v00.00.00000/services/notification-integration.yaml new file mode 100644 index 00000000..0bbc9f22 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/notification-integration.yaml @@ -0,0 +1,1048 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Notification Integration API + description: The Snowflake Notification Integration API is a REST API that you can + use to access, update, and perform certain actions on Notification Integration + resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/notification-integrations: + get: + summary: List notification integrations + tags: + - notification-integration + description: List notification integrations + operationId: listNotificationIntegrations + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a notification integration + tags: + - notification-integration + description: Create a notification integration + operationId: createNotificationIntegration + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationIntegration' + /api/v2/notification-integrations/{name}: + get: + summary: Fetch a notification integration + tags: + - notification-integration + description: Fetch a notification integration + operationId: fetchNotificationIntegration + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationIntegration' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a notification integration + tags: + - notification-integration + description: Delete a notification integration + operationId: deleteNotificationIntegration + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + NotificationIntegration: + type: object + description: A Snowflake notification + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the notification. + enabled: + type: boolean + description: Whether the notification integration is enabled. + comment: + type: string + description: Comment for the notification integration. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the notification was created. + notification_hook: + $ref: '#/components/schemas/NotificationHook' + required: + - name + - notification_hook + NotificationHook: + type: object + properties: + type: + type: string + enum: + - EMAIL + - WEBHOOK + - QUEUE_AWS_SNS_OUTBOUND + - QUEUE_AZURE_EVENT_GRID_OUTBOUND + - QUEUE_GCP_PUBSUB_OUTBOUND + - QUEUE_AZURE_EVENT_GRID_INBOUND + - QUEUE_GCP_PUBSUB_INBOUND + description: Type of NotificationHook, can be QUEUE, EMAIL or WEBHOOK + required: + - type + discriminator: + propertyName: type + mapping: + EMAIL: NotificationEmail + WEBHOOK: NotificationWebhook + QUEUE_AWS_SNS_OUTBOUND: NotificationQueueAwsSnsOutbound + QUEUE_AZURE_EVENT_GRID_OUTBOUND: NotificationQueueAzureEventGridOutbound + QUEUE_GCP_PUBSUB_OUTBOUND: NotificationQueueGcpPubsubOutbound + QUEUE_AZURE_EVENT_GRID_INBOUND: NotificationQueueAzureEventGridInbound + QUEUE_GCP_PUBSUB_INBOUND: NotificationQueueGcpPubsubInbound + NotificationEmail: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + allowed_recipients: + type: array + items: + type: string + description: A comma-separated list of quoted email addresses that can receive + notification emails from this integration. + default_recipients: + type: array + items: + type: string + description: A comma-separated list of default recipients for messages sent + with this integration. + default_subject: + type: string + description: the default subject line for messages sent with this integration. + NotificationWebhook: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + webhook_url: + type: string + description: The URL for the webhook. The URL must use the https:// protocol. + webhook_secret: + $ref: '#/components/schemas/WebhookSecret' + description: The secret to use with this integration. + webhook_body_template: + type: string + description: A template for the body of the HTTP request to send for the + notification. + webhook_headers: + type: object + additionalProperties: + type: string + description: A list of HTTP headers and values to include in the HTTP request + for the webhook. + required: + - webhook_url + WebhookSecret: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: The name of the secret. + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: The database which stores the secret. + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: The schema which stores the secret. + required: + - name + - database_name + - schema_name + NotificationQueueAwsSnsOutbound: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + aws_sns_topic_arn: + type: string + description: Amazon Resource Name (ARN) of the Amazon SNS (SNS) topic to + which notifications are pushed. + aws_sns_role_arn: + type: string + description: ARN of the IAM role that has permissions to publish messages + to the SNS topic. + sf_aws_iam_user_arn: + type: string + readOnly: true + description: ARN for the Snowflake IAM user created for your account. + sf_aws_external_id: + type: string + readOnly: true + description: External ID for the Snowflake IAM user created for your account. + NotificationQueueAzureEventGridOutbound: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + azure_event_grid_topic_endpoint: + type: string + description: Event Grid topic endpoint to which Snowpipe pushes notifications. + azure_tenant_id: + type: string + description: ID of the Azure Active Directory tenant used for identity management. + azure_consent_url: + type: string + readOnly: true + description: URL to the Microsoft permissions request page. + azure_multi_tenant_app_name: + type: string + readOnly: true + description: Name of the Snowflake client application created for your account. + NotificationQueueGcpPubsubOutbound: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + gcp_pubsub_topic_name: + type: string + description: Identification of the Pub/Sub topic to which Snowpipe pushes + notifications. + gcp_pubsub_service_account: + type: string + readOnly: true + description: Google Cloud Platform (GCP) service account created for your + account. + NotificationQueueAzureEventGridInbound: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + azure_storage_queue_primary_uri: + type: string + description: the queue ID for the Azure Queue Storage queue created for + Event Grid notifications. + azure_tenant_id: + type: string + description: the ID of the Azure Active Directory tenant used for identity + management. + azure_consent_url: + type: string + readOnly: true + description: URL to the Microsoft permissions request page. + azure_multi_tenant_app_name: + type: string + readOnly: true + description: Name of the Snowflake client application created for your account. + NotificationQueueGcpPubsubInbound: + allOf: + - $ref: '#/components/schemas/NotificationHook' + properties: + gcp_pubsub_subscription_name: + type: string + description: Pub/Sub topic subscription ID used to allow Snowflake access + to event messages. + gcp_pubsub_service_account: + type: string + readOnly: true + description: Google Cloud Platform (GCP) service account created for your + account. + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + notification_integrations: + methods: + list_notification_integrations: + operation: + $ref: '#/paths/~1api~1v2~1notification-integrations/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_notification_integration: + operation: + $ref: '#/paths/~1api~1v2~1notification-integrations/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_notification_integration: + operation: + $ref: '#/paths/~1api~1v2~1notification-integrations~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_notification_integration: + operation: + $ref: '#/paths/~1api~1v2~1notification-integrations~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/notification_integrations/methods/list_notification_integrations' + - $ref: '#/components/x-stackQL-resources/notification_integrations/methods/fetch_notification_integration' + insert: + - $ref: '#/components/x-stackQL-resources/notification_integrations/methods/create_notification_integration' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/notification_integrations/methods/delete_notification_integration' + replace: [] + id: snowflake.notification_integration.notification_integrations + name: notification_integrations + title: Notification Integrations +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/pipe.yaml b/providers/src/snowflake/v00.00.00000/services/pipe.yaml new file mode 100644 index 00000000..667d02cf --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/pipe.yaml @@ -0,0 +1,992 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Pipe API + description: The Snowflake Pipe API is a REST API that you can use to access, update, + and perform certain actions on Pipe resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/pipes: + get: + summary: List pipes + tags: + - pipe + description: List pipes + operationId: listPipes + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pipe' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a pipe + tags: + - pipe + description: Create a pipe + operationId: createPipe + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Pipe' + /api/v2/databases/{database}/schemas/{schema}/pipes/{name}: + get: + summary: Fetch a pipe + tags: + - pipe + description: Fetch a pipe + operationId: fetchPipe + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/Pipe' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a pipe + tags: + - pipe + description: Delete a pipe + operationId: deletePipe + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/pipes/{name}:refresh: + post: + summary: Refresh the pipe + tags: + - pipe + description: Refresh the pipe + operationId: refreshPipe + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: prefix + description: Path (or prefix) appended to the stage reference in the pipe + definition. The path limits the set of files to load. + in: query + required: false + schema: + type: string + - name: modified_after + description: Timestamp (in ISO-8601 format) of the oldest data files to copy + into the Snowpipe ingest queue based on the LAST_MODIFIED date (i.e. date + when a file was staged) + in: query + required: false + schema: + type: string + format: date-time + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Pipe: + type: object + description: A Snowflake pipe + properties: + name: + type: string + description: Name of the pipe + comment: + type: string + description: user comment associated to an object in the dictionary + auto_ingest: + type: boolean + description: TRUE if all files from stage need to be auto-ingested + error_integration: + type: string + description: Link to integration object that point to a user provided Azure + storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe + or a user task failure or replication failure) will be sent to this queue + to notify customers + aws_sns_topic: + type: string + description: Optional, if provided, auto_ingest pipe will only receive messages + from this SNS topic. + integration: + type: string + description: Link to integration object that ties a user provided storage + queue to an auto_ingest enabled pipe. Required for auto_ingest to work + on azure. + copy_statement: + type: string + description: COPY INTO statement used to load data from queued files + into a Snowflake table. This statement serves as the text/definition for + the pipe and is displayed in the SHOW PIPES output + pattern: (?i)^COPY INTO .* + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the pipe was created. + database_name: + type: string + readOnly: true + description: Database in which the pipe is stored + schema_name: + type: string + readOnly: true + description: Schema in which the pipe is stored + owner: + type: string + readOnly: true + description: Role that owns the pipe + pattern: + type: string + readOnly: true + description: PATTERN copy option value in the COPY INTO
statement + in the pipe definition, if the copy option was specified. + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the pipe + invalid_reason: + type: string + readOnly: true + description: Displays some detailed information for your pipes that may + have issues + budget: + type: string + readOnly: true + description: Name of the budget if the pipe is monitored by a budget + required: + - name + - copy_statement + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + pipes: + methods: + list_pipes: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1pipes/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_pipe: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1pipes/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_pipe: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1pipes~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_pipe: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1pipes~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + refresh_pipe: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1pipes~1{name}:refresh/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/pipes/methods/list_pipes' + - $ref: '#/components/x-stackQL-resources/pipes/methods/fetch_pipe' + insert: + - $ref: '#/components/x-stackQL-resources/pipes/methods/create_pipe' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/pipes/methods/delete_pipe' + replace: [] + id: snowflake.pipe.pipes + name: pipes + title: Pipes +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/procedure.yaml b/providers/src/snowflake/v00.00.00000/services/procedure.yaml new file mode 100644 index 00000000..0f3920c5 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/procedure.yaml @@ -0,0 +1,1470 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Procedure API + description: The Snowflake Procedure API is a REST API that you can use to access, + update, and perform certain actions on Procedure resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/procedures: + get: + summary: List procedures + tags: + - procedure + description: List procedures + operationId: listProcedures + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Procedure' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a procedure + tags: + - procedure + description: Create a procedure + operationId: createProcedure + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Procedure' + /api/v2/databases/{database}/schemas/{schema}/procedures/{nameWithArgs}: + get: + summary: Fetch a procedure + tags: + - procedure + description: Fetch a procedure + operationId: fetchProcedure + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Procedure' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a procedure + tags: + - procedure + description: Delete a procedure + operationId: deleteProcedure + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/procedures/{nameWithArgs}:call: + post: + summary: Call a procedure + tags: + - procedure + description: Call a procedure + operationId: callProcedure + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: {} + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CallArgumentList' +components: + schemas: + Procedure: + type: object + description: A Snowflake procedure + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the procedure + execute_as: + type: string + enum: + - CALLER + - OWNER + description: What permissions should the procedure execution be called with + is_secure: + type: boolean + description: Specifies whether the function/procedure is secure or not + arguments: + type: array + items: + $ref: '#/components/schemas/Argument' + description: List of arguments for the function/procedure + return_type: + $ref: '#/components/schemas/ReturnType' + description: Return type of the function/procedure. Should be a SQL data + type or a table + language_config: + $ref: '#/components/schemas/FunctionLanguage' + description: Language that the function/procedure is written in + comment: + type: string + description: Specifies a comment for the function/procedure + body: + type: string + description: Function/procedure definition + created_on: + type: string + format: date-time + readOnly: true + description: The date and time when the function/procedure was created + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The name of the schema in which the function/procedure exists. + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The name of the database in which the function/procedure exists. + min_num_arguments: + type: integer + readOnly: true + description: The minimum number of arguments + max_num_arguments: + type: integer + readOnly: true + description: The maximum number of arguments + owner: + type: string + readOnly: true + description: Role that owns the function/procedure + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the function/procedure + is_builtin: + type: boolean + readOnly: true + description: If the function/procedure is built-in or not (user-defined) + required: + - name + - arguments + - return_type + - language_config + - body + Argument: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Argument name + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Argument data type + default_value: + type: string + description: Default value of the argument + required: + - name + - datatype + ReturnType: + type: object + properties: + type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Type of the return, can be either DATATYPE or TABLE + required: + - type + discriminator: + propertyName: type + mapping: + DATATYPE: ReturnDataType + TABLE: ReturnTable + ReturnDataType: + allOf: + - $ref: '#/components/schemas/ReturnType' + properties: + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Return data type + nullable: + type: boolean + description: Argument null return acceptance criteria + required: + - datatype + ReturnTable: + allOf: + - $ref: '#/components/schemas/ReturnType' + properties: + column_list: + type: array + items: + $ref: '#/components/schemas/ColumnType' + description: List of table columns to return + ColumnType: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Argument name + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Argument data type + required: + - name + - datatype + FunctionLanguage: + type: object + properties: + language: + type: string + description: 'Language that the function/procedure is written in. Possible + values include: JAVA, JAVASCRIPT, PYTHON, SCALA, SQL' + called_on_null_input: + type: boolean + description: Decide if the function/procedure can receive null input + required: + - language + discriminator: + propertyName: language + mapping: + JAVA: JavaFunction + PYTHON: PythonFunction + SCALA: ScalaFunction + JAVASCRIPT: JavaScriptFunction + SQL: SQLFunction + BaseLanguage: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + properties: + runtime_version: + type: string + description: Runtime version of the function's/procedure's specified language + packages: + type: array + items: + type: string + description: Packages to include with the function/procedure + imports: + type: array + items: + type: string + description: List of imports + handler: + type: string + description: Fully qualified method name including the package and the class + required: + - runtime_version + - packages + - handler + JavaFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + external_access_integrations: + type: array + items: + type: string + description: List of external access integrations attached to this function/procedure + secrets: + type: object + additionalProperties: + type: string + description: Secrets to be used with this function/procedure for external + access + target_path: + type: string + description: Specifies where Snowflake should write the compiled code for + inline procedures + PythonFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + external_access_integrations: + type: array + items: + type: string + description: List of external access integrations attached to this function/procedure + secrets: + type: object + additionalProperties: + type: string + description: Secrets to be used with this function/procedure for external + access + ScalaFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + target_path: + type: string + description: Specifies where Snowflake should write the compiled code for + inline function/procedures + JavaScriptFunction: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + SQLFunction: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + CallArgumentList: + type: object + properties: + call_arguments: + type: array + items: + $ref: '#/components/schemas/CallArgument' + description: Call Argument list + required: + - call_arguments + CallArgument: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the call argument + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Call argument data type + value: + description: Value of the call argument + required: + - name + - datatype + - value + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + procedures: + methods: + list_procedures: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1procedures/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_procedure: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1procedures/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_procedure: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1procedures~1{nameWithArgs}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_procedure: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1procedures~1{nameWithArgs}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + call_procedure: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1procedures~1{nameWithArgs}:call/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/procedures/methods/list_procedures' + - $ref: '#/components/x-stackQL-resources/procedures/methods/fetch_procedure' + insert: + - $ref: '#/components/x-stackQL-resources/procedures/methods/create_procedure' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/procedures/methods/delete_procedure' + replace: [] + id: snowflake.procedure.procedures + name: procedures + title: Procedures +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/result.yaml b/providers/src/snowflake/v00.00.00000/services/result.yaml new file mode 100644 index 00000000..67cccb40 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/result.yaml @@ -0,0 +1,710 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Result API + description: The Snowflake Result API is a REST API that you can use to check request + status and fetch request response. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/results/{result_handler}: + get: + summary: Check result status or fetch request + tags: + - result + description: Get result status or the result when it is ready. + operationId: fetchResult + parameters: + - name: result_handler + in: path + required: true + schema: + type: string + description: The opaque result id. + - name: page + in: query + required: false + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + description: Number of the page of results to return. The number can range + from 0 to the total number of pages minus 1. + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: {} + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + schemas: + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + results: + methods: + fetch_result: + operation: + $ref: '#/paths/~1api~1v2~1results~1{result_handler}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: [] + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.result.results + name: results + title: Results +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/role.yaml b/providers/src/snowflake/v00.00.00000/services/role.yaml new file mode 100644 index 00000000..1bba5e76 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/role.yaml @@ -0,0 +1,1463 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Role API + description: The Snowflake Role API is a REST API that you can use to access, update, + and perform certain actions on Role resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/roles: + get: + summary: List roles + tags: + - role + description: List roles + operationId: listRoles + parameters: + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a role + tags: + - role + description: Create a role + operationId: createRole + parameters: + - $ref: '#/components/parameters/createMode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + /api/v2/roles/{name}: + delete: + summary: Delete a role + tags: + - role + description: Delete a role + operationId: deleteRole + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/roles/{name}/grants: + get: + summary: List all grants to the role + tags: + - role + description: List all grants to the role + operationId: listGrants + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Grant privileges to the role + tags: + - role + description: Grant privileges to the role + operationId: grantPrivileges + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/roles/{name}/grants:revoke: + post: + summary: Revoke grants from the role + tags: + - role + description: Revoke grants from the role + operationId: revokeGrants + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/mode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/roles/{name}/grants-of: + get: + summary: List all grants of the role + tags: + - role + description: List all grants of the role + operationId: listGrantsOf + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GrantOf' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/roles/{name}/grants-on: + get: + summary: List all grants on the role + tags: + - role + description: List all grants on the role + operationId: listGrantsOn + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GrantOn' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/roles/{name}/future-grants: + get: + summary: List all future grants to the role + tags: + - role + description: List all future grants to the role + operationId: listFutureGrants + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Grant future privileges to the role + tags: + - role + description: Grant future privileges to the role + operationId: grantFuturePrivileges + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + /api/v2/roles/{name}/future-grants:revoke: + post: + summary: Revoke future grants from the role + tags: + - role + description: Revoke future grants from the role + operationId: revokeFutureGrants + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/mode' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' +components: + schemas: + Role: + type: object + description: A Snowflake role + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the role. + comment: + type: string + description: Comment of the role. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the role was created. + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Specifies the role that owns this role. + is_default: + type: boolean + readOnly: true + description: Specifies whether the role being fetched is the user's default + role. + is_current: + type: boolean + readOnly: true + description: Specifies whether the role being fetched is the user's current + role. + is_inherited: + type: boolean + readOnly: true + description: Specifies whether the role used to run the command inherits + the specified role. + assigned_to_users: + type: integer + format: int64 + readOnly: true + description: The number of users to whom this role has been assigned. + granted_to_roles: + type: integer + format: int64 + readOnly: true + description: The number of roles to which this role has been granted. + granted_roles: + type: integer + format: int64 + readOnly: true + description: The number of roles that have been granted to this role. + required: + - name + Grant: + type: object + properties: + securable: + $ref: '#/components/schemas/Securable' + description: Securable of the grant + containing_scope: + $ref: '#/components/schemas/ContainingScope' + description: Containing scope of the grant + securable_type: + type: string + description: Type of the securable to be granted. + grant_option: + type: boolean + description: If true, allows the recipient role to grant the privileges + to other roles. + privileges: + type: array + items: + type: string + description: List of privileges to be granted. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the grant was created + granted_by: + type: string + readOnly: true + description: The role that granted this privilege to this grantee + required: + - securable_type + Securable: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable if applicable. + service: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Service name of the securable if applicable. + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the securable if applicable. + required: + - name + ContainingScope: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable scope if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable scope if applicable. + required: + - database + GrantOf: + type: object + properties: + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the grant was created + role: + type: string + readOnly: true + description: The name of the role + granted_to: + type: string + readOnly: true + description: The type of the grantee, can be USER or ROLE + grantee_name: + type: string + readOnly: true + description: The name of the grantee + granted_by: + type: string + readOnly: true + description: The role that granted this role to this grantee + GrantOn: + type: object + properties: + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the grant was created + privilege: + type: string + readOnly: true + description: The name of the privilege + granted_on: + type: string + readOnly: true + description: The type of of the role + name: + type: string + readOnly: true + description: The name of the role + granted_to: + type: string + readOnly: true + description: The type of the grantee + grantee_name: + type: string + readOnly: true + description: The name of the grantee + grant_option: + type: string + readOnly: true + description: If true, allows the recipient role to grant the privileges + to other roles. + granted_by: + type: string + readOnly: true + description: The role that granted this privilege to this grantee + granted_by_role_type: + type: string + readOnly: true + description: Type of the role that granted this privilege to this grantee + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + roles: + methods: + list_roles: + operation: + $ref: '#/paths/~1api~1v2~1roles/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_role: + operation: + $ref: '#/paths/~1api~1v2~1roles/post' + response: + mediaType: '' + openAPIDocKey: '200' + delete_role: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/roles/methods/list_roles' + insert: + - $ref: '#/components/x-stackQL-resources/roles/methods/create_role' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/roles/methods/delete_role' + replace: [] + id: snowflake.role.roles + name: roles + title: Roles + grants: + methods: + list_grants: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1grants/get' + response: + mediaType: application/json + openAPIDocKey: '200' + grant_privileges: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1grants/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_grants: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1grants:revoke/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants/methods/list_grants' + insert: + - $ref: '#/components/x-stackQL-resources/grants/methods/grant_privileges' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/grants/methods/revoke_grants' + replace: [] + id: snowflake.role.grants + name: grants + title: Grants + grants_of: + methods: + list_grants_of: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1grants-of/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants_of/methods/list_grants_of' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.role.grants_of + name: grants_of + title: Grants Of + grants_on: + methods: + list_grants_on: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1grants-on/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants_on/methods/list_grants_on' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.role.grants_on + name: grants_on + title: Grants On + future_grants: + methods: + list_future_grants: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1future-grants/get' + response: + mediaType: application/json + openAPIDocKey: '200' + grant_future_privileges: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1future-grants/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_future_grants: + operation: + $ref: '#/paths/~1api~1v2~1roles~1{name}~1future-grants:revoke/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/list_future_grants' + insert: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/grant_future_privileges' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/future_grants/methods/revoke_future_grants' + replace: [] + id: snowflake.role.future_grants + name: future_grants + title: Future Grants +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/schema.yaml b/providers/src/snowflake/v00.00.00000/services/schema.yaml new file mode 100644 index 00000000..629f1944 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/schema.yaml @@ -0,0 +1,1189 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Schema API + description: The Snowflake Schema API is a REST API that you can use to access, + update, and perform certain actions on a Snowflake schema. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas: + get: + summary: List schemas. + tags: + - schema + description: Lists the accessible schemas. + operationId: listSchemas + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: history + in: query + description: 'Whether to include dropped schemas that have not yet been purged. + Default: `false`.' + schema: + type: boolean + default: false + responses: + '200': + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Schema' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a schema. + tags: + - schema + description: Creates a schema, with modifiers as query parameters. You must + provide the full schema definition when creating a schema. + operationId: createSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/createMode' + - name: kind + in: query + description: Type of schema to create. Currently, Snowflake supports only + `transient` and `permanent` (also represented by the empty string). + schema: + type: string + default: '' + deprecated: true + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{name}:clone: + post: + summary: Clone a schema. + tags: + - schema + description: Clones an existing schema, with modifiers as query parameters. + You must provide the full schema definition when cloning an existing schema. + operationId: cloneSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: kind + in: query + description: Type of schema to clone. Currently, Snowflake supports only `transient` + and `permanent` (also represented by the empty string). + schema: + type: string + default: '' + deprecated: true + - name: targetDatabase + in: query + description: Database of the newly created schema. Defaults to the source + schema's database. + schema: + $ref: '#/components/schemas/Identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaClone' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{name}:undrop: + post: + summary: Undrop a schema. + tags: + - schema + description: Undrops schema. + operationId: undropSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{name}: + get: + tags: + - schema + description: Fetches a schema. + operationId: fetchSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a new, or alters an existing, schema. + tags: + - schema + description: Creates a new, or alters an existing, schema. You must provide + the full schema definition even when altering an existing schema. + operationId: createOrAlterSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - name: kind + in: query + description: Type of schema to create. Currently, Snowflake supports only + `transient` and `permanent` (also represented by the empty string). + schema: + type: string + default: '' + deprecated: true + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Schema' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a schema. + tags: + - schema + description: Deletes the specified schema. If you enable the `ifExists` parameter, + the operation succeeds even if the schema does not exist. Otherwise, a 404 + failure is returned if the schema does not exist. if the drop is unsuccessful. + operationId: deleteSchema + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: restrict + in: query + description: 'Whether to drop the schema if foreign keys exist that reference + any tables in the schema. + + - `true`: Return a warning about existing foreign key references and don''t + drop the schema. + + - `false`: Drop the schema and all objects in the database, including tables + with primary or unique keys that are referenced by foreign keys in other + tables. + + Default: `false`.' + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Schema: + type: object + description: Snowflake schema definition. + properties: + created_on: + type: string + format: date-time + readOnly: true + description: Date and time the schema was created. + name: + $ref: '#/components/schemas/Identifier' + description: Name of the schema. + kind: + type: string + enum: + - PERMANENT + - TRANSIENT + default: PERMANENT + description: Schema type, permanent (default) or transient. + is_default: + type: boolean + readOnly: true + description: Default schema for a user. + is_current: + type: boolean + readOnly: true + description: Current schema for the session. + database_name: + type: string + readOnly: true + description: Database that the schema belongs to + owner: + type: string + readOnly: true + description: Name of the role that owns the schema. + comment: + type: string + description: Optional comment in which to store information related to the + schema. + options: + type: string + readOnly: true + managed_access: + type: boolean + default: false + description: Whether this schema is a managed access schema that centralizes + privilege management with the schema owner. + retention_time: + type: integer + readOnly: true + description: Number of days that historical data is retained for Time Travel. + dropped_on: + type: string + format: date-time + readOnly: true + nullable: true + description: Date and time the schema was dropped. + owner_role_type: + type: string + readOnly: true + description: Type of role that owns the object, either `ROLE` or `DATABASE_ROLE`. + budget: + type: string + readOnly: true + description: Budget that defines a monthly spending limit on the compute + costs for a Snowflake account or a custom group of Snowflake objects. + data_retention_time_in_days: + type: integer + description: Number of days for which Time Travel actions (CLONE and UNDROP) + can be performed on the schema, as well as specifying the default Time + Travel retention time for all tables created in the schema + default_ddl_collation: + type: string + description: Specifies a default collation specification for all tables + added to the schema. You an override the default at the schema and individual + table levels. + log_level: + type: string + description: Severity level of messages that should be ingested and made + available in the active event table. Currently, Snowflake supports only + `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + pipe_execution_paused: + type: boolean + description: Whether pipe execution is paused. + max_data_extension_time_in_days: + type: integer + description: Maximum number of days for which Snowflake can extend the data + retention period for tables in the schema to prevent streams on the tables + from becoming stale. + suspend_task_after_num_failures: + type: integer + description: Specifies the number of consecutive failed task runs after + which the current task is suspended automatically. + trace_level: + type: string + description: How trace events are ingested into the event table. Currently, + Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + user_task_managed_initial_warehouse_size: + type: string + description: Size of the compute resources to provision for the first run + of the serverless task, before a task history is available for Snowflake + to determine an ideal size. + serverless_task_min_statement_size: + type: string + description: Specifies the minimum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. + serverless_task_max_statement_size: + type: string + description: Specifies the maximum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. + user_task_timeout_ms: + type: integer + description: Time limit, in milliseconds, for a single run of the task before + it times out. + required: + - name + SchemaClone: + type: object + description: Schema clone definition. + allOf: + - $ref: '#/components/schemas/Schema' + properties: + point_of_time: + $ref: '#/components/schemas/PointOfTime' + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + schemas: + methods: + list_schemas: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas/post' + response: + mediaType: '' + openAPIDocKey: '200' + clone_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_schema: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/schemas/methods/list_schemas' + - $ref: '#/components/x-stackQL-resources/schemas/methods/fetch_schema' + insert: + - $ref: '#/components/x-stackQL-resources/schemas/methods/create_schema' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/schemas/methods/delete_schema' + replace: + - $ref: '#/components/x-stackQL-resources/schemas/methods/create_or_alter_schema' + id: snowflake.schema.schemas + name: schemas + title: Schemas +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/sqlapi.yaml b/providers/src/snowflake/v00.00.00000/services/sqlapi.yaml new file mode 100644 index 00000000..4ed63e8a --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/sqlapi.yaml @@ -0,0 +1,1292 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 2.0.0 + title: Snowflake SQL API + description: 'The Snowflake SQL API is a REST API that you can use to access and + update data in a Snowflake database. ' + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/statements: + parameters: + - $ref: '#/components/parameters/requestId' + - $ref: '#/components/parameters/async' + - $ref: '#/components/parameters/nullable' + - $ref: '#/components/parameters/accept' + - $ref: '#/components/parameters/userAgent' + - $ref: '#/components/parameters/snowflakeAuthorizationTokenType' + post: + operationId: SubmitStatement + summary: Submits a SQL statement for execution. + description: Submits one or more statements for execution. You can specify that + the statement should be executed asynchronously. + tags: + - statements + security: + - keyPair: [] + - ExternalOAuth: [] + - snowflakeOAuth: [] + requestBody: + required: true + description: Specifies the SQL statement to execute and the statement context. + content: + application/json: + schema: + type: object + properties: + statement: + description: 'SQL statement or batch of SQL statements to execute. + You can specify query, DML and DDL statements. The following statements + are not supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, + ROLLBACK, statements that set session variables, and statements + that create temporary tables and stages.' + type: string + timeout: + description: Timeout in seconds for statement execution. If the + execution of a statement takes longer than the specified timeout, + the execution is automatically canceled. To set the timeout to + the maximum value (604800 seconds), set timeout to 0. + type: integer + format: int64 + minimum: 0 + example: 10 + database: + description: Database in which the statement should be executed. + The value in this field is case-sensitive. + type: string + example: TESTDB + schema: + description: Schema in which the statement should be executed. The + value in this field is case-sensitive. + type: string + example: TESTSCHEMA + warehouse: + description: Warehouse to use when executing the statement. The + value in this field is case-sensitive. + type: string + example: TESTWH + role: + description: Role to use when executing the statement. The value + in this field is case-sensitive. + type: string + example: TESTROLE + bindings: + description: Values of bind variables in the SQL statement. When + executing the statement, Snowflake replaces placeholders ('?' + and ':name') in the statement with these specified values. + type: object + properties: {} + example: + '1': + type: FIXED + value: '123' + '2': + type: TEXT + value: teststring + parameters: + description: Session parameters that should be set before executing + the statement. + type: object + properties: + timezone: + description: Time zone to use when executing the statement. + type: string + example: america/los_angeles + query_tag: + description: Query tag that you want to associate with the SQL + statement. + type: string + example: tag-1234 + binary_output_format: + description: Output format for binary values. + type: string + example: HEX + date_output_format: + description: Output format for DATE values. + type: string + example: YYYY-MM-DD + time_output_format: + description: Output format for TIME values. + type: string + example: HH24:MI:SS.FF6 + timestamp_output_format: + description: Output format for TIMESTAMP values. + type: string + example: YYYY-MM-DDTHH24:MI:SS.FF6 + timestamp_ltz_output_format: + description: Output format for TIMESTAMP_LTZ values. + type: string + example: YYYY-MM-DDTHH24:MI:SS.FF6 + timestamp_ntz_output_format: + description: Output format for TIMESTAMP_NTZ values. + type: string + example: YYYY-MM-DDTHH24:MI:SS.FF6 + timestamp_tz_output_format: + description: Output format for TIMESTAMP_TZ values. + type: string + example: YYYY-MM-DDTHH24:MI:SS.FF6 TZHTZM + multi_statement_count: + description: Number of statements to execute when using multi-statement + capability. 0 implies variable number of statements. Negative + numbers are not allowed. + type: integer + example: 4 + default: 1 + example: + statement: select * from T where c1=? + timeout: 10 + database: TESTDB + schema: TESTSCHEMA + warehouse: TESTWH + bindings: + '1': + type: FIXED + value: '123' + responses: + '200': + description: The statement was executed successfully, and the response includes + any data requested. + content: + application/json: + schema: + $ref: '#/components/schemas/ResultSet' + headers: + link: + $ref: '#/components/headers/Link' + links: + GetStatementStatus: + operationId: GetStatementStatus + parameters: + statementHandle: $response.body#/resultMetaData.statementHandle + CancelStatement: + operationId: CancelStatement + parameters: + statementHandle: $response.body#/resultMetaData.statementHandle + '202': + description: The execution of the statement is still in progress. Use GET + /statements/ and specify the statement handle to check the status of the + statement execution. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryStatus' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + description: The execution of the statement exceeded the timeout period. + The execution of the statement was cancelled. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryStatus' + '415': + $ref: '#/components/responses/415UnsupportedMediaType' + '422': + description: An error occurred when executing the statement. Check the error + code and error message for details. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFailureStatus' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/statements/{statementHandle}: + parameters: + - $ref: '#/components/parameters/statementHandle' + - $ref: '#/components/parameters/requestId' + - $ref: '#/components/parameters/partition' + - $ref: '#/components/parameters/accept' + - $ref: '#/components/parameters/userAgent' + - $ref: '#/components/parameters/snowflakeAuthorizationTokenType' + get: + operationId: GetStatementStatus + summary: Checks the status of the execution of a statement + description: Checks the status of the execution of the statement with the specified + statement handle. If the statement was executed successfully, the operation + returns the requested partition of the result set. + tags: + - statements + security: + - keyPair: [] + - ExternalOAuth: [] + - snowflakeOAuth: [] + responses: + '200': + description: The statement was executed successfully, and the response includes + any data requested. + headers: + link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/ResultSet' + '202': + description: The execution of the statement is still in progress. Use this + method again to check the status of the statement execution. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryStatus' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '415': + $ref: '#/components/responses/415UnsupportedMediaType' + '422': + description: An error occurred when executing the statement. Check the error + code and error message for details. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFailureStatus' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/statements/{statementHandle}/cancel: + parameters: + - $ref: '#/components/parameters/statementHandle' + - $ref: '#/components/parameters/requestId' + - $ref: '#/components/parameters/accept' + - $ref: '#/components/parameters/userAgent' + - $ref: '#/components/parameters/snowflakeAuthorizationTokenType' + post: + operationId: CancelStatement + summary: Cancels the execution of a statement. + security: + - keyPair: [] + - ExternalOAuth: [] + - snowflakeOAuth: [] + description: Cancels the execution of the statement with the specified statement + handle. + tags: + - statements + responses: + '200': + description: The execution of the statement was successfully canceled. + content: + application/json: + schema: + $ref: '#/components/schemas/CancelStatus' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '422': + description: An error occurred when cancelling the execution of the statement. + Check the error code and error message for details. + content: + application/json: + schema: + $ref: '#/components/schemas/CancelStatus' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + QueryStatus: + type: object + properties: + code: + type: string + sqlState: + type: string + message: + type: string + statementHandle: + type: string + format: uuid + createdOn: + type: integer + format: int64 + description: Timestamp that specifies when the statement execution started. + The timestamp is expressed in milliseconds since the epoch. + example: 1597090533987 + statementStatusUrl: + type: string + format: uri + description: URL that you can use to check the status of the execution of + the statement and the result set. + required: + - statementHandle + example: + code: '000000' + sqlState: '00000' + message: successfully executed + statementHandle: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae + createdOn: 1597090533987 + QueryFailureStatus: + type: object + properties: + code: + type: string + sqlState: + type: string + message: + type: string + statementHandle: + type: string + format: uuid + createdOn: + type: integer + format: int64 + description: "Timestamp that specifies when the statement execution started.\u200C\ + \ The timestamp is expressed in milliseconds since the epoch." + example: 1597090533987 + statementStatusUrl: + type: string + format: uri + required: + - message + - statementHandle + example: + code: '000123' + sqlState: '42601' + message: SQL compilation error + statementHandle: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae + createdOn: 1597090533987 + CancelStatus: + type: object + properties: + code: + type: string + sqlState: + type: string + message: + type: string + statementHandle: + type: string + format: uuid + statementStatusUrl: + type: string + format: uri + required: + - statementHandle + example: + message: successfully canceled + statementHandle: 536fad38-b564-4dc5-9892-a4543504df6c + ResultSet: + type: object + properties: + code: + type: string + example: '000123' + sqlState: + type: string + example: '42601' + message: + type: string + example: successfully executed + statementHandle: + type: string + format: uuid + example: 536fad38-b564-4dc5-9892-a4543504df6c + createdOn: + type: integer + format: int64 + description: "Timestamp that specifies when the statement execution started.\u200C\ + \ The timestamp is expressed in milliseconds since the epoch.\u200C" + example: 1597090533987 + statementStatusUrl: + type: string + format: uri + resultSetMetaData: + type: object + properties: + format: + type: string + enum: + - jsonv2 + description: For v2 endpoints the only possible value for this field + is jsonv2. + example: jsonv2 + numRows: + type: integer + format: int64 + description: The total number of rows of results. + example: 100 + rowType: + type: array + minItems: 1 + items: + type: object + properties: + name: + type: string + type: + type: string + length: + type: integer + format: int64 + minimum: 0 + precision: + type: integer + format: int64 + minimum: 0 + scale: + type: integer + format: int64 + minimum: 0 + nullable: + type: boolean + example: + - name: ROWNUM + type: FIXED + length: 0 + precision: 38 + scale: 0 + nullable: false + - name: ACCOUNT_ID + type: FIXED + length: 0 + precision: 38 + scale: 0 + nullable: false + - name: ACCOUNT_NAME + type: TEXT + length: 1024 + precision: 0 + scale: 0 + nullable: false + - name: ADDRESS + type: TEXT + length: 16777216 + precision: 0 + scale: 0 + nullable: true + - name: ZIP + type: TEXT + length: 100 + precision: 0 + scale: 0 + nullable: true + - name: CREATED_ON + type: TIMESTAMP_NTZ + length: 0 + precision: 0 + scale: 3 + nullable: false + partitionInfo: + description: Partition information + type: array + minItems: 0 + items: + type: object + properties: + rowCount: + type: integer + format: int64 + description: Number of rows in the partition. + minimum: 0 + example: 1324 + compressedSize: + type: integer + format: int64 + description: the partition size before the decompression. This + may or may not be present in the partitionInfo. Uncompressed + size would always be there. + minimum: 0 + example: 37436824 + uncompressedSize: + type: integer + format: int64 + description: the partition size after the decompression + minimum: 0 + example: 1343787384 + nullable: + description: false if null is replaced with a string 'null' otherwise + false + type: boolean + parameters: + type: object + properties: + binary_output_format: + type: string + example: HEX + date_output_format: + type: string + example: YYYY-MM-DD + time_output_format: + type: string + example: HH24:MI:SS + timestamp_output_format: + type: string + example: YYYY-MM-DD HH24:MI:SS.FF6 + timestamp_ltz_output_format: + type: string + example: YYYY-MM-DD HH24:MI:SS.FF6 + timestamp_ntz_output_format: + type: string + example: YYYY-MM-DD HH24:MI:SS.FF6 + timestamp_tz_output_format: + type: string + example: YYYY-MM-DDTHH24:MI:SS.FF6 TZHTZM + multi_statement_count: + type: integer + example: 4 + data: + description: Result set data. + type: array + minItems: 0 + items: + type: array + minItems: 0 + items: + type: string + nullable: true + minItems: 0 + example: + - - customer1 + - 1234 A Avenue + - '98765' + - '2019-08-10 23:56:34.123' + - - customer2 + - 987 B Street + - '98765' + - '2019-08-11 09:45:12.890' + - - customer3 + - 8777 C Blvd + - '98765' + - '2019-08-12 10:23:51.999' + - - customer4 + - 64646 D Circle + - '98765' + - '2019-08-13 01:54:32.000' + stats: + type: object + description: these stats might not be available for each request. + properties: + numRowsInserted: + type: integer + format: int64 + description: Number of rows that were inserted. + minimum: 0 + example: 12 + numRowsUpdated: + type: integer + format: int64 + description: Number of rows that were updated. + minimum: 0 + example: 9 + numRowsDeleted: + type: integer + format: int64 + description: Number of rows that were deleted. + minimum: 0 + example: 8 + numDuplicateRowsUpdated: + type: integer + format: int64 + description: Number of duplicate rows that were updated. + minimum: 0 + example: 20 + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + parameters: + requestId: + name: requestId + in: query + schema: + type: string + format: uuid + required: false + allowEmptyValue: false + description: Unique ID of the API request. This ensures that the execution is + idempotent. If not specified, a new UUID is generated and assigned. + async: + name: async + in: query + schema: + type: boolean + example: true + required: false + description: Set to true to execute the statement asynchronously and return + the statement handle. If the parameter is not specified or is set to false, + a statement is executed and the first result is returned if the execution + is completed in 45 seconds. If the statement execution takes longer to complete, + the statement handle is returned. + partition: + name: partition + in: query + schema: + type: integer + format: int64 + minimum: 0 + example: 2 + required: false + description: Number of the partition of results to return. The number can range + from 0 to the total number of partitions minus 1. + nullable: + name: nullable + in: query + schema: + type: boolean + example: true + required: false + description: Set to true to execute the statement to generate the result set + including null. If the parameter is set to false, the result set value null + will be replaced with a string 'null'. + statementHandle: + name: statementHandle + in: path + schema: + type: string + format: uuid + example: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae + required: true + allowEmptyValue: false + description: The handle of the statement that you want to use (e.g. to fetch + the result set or cancel execution). + userAgent: + name: User-Agent + in: header + schema: + type: string + example: myApplication/1.0 + required: true + allowEmptyValue: false + description: "Set this to the name and version of your application (e.g. \u201C\ + applicationName/applicationVersion\u201D). You must use a value that complies\ + \ with RFC 7231." + accept: + name: Accept + in: header + schema: + type: string + example: application/json + required: false + allowEmptyValue: false + description: The response payload format. The schema should be specified in + resultSetMetaData in the request payload. + acceptEncoding: + name: Accept-Encoding + in: header + schema: + type: string + example: gzip + required: false + allowEmptyValue: false + description: The response payload encoding. Optional. + snowflakeAuthorizationTokenType: + name: X-Snowflake-Authorization-Token-Type + in: header + schema: + type: string + example: KEYPAIR_JWT + required: false + allowEmptyValue: true + description: Specify the authorization token type for the Authorization header. + KEYPAIR_JWT is for Keypair JWT or OAUTH for oAuth token. If not specified, + OAUTH is assumed. + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + responses: + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + 403Forbidden: + description: Forbidden. The request is forbidden. This happens if the request + is made even if the API is not enabled. + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint is wrong. For example, if the application hits /api/api/hello + which doesn't exist, it will receive this code. + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. The application must change a method + for retry. + 415UnsupportedMediaType: + description: The request header Content-Type includes unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + 500InternalServerError: + description: Internal Server Error. The server hits an unrecoverable system + error. The response body may include the error code and message for further + guidance. The application owner may need to reach out the customer support. + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + headers: + Link: + schema: + type: string + description: Links to the partition of results (e.g. the first partition, + the last partition, etc.). The header can include multiple 'url' entries + with different 'rel' attribute values that specify the partition to return + ('first', 'next', 'prev', and 'last'). + example: ;rel="last",;rel="next",;rel="first" + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + x-stackQL-resources: + statements: + methods: + submit_statement: + operation: + $ref: '#/paths/~1api~1v2~1statements/post' + response: + mediaType: application/json + openAPIDocKey: '200' + get_statement_status: + operation: + $ref: '#/paths/~1api~1v2~1statements~1{statementHandle}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + cancel_statement: + operation: + $ref: '#/paths/~1api~1v2~1statements~1{statementHandle}~1cancel/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/statements/methods/submit_statement' + - $ref: '#/components/x-stackQL-resources/statements/methods/get_statement_status' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.sqlapi.statements + name: statements + title: Statements +security: +- keyPair: [] +- ExternalOAuth: [] +- snowflakeOAuth: [] +externalDocs: + url: https://docs.snowflake.com/en/developer-guide/sql-api/index.html diff --git a/providers/src/snowflake/v00.00.00000/services/stage.yaml b/providers/src/snowflake/v00.00.00000/services/stage.yaml new file mode 100644 index 00000000..b90568ec --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/stage.yaml @@ -0,0 +1,1191 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Stage API + description: The Snowflake Stage API is a REST API that you can use to access, update, + and perform certain actions on stage resources in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/stages: + get: + summary: List stages + tags: + - stage + description: Lists stages under the database and schema, with show options as + query parameters. + operationId: listStages + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Stage' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a stage + tags: + - stage + description: Create a stage, with standard create modifiers as query parameters. + See the Stage component definition for what is required to be provided in + the request body. + operationId: createStage + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Stage' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/stages/{name}: + get: + summary: Fetch a stage + tags: + - stage + description: Fetch a stage using the describe command output. + operationId: fetchStage + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Stage' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Delete a stage + tags: + - stage + description: Delete a stage with the stage name. If ifExists is used, the operation + will succeed even if the object does not exist. Otherwise, there will be a + failure if the drop is unsuccessful. + operationId: deleteStage + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/stages/{name}/files: + get: + summary: List files in the stage. + tags: + - stage + description: List files in the stage -- this is equivalent to LIST @stage. + operationId: listFiles + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/pattern' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/StageFile' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/stages/{name}/files/{filePath}:presigned-url: + post: + summary: Generate a presigned url and optionally encryption materials. + tags: + - stage + description: Generate a presigned url and optionally encryption materials for + uploading and downloading files. + operationId: getPresignedUrl + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - name: filePath + description: The full stage path of the file. + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PresignedUrlRequest' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/FileTransferMaterial' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + PresignedUrlRequest: + type: object + description: Request object to get presigned url of a file + properties: + expiration_time: + description: Expiration time of the generated presigned url in seconds. + type: integer + FileTransferMaterial: + type: object + description: Materials for uploading and downloading stage files + properties: + presigned_url: + type: string + description: Presigned url for file transfer, only works for Server Side + Encrypted Stages. + StageFile: + type: object + description: A file on a snowflake stage. + properties: + name: + type: string + description: Name of the file. + size: + type: string + description: Size of the file. + readOnly: true + md5: + type: string + description: md5 hash of the file. + readOnly: true + last_modified: + type: string + description: Date and time when the file was last modified. + readOnly: true + Stage: + type: object + description: A Snowflake stage. + properties: + name: + $ref: '#/components/schemas/Identifier' + description: String that specifies the identifier (i.e. name) for the stage. + kind: + type: string + enum: + - PERMANENT + - TEMPORARY + default: PERMANENT + description: Specifies whether the stage is permanent or temporary. + url: + type: string + description: URL for the external stage; blank for an internal stage. + endpoint: + type: string + description: The S3-compatible API endpoint associated with the stage; always + NULL for stages that are not S3-compatible. + storage_integration: + $ref: '#/components/schemas/Identifier' + description: Storage integration associated with the stage; always NULL + for an internal stage. + comment: + type: string + description: Specifies a comment for the stage. + credentials: + $ref: '#/components/schemas/Credentials' + writeOnly: true + description: Credentials of the stage. + encryption: + type: object + description: Encryption parameters of the stage. + writeOnly: true + properties: + type: + type: string + enum: + - SNOWFLAKE_FULL + - SNOWFLAKE_SSE + - AWS_CSE + - AWS_SSE_S3 + - AWS_SSE_KMS + - GCS_SSE_KMS + - AZURE_CSE + - NONE + description: Specifies the encryption type used. + master_key: + type: string + format: password + description: Specifies the client-side master key used to encrypt the + files in the bucket. The master key must be a 128-bit or 256-bit key + in Base64-encoded form. + kms_key_id: + type: string + description: Optionally specifies the ID for the KMS-managed key used + to encrypt files unloaded into the bucket. + directory_table: + type: object + description: Directory table parameters of the stage. + properties: + enable: + type: boolean + default: false + description: Specifies whether to add a directory table to the stage. + When the value is TRUE, a directory table is created with the stage. + refresh_on_create: + type: boolean + default: true + writeOnly: true + description: Specifies whether to automatically refresh the directory + table metadata once, immediately after the stage is created. + auto_refresh: + type: boolean + default: false + writeOnly: true + description: Specifies whether Snowflake should enable triggering automatic + refreshes of the directory table metadata when new or updated data + files are available in the named external stage specified in the URL + value. + notification_integration: + type: string + writeOnly: true + description: Specifies the name of the notification integration used + to automatically refresh the directory table metadata. + created_on: + type: string + description: Date and time when the stage was created. + format: date-time + readOnly: true + has_credentials: + type: boolean + description: Indicates that the external stage has access credentials; always + false for an internal stage. + readOnly: true + has_encryption_key: + type: boolean + description: Indicates that the external stage contains encrypted files; + always false for an internal stage. + readOnly: true + owner: + type: string + description: Role that owns the stage. + readOnly: true + owner_role_type: + type: string + description: The type of role that owns the object, either ROLE or DATABASE_ROLE. + If a Snowflake Native App owns the object, the value is APPLICATION. Snowflake + returns NULL if you delete the object because a deleted object does not + have an owner role. + readOnly: true + region: + type: string + description: Region where the stage is located. + readOnly: true + cloud: + type: string + description: Cloud provider; always NULL for an internal stage. + readOnly: true + example: + name: stage_name + required: + - name + Credentials: + type: object + description: Specifies the credentials of the stage. + properties: + credential_type: + description: Type of the credential, can be either AWS or AZURE. + type: string + discriminator: + propertyName: credential_type + mapping: + AWS: AwsCredentials + AZURE: AzureCredentials + AwsCredentials: + description: Specifies the AWS credentials of the stage. + allOf: + - $ref: '#/components/schemas/Credentials' + properties: + aws_key_id: + type: string + format: password + description: Scoped credentials generated by AWS Security Token Service + (STS). + aws_secret_key: + type: string + format: password + description: Scoped credentials generated by AWS Security Token Service + (STS). + aws_token: + type: string + format: password + description: Scoped credentials generated by AWS Security Token Service + (STS). + aws_role: + type: string + description: Omit the security credentials and access keys and, instead, + identify the role using AWS_ROLE and specify the AWS role ARN (Amazon + Resource Name). + AzureCredentials: + description: Specifies the Azure credentials of the stage. + allOf: + - $ref: '#/components/schemas/Credentials' + properties: + azure_sas_token: + type: string + format: password + description: Specifies the SAS (shared access signature) token for connecting + to Azure. + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + stages: + methods: + list_stages: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_stage: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_stage: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_stage: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/stages/methods/list_stages' + - $ref: '#/components/x-stackQL-resources/stages/methods/fetch_stage' + insert: + - $ref: '#/components/x-stackQL-resources/stages/methods/create_stage' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/stages/methods/delete_stage' + replace: [] + id: snowflake.stage.stages + name: stages + title: Stages + files: + methods: + list_files: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages~1{name}~1files/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/files/methods/list_files' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.stage.files + name: files + title: Files + presigned_url: + methods: + get_presigned_url: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1stages~1{name}~1files~1{filePath}:presigned-url/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/presigned_url/methods/get_presigned_url' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.stage.presigned_url + name: presigned_url + title: Presigned Url +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/streams.yaml b/providers/src/snowflake/v00.00.00000/services/streams.yaml new file mode 100644 index 00000000..05164d64 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/streams.yaml @@ -0,0 +1,1095 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Stream API + description: The Snowflake Stream API is a REST API that you can use to access, + update, and perform certain actions on Stream resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/streams: + get: + summary: List streams + tags: + - stream + description: List streams + operationId: listStreams + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Stream' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a stream + tags: + - stream + description: Create a stream + operationId: createStream + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Stream' + /api/v2/databases/{database}/schemas/{schema}/streams/{name}: + get: + summary: Fetch a stream + tags: + - stream + description: Fetch a stream + operationId: fetchStream + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/Stream' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a stream + tags: + - stream + description: Delete a stream + operationId: deleteStream + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/streams/{name}:clone: + post: + summary: Clone a stream + tags: + - stream + description: Clone a stream + operationId: cloneStream + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - name: targetDatabase + description: Database of the target resource. Defaults to the source's database + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - name: targetSchema + description: Schema of the target resource. Defaults to the source's schema + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StreamClone' +components: + schemas: + Stream: + type: object + description: A Snowflake stream + properties: + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the stream was created. + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the stream + stream_source: + $ref: '#/components/schemas/StreamSource' + description: Source for the stream + comment: + type: string + description: user comment associated to an object in the dictionary + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Database in which the stream is stored + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Schema in which the stream is stored + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the stream + table_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Table name whose changes are tracked by the stream + stale: + type: boolean + readOnly: true + description: Specifies whether the stream is stale or not + mode: + type: string + readOnly: true + description: 'Mode of the stream. Possible values include: APPEND_ONLY, + INSERT_ONLY. For streams on tables, the column displays DEFAULT.' + stale_after: + type: string + format: date-time + readOnly: true + description: 'Timestamp when the stream became stale or may become stale + if not consumed. ' + invalid_reason: + type: string + readOnly: true + description: Reason why the stream cannot be queried successfully. This + column supports future functionality. Currently, the only value returned + is N/A. + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the stream + type: + type: string + readOnly: true + description: Type of the stream; currently DELTA only. + required: + - name + - stream_source + StreamSource: + type: object + properties: + src_type: + type: string + description: 'Type of the source. Possible values include: stream, table, + view' + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the source whose changes are tracked by the stream + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name to which stream source type belongs. If not provided, + database name provided in the path param will be used. + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name to which stream source type belongs. If not provided, + schema name provided in the path param will be used. + required: + - src_type + - name + discriminator: + propertyName: src_type + mapping: + table: StreamSourceTable + external_table: StreamSourceExternalTable + view: StreamSourceView + stage: StreamSourceStage + StreamSourceTable: + type: object + allOf: + - $ref: '#/components/schemas/StreamSource' + properties: + append_only: + type: boolean + description: Whether this stream is an append only stream or not + show_initial_rows: + type: boolean + description: Whether this stream show initial rows on first consumption + point_of_time: + $ref: '#/components/schemas/PointOfTime' + description: Point of time for the stream + PointOfTime: + type: object + properties: + point_of_time_type: + type: string + description: 'Type of the point of time. Possible values include: timestamp, + offset, statement' + reference: + type: string + enum: + - at + - before + x-enum-varnames: + - AT + - BEFORE + description: Relation to the point of time. Currently, the API supports + `at` and `before` + required: + - point_of_time_type + - reference + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + stream: PointOfTimeStream + PointOfTimeTimestamp: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + required: + - timestamp + PointOfTimeOffset: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + offset: + type: string + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + required: + - offset + PointOfTimeStatement: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + required: + - statement + PointOfTimeStream: + type: object + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + stream: + type: string + description: 'Creates the new stream at the same offset as the specified + stream. ' + StreamSourceExternalTable: + type: object + allOf: + - $ref: '#/components/schemas/StreamSource' + properties: + insert_only: + type: boolean + description: Whether this stream is an insert only stream or not + point_of_time: + $ref: '#/components/schemas/PointOfTime' + description: Point of time for the stream + StreamSourceView: + type: object + allOf: + - $ref: '#/components/schemas/StreamSource' + properties: + append_only: + type: boolean + description: Whether this stream is an append only stream or not + show_initial_rows: + type: boolean + description: Whether this stream show initial rows on first consumption + point_of_time: + $ref: '#/components/schemas/PointOfTime' + description: Point of time for the stream + base_tables: + type: array + items: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: List of base tables for the stream + StreamSourceStage: + type: object + allOf: + - $ref: '#/components/schemas/StreamSource' + StreamClone: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the stream + comment: + type: string + description: user comment associated to an object in the dictionary + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + streams: + methods: + list_streams: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1streams/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_stream: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1streams/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_stream: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1streams~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_stream: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1streams~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + clone_stream: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1streams~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/streams/methods/list_streams' + - $ref: '#/components/x-stackQL-resources/streams/methods/fetch_stream' + insert: + - $ref: '#/components/x-stackQL-resources/streams/methods/create_stream' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/streams/methods/delete_stream' + replace: [] + id: snowflake.streams.streams + name: streams + title: Streams diff --git a/providers/src/snowflake/v00.00.00000/services/table.yaml b/providers/src/snowflake/v00.00.00000/services/table.yaml new file mode 100644 index 00000000..1484fcea --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/table.yaml @@ -0,0 +1,1974 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Table API + description: The Snowflake Table API is a REST API that you can use to access, update, + and perform certain actions on Tables resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/tables: + get: + summary: List tables + tags: + - table + description: Lists the tables under the database and schema. + operationId: listTables + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: history + description: Optionally includes dropped tables that have not yet been purged. + in: query + required: false + schema: + type: boolean + - name: deep + description: Optionally includes dependency information of the table. + in: query + required: false + schema: + type: boolean + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Table' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a table (clone and undrop are separate subresources) + tags: + - table + description: Create a table. + operationId: createTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Table' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:as_select: + post: + deprecated: true + summary: Create a table using the result of the specified select query + tags: + - table + description: Create a table as select. + operationId: createTableAsSelectDeprecated + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: query + in: query + required: true + description: The SQL select query to run to set up the table values (and possibly + columns). + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Table' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables:as-select: + post: + summary: Create a table using the result of the specified select query + tags: + - table + description: Create a table as select. + operationId: createTableAsSelect + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: query + in: query + required: true + description: The SQL select query to run to set up the table values (and possibly + columns). + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TableAsSelect' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:using_template: + post: + deprecated: true + summary: Create a table using the templates specified in staged files + tags: + - table + description: Create a table using template. + operationId: createTableUsingTemplateDeprecated + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: query + description: The SQL query that uses INFER_SCHEMA on staged files to set the + column definitions for the new table. + in: query + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables:using-template: + post: + summary: Create a table using the templates specified in staged files + tags: + - table + description: Create a table using template. + operationId: createTableUsingTemplate + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: query + description: The SQL query that uses INFER_SCHEMA on staged files to set the + column definitions for the new table. + in: query + required: true + schema: + type: string + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/TableUsingTemplate' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}: + get: + summary: Fetch a table. + tags: + - table + description: Fetch a Table using the describe command output. + operationId: fetchTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Table' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) table. + tags: + - table + description: Create a (or alter an existing) table. Even if the operation is + just an alter, the full property set must be provided. + operationId: createOrAlterTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Table' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Delete a table + tags: + - table + description: Delete a table with the given name. + operationId: deleteTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:clone: + post: + summary: Clone table + tags: + - table + description: Create a new table by cloning from the specified resource + operationId: cloneTable + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: targetDatabase + in: query + description: Database of the newly created table. Defaults to the source table's + database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the newly created table. Defaults to the source table's + schema. + schema: + $ref: '#/components/schemas/Identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TableClone' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:create_like: + post: + deprecated: true + summary: Create a table like this existing one + tags: + - table + description: Create a new table like the specified resource, but empty + operationId: createTableLikeDeprecated + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + - name: newTableName + description: The name of the table to be created. + in: query + required: true + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:create-like: + post: + summary: Create a table like this existing one + tags: + - table + description: Create a new table like the specified resource, but empty + operationId: createTableLike + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TableLike' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:undrop: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + summary: Undrop a table + tags: + - table + description: Undrop specified table + operationId: undropTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:suspend_recluster: + post: + deprecated: true + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Suspend recluster of a table + tags: + - table + description: Suspend recluster of a table + operationId: suspendReclusterTableDeprecated + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:suspend-recluster: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Suspend recluster of a table + tags: + - table + description: Suspend recluster of a table + operationId: suspendReclusterTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:resume_recluster: + post: + deprecated: true + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Resume recluster of a table + tags: + - table + description: Resume recluster of a table + operationId: resumeReclusterTableDeprecated + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:resume-recluster: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Resume recluster of a table + tags: + - table + description: Resume recluster of a table + operationId: resumeReclusterTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:swapwith: + post: + deprecated: true + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: targetTableName + description: The fully-specified name of the target table to be swapped with. + in: query + required: true + schema: + type: string + summary: Swap with another table + tags: + - table + description: Swap with another table + operationId: swapWithTableDeprecated + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tables/{name}:swap-with: + post: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + - name: targetName + description: The name of the target table to be swapped with. + in: query + required: true + schema: + $ref: '#/components/schemas/Identifier' + - name: targetDatabase + in: query + description: Database of the target table. Defaults to the source table's + database. + schema: + $ref: '#/components/schemas/Identifier' + - name: targetSchema + in: query + description: Schema of the target table. Defaults to the source table's schema. + schema: + $ref: '#/components/schemas/Identifier' + summary: Swap with another table + tags: + - table + description: Swap with another table + operationId: swapWithTable + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Table: + type: object + description: A Snowflake table + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + kind: + type: string + enum: + - PERMANENT + - TRANSIENT + - TEMPORARY + - '' + - transient + - temporary + x-enum-varnames: + - PERMANENT + - TRANSIENT + - TEMPORARY + - DEPRECATED_PERMANENT + - DEPRECATED_TRANSIENT + - DEPRECATED_TEMPORARY + default: PERMANENT + description: Table type - permanent, transient, or temporary + cluster_by: + type: array + description: Specifies one or more columns or column expressions in the + table as the clustering key + items: + type: string + enable_schema_evolution: + type: boolean + description: Table has schema evolution enabled or disabled + change_tracking: + type: boolean + description: Change tracking is enabled or disabled + data_retention_time_in_days: + type: integer + description: Specifies the retention period for the table so that Time Travel + actions SELECT, CLONE, UNDROP can be performed on historical data in the + table + max_data_extension_time_in_days: + type: integer + description: Specifies the retention period for the table so that Time Travel + actions SELECT, CLONE, UNDROP can be performed on historical data in the + table + default_ddl_collation: + type: string + description: Specifies a default collation specification for the columns + in the table, including columns added to the table in the future + columns: + type: array + items: + $ref: '#/components/schemas/TableColumn' + constraints: + type: array + items: + $ref: '#/components/schemas/Constraint' + comment: + type: string + description: Comment for the table + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the table was created. + database_name: + type: string + readOnly: true + description: Database in which the table is stored + schema_name: + type: string + readOnly: true + description: Schema in which the table is stored + rows: + type: integer + format: int64 + readOnly: true + description: Number of rows in the table. Returns NULL for external tables. + bytes: + type: integer + format: int64 + readOnly: true + description: Number of bytes that will be scanned if the entire table is + scanned in a query. Note that this number may be different than the number + of actual physical bytes stored on-disk for the table + owner: + type: string + readOnly: true + description: Role that owns the table + dropped_on: + type: string + format: date-time + readOnly: true + description: Date and time when the table was dropped + automatic_clustering: + type: boolean + readOnly: true + description: If Automatic Clustering is enabled for your account, specifies + whether it is explicitly enabled or disabled for the table. + search_optimization: + type: boolean + readOnly: true + description: If ON, the table has the search optimization service enabled + search_optimization_progress: + type: integer + format: int64 + readOnly: true + description: Percentage of the table that has been optimized for search. + search_optimization_bytes: + type: integer + format: int64 + readOnly: true + description: Number of additional bytes of storage that the search optimization + service consumes for this table + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the object. + budget: + type: string + readOnly: true + description: Name of the budget if the object is monitored by a budget + table_type: + type: string + enum: + - NORMAL + - DYNAMIC + - EXTERNAL + - EVENT + - HYBRID + - ICEBERG + - IMMUTABLE + readOnly: true + description: Type of the table + required: + - name + TableColumn: + type: object + description: A column in the table + properties: + name: + type: string + description: Column name + datatype: + type: string + description: The data type for the column + nullable: + type: boolean + default: true + description: Specifies that the column does allow NULL values or not. + collate: + type: string + description: Specifies the collation to use for column operations such as + string comparison + default: + type: string + description: Specifies whether a default value is automatically inserted + in the column if a value is not explicitly specified via an INSERT or + CREATE TABLE AS SELECT statement + autoincrement: + type: boolean + autoincrement_start: + type: integer + description: The default value for the column starts with the specified + number + autoincrement_increment: + type: integer + description: Each successive value for the column automatically increments + by the specified amount + constraints: + type: array + items: + $ref: '#/components/schemas/Constraint' + comment: + type: string + description: Specifies a comment for the column + required: + - name + - datatype + Constraint: + type: object + description: Constraints define integrity and consistency rules for data stored + in tables. + properties: + name: + type: string + description: Name of the Constraint + column_names: + type: array + items: + type: string + description: Column name for the constraint + constraint_type: + type: string + description: Type of the constraint + discriminator: + propertyName: constraint_type + mapping: + PRIMARY KEY: PrimaryKey + FOREIGN KEY: ForeignKey + UNIQUE: UniqueKey + PrimaryKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: A primary key is the column or columns that contain values that + uniquely identify each row in a table. + UniqueKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: Unique keys are columns in a table that uniquely identify items + in the rows. This sounds a lot like a primary key, but the main difference + is that unique keys can have NULL values. + ForeignKey: + allOf: + - $ref: '#/components/schemas/Constraint' + type: object + description: Foreign keys link data in one table to the data in another table. + properties: + referenced_table_name: + type: string + referenced_column_names: + type: array + items: + type: string + required: + - referenced_table_name + - referenced_column_names + TableClone: + type: object + description: Clone table + allOf: + - $ref: '#/components/schemas/Table' + properties: + point_of_time: + $ref: '#/components/schemas/PointOfTime' + TableAsSelect: + type: object + description: Create table as select + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + columns: + type: array + items: + $ref: '#/components/schemas/TableColumn' + cluster_by: + type: array + description: Specifies one or more columns or column expressions in the + table as the clustering key + items: + type: string + TableUsingTemplate: + type: object + description: Create table using template + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + TableLike: + type: object + description: Create table like an existing table + properties: + name: + type: string + description: Specifies the name for the table, must be unique for the schema + in which the table is created + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + tables: + methods: + list_tables: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_as_select_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:as_select/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_as_select: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables:as-select/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_using_template_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:using_template/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_using_template: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables:using-template/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + clone_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:clone/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_like_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:create_like/post' + response: + mediaType: '' + openAPIDocKey: '200' + create_table_like: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:create-like/post' + response: + mediaType: '' + openAPIDocKey: '200' + undrop_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:undrop/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_recluster_table_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:suspend_recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_recluster_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:suspend-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + resume_recluster_table_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:resume_recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + resume_recluster_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:resume-recluster/post' + response: + mediaType: '' + openAPIDocKey: '200' + swap_with_table_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:swapwith/post' + response: + mediaType: '' + openAPIDocKey: '200' + swap_with_table: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tables~1{name}:swap-with/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/tables/methods/list_tables' + - $ref: '#/components/x-stackQL-resources/tables/methods/fetch_table' + insert: + - $ref: '#/components/x-stackQL-resources/tables/methods/create_table' + - $ref: '#/components/x-stackQL-resources/tables/methods/create_table_as_select_deprecated' + - $ref: '#/components/x-stackQL-resources/tables/methods/create_table_like_deprecated' + - $ref: '#/components/x-stackQL-resources/tables/methods/create_table_like' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/tables/methods/delete_table' + replace: + - $ref: '#/components/x-stackQL-resources/tables/methods/create_or_alter_table' + id: snowflake.table.tables + name: tables + title: Tables +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/task.yaml b/providers/src/snowflake/v00.00.00000/services/task.yaml new file mode 100644 index 00000000..9f02fe42 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/task.yaml @@ -0,0 +1,1695 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Task API + description: The Snowflake Task API is a REST API that you can use to access, update, + and perform certain actions on task resources in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/tasks: + get: + summary: List tasks + tags: + - task + description: Lists tasks under the database and schema, with show options as + query parameters. + operationId: listTasks + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/rootOnly' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Task' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a task + tags: + - task + description: Create a task, with standard create modifiers as query parameters. + See the Task component definition for what is required to be provided in the + request body. + operationId: createTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + example: + name: name_example + warehouse: REGRESS + schedule: + schedule_type: MINUTES_TYPE + minutes: 10 + predecessors: + - task1 + - task2 + - task3 + comment: test_comment + definition: select 1 + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}: + get: + summary: Fetch a task + tags: + - task + description: Fetch a task using the describe command output. + operationId: fetchTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) task + tags: + - task + description: Create a (or alter an existing) task. Even if the operation is + just an alter, the full property set must be provided. + operationId: createOrAlterTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Delete a task + tags: + - task + description: Delete a task with the task name. If ifExists is used, the operation + will succeed even if the object does not exist. Otherwise, there will be a + failure if the drop is unsuccessful. + operationId: deleteTask + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}:execute: + post: + summary: Execute a task object. + tags: + - task + description: Execute a task -- this is equivalent to EXECUTE IMMEDIATE. + operationId: executeTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/asyncExec' + - name: retryLast + in: query + description: Retry the last failed run of the DAG. + schema: + type: boolean + default: false + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}:resume: + post: + summary: Resume a suspended task. + tags: + - task + description: Resumes a suspended task object. This is equivalento an ALTER TASK + ... RESUME. + operationId: resumeTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}:suspend: + post: + summary: Suspend a running task. + tags: + - task + description: Suspends a running task. This is equivalent to an ALTER TASK ... + SUSPEND. + operationId: suspendTask + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}/dependents: + get: + summary: Fetch the dependent tasks of a task + tags: + - task + description: This operation returns a list of the dependent tasks of the task + with identifier {name}. + operationId: fetchTaskDependents + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - name: recursive + in: query + description: Specifies whether to limit the output to include only direct + child tasks or to include all recursive child tasks. + schema: + type: boolean + default: true + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Task' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}/current_graphs: + get: + deprecated: true + summary: Get the graph runs that are executing or scheduled for the task for + the next 8 days. + tags: + - task + description: This function returns details for graph runs that are currently + executing or are next scheduled to run within the next 8 days. + operationId: getCurrentGraphsDeprecated + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - in: query + name: resultLimit + schema: + type: integer + description: Number of results to return, at most. Default is 1000, valid + range is 1 to 10000. + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}/current-graphs: + get: + summary: Get the graph runs that are executing or scheduled for the task for + the next 8 days. + tags: + - task + description: This function returns details for graph runs that are currently + executing or are next scheduled to run within the next 8 days. + operationId: getCurrentGraphs + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - in: query + name: resultLimit + schema: + type: integer + description: Number of results to return, at most. Default is 1000, valid + range is 1 to 10000. + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}/complete_graphs: + get: + deprecated: true + summary: Get the graph runs that are completed for the task. + tags: + - task + description: This function returns details for graph runs that are completed. + operationId: getCompleteGraphsDeprecated + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - in: query + name: resultLimit + schema: + type: integer + description: Number of results to return, at most. Default is 1000, valid + range is 1 to 10000. + - in: query + name: errorOnly + schema: + type: boolean + description: Whether to only return results for tasks runs that have failed. + Default is false. + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}/complete-graphs: + get: + summary: Get the graph runs that are completed for the task. + tags: + - task + description: This function returns details for graph runs that are completed. + operationId: getCompleteGraphs + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - in: query + name: resultLimit + schema: + type: integer + description: Number of results to return, at most. Default is 1000, valid + range is 1 to 10000. + - in: query + name: errorOnly + schema: + type: boolean + description: Whether to only return results for tasks runs that have failed. + Default is false. + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + TaskRun: + type: object + description: A task run executing a standalone task or a DAG of tasks starting + from the root task. + properties: + root_task_name: + type: string + description: The name of the root task in the current task run. + readOnly: true + database_name: + type: string + description: The name of the current database for the task run. + readOnly: true + schema_name: + type: string + description: The name of the current schema for the task run. + readOnly: true + state: + type: string + description: The current state of the task run. + enum: + - SCHEDULED + - EXECUTING + - SUCCEEDED + - FAILED + - CANCELLED + - SKIPPED + readOnly: true + first_error_task_name: + type: string + description: The name of the first task throwing an error in the task run. + readOnly: true + first_error_code: + type: integer + description: The first error code thrown in the task run. + readOnly: true + first_error_message: + type: string + description: The first error message thrown in the task run. + readOnly: true + scheduled_time: + type: string + description: The scheduled time for the task run. + format: date-time + readOnly: true + query_start_time: + type: string + description: The start time for the task run query. + format: date-time + readOnly: true + next_scheduled_time: + type: string + description: The next upcoming time for the task run. + format: date-time + readOnly: true + completed_time: + type: string + description: The time this task run was last completed. + format: date-time + readOnly: true + root_task_id: + type: string + description: The unique task ID for the root task. + readOnly: true + graph_version: + type: integer + description: The current version of the DAG on the task run. + readOnly: true + run_id: + type: integer + description: The unique ID for the current task run. + readOnly: true + example: + root_task_name: root_task + database_name: test_db + schema_name: test_schema + state: SCHEDULED + first_error_task_name: test_task + first_error_code: 0 + first_error_message: ERROR + scheduled_time: '2024-06-18T01:01:01.111111' + query_start_time: '2024-06-18T01:01:01.111111' + next_scheduled_time: '2024-06-18T01:01:01.111111' + completed_time: '2024-06-18T01:01:01.111111' + root_task_id: '0' + graph_version: 0 + run_id: 0 + required: + - root_task_name + - database_name + - schema_name + - state + - scheduled_time + - next_scheduled_time + - root_task_id + - graph_version + - run_id + Task: + type: object + description: A Snowflake task, used to execute SQL code. + properties: + name: + $ref: '#/components/schemas/Identifier' + description: String that specifies the identifier (i.e. name) for the task. + warehouse: + $ref: '#/components/schemas/Identifier' + description: Specifies the virtual warehouse that provides compute resources + for task runs. Omit this parameter to use serverless compute resources + for runs of this task. + schedule: + $ref: '#/components/schemas/TaskSchedule' + description: Specifies the schedule for periodically running the task. + comment: + type: string + description: Specifies a comment for the task. + finalize: + type: string + description: Specifies the name of the root task that the finalizer task + is associated with. + task_auto_retry_attempts: + type: integer + description: Root task settable only. Specifies the number of automatic + task graph retry attempts. Valid range is 0 to 30. When not specified, + no retry would happen. + minimum: 0 + maximum: 30 + config: + type: object + additionalProperties: true + description: Task Config + session_parameters: + type: object + additionalProperties: true + description: Session Parameters for the task at runtime. + definition: + type: string + description: The SQL definition for the task. Any one of single SQL statement, + call to stored procedure, or procedural logic using Snowflake scripting. + predecessors: + type: array + description: Specifies one or more predecessor tasks for the current task + items: + type: string + description: The identifier for the task. + task_relations: + type: string + description: Displays the relationship between the root task and its corresponding + finalizer tasks. + readOnly: true + user_task_managed_initial_warehouse_size: + type: string + description: Specifies the size of the compute resources to provision for + the first run of the task. This parameter only applies to serverless tasks. + target_completion_interval: + $ref: '#/components/schemas/MinutesSchedule' + description: Specifies the desired task completion time. This parameter + only applies to serverless tasks. + serverless_task_min_statement_size: + type: string + description: Specifies the minimum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to + serverless tasks. + serverless_task_max_statement_size: + type: string + description: Specifies the maximum allowed warehouse size for the serverless + task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to + serverless tasks. + user_task_timeout_ms: + type: integer + description: Specifies the time limit on a single run of the task before + it times out (in milliseconds). + suspend_task_after_num_failures: + type: integer + description: Specifies the number of consecutive failed task runs after + which the current task is suspended automatically. + condition: + type: string + description: Specifies a Boolean SQL expression condition; multiple conditions + joined with AND/OR are supported + allow_overlapping_execution: + type: boolean + description: Specifies whether to allow multiple instances of the DAG to + run concurrently. + error_integration: + type: string + description: Specifies the name of the notification integration used to + communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. + created_on: + type: string + description: The time the task was created on. + format: date-time + readOnly: true + id: + type: string + description: An ID for the current task. + readOnly: true + owner: + type: string + description: The role that owns the task. + readOnly: true + owner_role_type: + type: string + description: The role type of the task owner. + readOnly: true + state: + type: string + description: The state of the task. Must be one of started or suspended. + readOnly: true + enum: + - started + - suspended + last_committed_on: + type: string + description: The time the task was last committed on. + readOnly: true + format: date-time + last_suspended_on: + type: string + description: The time the task was last suspended on. + readOnly: true + format: date-time + database_name: + type: string + description: The name of the parent database for the task. + readOnly: true + schema_name: + type: string + description: The name of the parent schema for the task. + readOnly: true + example: + name: name_example + schedule: + schedule_type: MINUTES_TYPE + minutes: 10 + comment: test_comment + config: + output_dir: /temp/test_directory/ + learning_rate: '0.1' + definition: this task does... + predecessors: + - task1 + - task2 + - task3 + user_task_managed_initial_warehouse_size: SMALL + target_completion_interval: + schedule_type: MINUTES_TYPE + minutes: 5 + serverless_task_min_statement_size: XSMALL + serverless_task_max_statement_size: MEDIUM + user_task_timeout_ms: 10 + suspend_task_after_num_failures: 3 + condition: select 1 + allow_overlapping_execution: false + error_integration: my_notification_int + created_on: '2024-06-18T01:01:01.111111' + id: task_id + owner: TASK_ADMIN + owner_role_type: ADMIN + state: started + last_committed_on: '2024-06-18T01:01:01.111111' + last_suspended_on: '2024-06-18T01:01:01.111111' + database_name: TESTDB + schema_name: TESTSCHEMA + required: + - name + - definition + TaskSchedule: + type: object + description: Specifies the schedule for periodically running the task. + properties: + schedule_type: + description: Type of the schedule, can be either CRON_TYPE or MINUTES_TYPE. + type: string + discriminator: + propertyName: schedule_type + mapping: + CRON_TYPE: CronSchedule + MINUTES_TYPE: MinutesSchedule + CronSchedule: + description: A cron schedule for executing a task at a specified interval. + allOf: + - $ref: '#/components/schemas/TaskSchedule' + properties: + cron_expr: + type: string + description: A cron expression for the task execution. + timezone: + type: string + description: The time zone for the schedule. + example: + cron_expr: '* * * * ? *' + timezone: america/los_angeles + required: + - cron_expr + - timezone + MinutesSchedule: + description: A schedule for executing a task at specified intervals of minutes. + allOf: + - $ref: '#/components/schemas/TaskSchedule' + properties: + minutes: + type: integer + description: The number of minutes between each task run. + example: + minutes: 10 + required: + - minutes + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + tasks: + methods: + list_tasks: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_or_alter_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + delete_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + execute_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}:execute/post' + response: + mediaType: '' + openAPIDocKey: '200' + resume_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}:resume/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_task: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}:suspend/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/tasks/methods/list_tasks' + - $ref: '#/components/x-stackQL-resources/tasks/methods/fetch_task' + insert: + - $ref: '#/components/x-stackQL-resources/tasks/methods/create_task' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/tasks/methods/delete_task' + replace: + - $ref: '#/components/x-stackQL-resources/tasks/methods/create_or_alter_task' + id: snowflake.task.tasks + name: tasks + title: Tasks + dependents: + methods: + fetch_task_dependents: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}~1dependents/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/dependents/methods/fetch_task_dependents' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.task.dependents + name: dependents + title: Dependents + current_graphs: + methods: + get_current_graphs_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}~1current_graphs/get' + response: + mediaType: application/json + openAPIDocKey: '200' + get_current_graphs: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}~1current-graphs/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/current_graphs/methods/get_current_graphs_deprecated' + - $ref: '#/components/x-stackQL-resources/current_graphs/methods/get_current_graphs' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.task.current_graphs + name: current_graphs + title: Current Graphs + complete_graphs: + methods: + get_complete_graphs_deprecated: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}~1complete_graphs/get' + response: + mediaType: application/json + openAPIDocKey: '200' + get_complete_graphs: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1tasks~1{name}~1complete-graphs/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/complete_graphs/methods/get_complete_graphs_deprecated' + - $ref: '#/components/x-stackQL-resources/complete_graphs/methods/get_complete_graphs' + insert: [] + update: [] + delete: [] + replace: [] + id: snowflake.task.complete_graphs + name: complete_graphs + title: Complete Graphs +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] +externalDocs: + description: Streams and Tasks Reference + url: https://docs.snowflake.com/en/sql-reference/commands-stream diff --git a/providers/src/snowflake/v00.00.00000/services/user-defined-function.yaml b/providers/src/snowflake/v00.00.00000/services/user-defined-function.yaml new file mode 100644 index 00000000..6a8e22eb --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/user-defined-function.yaml @@ -0,0 +1,1421 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake User Defined Function API + description: The Snowflake User Defined Function API is a REST API that you can + use to access, update, and perform certain actions on User Defined Function resource + in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/user-defined-functions: + post: + summary: Create a UDF + tags: + - user-defined-function + description: Create a UDF + operationId: createUserDefinedFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserDefinedFunction' + get: + summary: List UDFs + tags: + - user-defined-function + description: List UDFs + operationId: listUserDefinedFunctions + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDefinedFunction' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/user-defined-functions/{nameWithArgs}: + get: + summary: Fetch a UDF + tags: + - user-defined-function + description: Fetch a UDF + operationId: fetchUserDefinedFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDefinedFunction' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a UDF + tags: + - user-defined-function + description: Delete a UDF + operationId: deleteUserDefinedFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/user-defined-functions/{nameWithArgs}:rename: + post: + summary: Rename a UDF + tags: + - user-defined-function + description: Rename a UDF + operationId: renameUserDefinedFunction + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/nameWithArgs' + - $ref: '#/components/parameters/ifExists' + - name: targetDatabase + description: Database of the target resource. Defaults to the source's database + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - name: targetSchema + description: Schema of the target resource. Defaults to the source's schema + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + - name: targetName + description: Name of the target resource. + in: query + required: true + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + UserDefinedFunction: + type: object + description: A snowflake UDF + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: The name of the UDF + is_temporary: + type: boolean + description: Specifies whether the UDF is temporary or not + is_aggregate: + type: boolean + description: Specifies whether the UDF is an aggregate function. Applicable + only for Python language type + is_memoizable: + type: boolean + description: Indicates whether the function is memoizable. Applicable only + for Python language type. + is_table_function: + type: boolean + readOnly: true + description: True if the UDF is a table function; false otherwise. + valid_for_clustering: + type: boolean + readOnly: true + description: True if the UDF is valid for clustering; false otherwise. + is_secure: + type: boolean + description: Specifies whether the function/procedure is secure or not + arguments: + type: array + items: + $ref: '#/components/schemas/Argument' + description: List of arguments for the function/procedure + return_type: + $ref: '#/components/schemas/ReturnType' + description: Return type of the function/procedure. Should be a SQL data + type or a table + language_config: + $ref: '#/components/schemas/FunctionLanguage' + description: Language that the function/procedure is written in + comment: + type: string + description: Specifies a comment for the function/procedure + body: + type: string + description: Function/procedure definition + created_on: + type: string + format: date-time + readOnly: true + description: The date and time when the function/procedure was created + schema_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The name of the schema in which the function/procedure exists. + database_name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The name of the database in which the function/procedure exists. + min_num_arguments: + type: integer + readOnly: true + description: The minimum number of arguments + max_num_arguments: + type: integer + readOnly: true + description: The maximum number of arguments + owner: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: Role that owns the function/procedure + owner_role_type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + readOnly: true + description: The type of role that owns the function/procedure + is_builtin: + type: boolean + readOnly: true + description: If the function/procedure is built-in or not (user-defined) + required: + - name + - arguments + - return_type + - language_config + Argument: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Argument name + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Argument data type + default_value: + type: string + description: Default value of the argument + required: + - name + - datatype + ReturnType: + type: object + properties: + type: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Type of the return, can be either DATATYPE or TABLE + required: + - type + discriminator: + propertyName: type + mapping: + DATATYPE: ReturnDataType + TABLE: ReturnTable + ReturnDataType: + allOf: + - $ref: '#/components/schemas/ReturnType' + properties: + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Return data type + nullable: + type: boolean + description: Argument null return acceptance criteria + required: + - datatype + ReturnTable: + allOf: + - $ref: '#/components/schemas/ReturnType' + properties: + column_list: + type: array + items: + $ref: '#/components/schemas/ColumnType' + description: List of table columns to return + ColumnType: + type: object + properties: + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Argument name + datatype: + type: string + enum: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + x-enum-varnames: + - ARRAY + - BIGINT + - BINARY + - BOOLEAN + - BYTEINT + - CHAR + - CHARACTER + - DATE + - DATETIME + - DECIMAL + - DOUBLE + - DOUBLE_PRECISION + - FLOAT + - FLOAT4 + - FLOAT8 + - GEOGRAPHY + - GEOMETRY + - INT + - INTEGER + - NUMBER + - NUMERIC + - OBJECT + - REAL + - STRING + - SMALLINT + - TEXT + - TIME + - TIMESTAMP_LTZ + - TIMESTAMP_NTZ + - TIMESTAMP_TZ + - TINYINT + - VARBINARY + - VARCHAR + - VARIANT + - VECTOR + description: Argument data type + required: + - name + - datatype + FunctionLanguage: + type: object + properties: + language: + type: string + description: 'Language that the function/procedure is written in. Possible + values include: JAVA, JAVASCRIPT, PYTHON, SCALA, SQL' + called_on_null_input: + type: boolean + description: Decide if the function/procedure can receive null input + is_volatile: + type: boolean + description: " Specifies the behavior of the UDF when returning results.\ + \ This Field is deprecated for Procedure.\n \n If\ + \ true, UDF might return different values for different rows, even for\ + \ the same input. \n This field is deprecated for Procedure.\n\ + \n If false, UDF assumes that the function, when called with\ + \ the same inputs, will always return the same result. \n This\ + \ guarantee is not checked. Specifying IMMUTABLE for a UDF that returns\ + \ different values for the same input will result in undefined behavior.\n\ + \ " + required: + - language + discriminator: + propertyName: language + mapping: + JAVA: JavaFunction + PYTHON: PythonFunction + SCALA: ScalaFunction + JAVASCRIPT: JavaScriptFunction + SQL: SQLFunction + BaseLanguage: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + properties: + packages: + type: array + items: + type: string + description: Packages to include with the function/procedure + imports: + type: array + items: + type: string + description: List of imports + handler: + type: string + description: Fully qualified method name including the package and the class + required: + - packages + - handler + JavaFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + external_access_integrations: + type: array + items: + type: string + description: List of external access integrations attached to this function/procedure + secrets: + type: object + additionalProperties: + type: string + description: Secrets to be used with this function/procedure for external + access + target_path: + type: string + description: Specifies where Snowflake should write the compiled code for + inline procedures + runtime_version: + type: string + description: "Specifies the Java JDK runtime version to use. \n \ + \ The supported versions of Java are 11.x and 17.x (Preview\ + \ support)" + required: + - runtime_version + PythonFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + external_access_integrations: + type: array + items: + type: string + description: List of external access integrations attached to this function/procedure + secrets: + type: object + additionalProperties: + type: string + description: Secrets to be used with this function/procedure for external + access + runtime_version: + type: string + description: "Specifies the Python version to use. The supported versions\ + \ of Python are:\n * 3.8\n \ + \ * 3.9\n * 3.10\n *\ + \ 3.11" + required: + - runtime_version + ScalaFunction: + allOf: + - $ref: '#/components/schemas/BaseLanguage' + properties: + target_path: + type: string + description: Specifies where Snowflake should write the compiled code for + inline function/procedures + runtime_version: + type: string + description: 'Specifies the Scala runtime version to use. The supported + versions of Scala are: 2.12' + required: + - runtime_version + JavaScriptFunction: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + SQLFunction: + allOf: + - $ref: '#/components/schemas/FunctionLanguage' + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + user_defined_functions: + methods: + create_user_defined_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1user-defined-functions/post' + response: + mediaType: '' + openAPIDocKey: '200' + list_user_defined_functions: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1user-defined-functions/get' + response: + mediaType: application/json + openAPIDocKey: '200' + fetch_user_defined_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1user-defined-functions~1{nameWithArgs}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_user_defined_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1user-defined-functions~1{nameWithArgs}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + rename_user_defined_function: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1user-defined-functions~1{nameWithArgs}:rename/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/user_defined_functions/methods/list_user_defined_functions' + - $ref: '#/components/x-stackQL-resources/user_defined_functions/methods/fetch_user_defined_function' + insert: + - $ref: '#/components/x-stackQL-resources/user_defined_functions/methods/create_user_defined_function' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/user_defined_functions/methods/delete_user_defined_function' + replace: [] + id: snowflake.user_defined_function.user_defined_functions + name: user_defined_functions + title: User Defined Functions +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/user.yaml b/providers/src/snowflake/v00.00.00000/services/user.yaml new file mode 100644 index 00000000..633975b4 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/user.yaml @@ -0,0 +1,1291 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake User API + description: The Snowflake User API is a REST API that you can use to access, update, + and perform certain action on Users in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/users: + post: + summary: Create a user + tags: + - user + description: Create a user according to the parameters given + operationId: createUser + parameters: + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + get: + summary: List users in the system. + tags: + - user + description: Lists the users in the system. + operationId: listUsers + parameters: + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/users/{name}: + get: + parameters: + - $ref: '#/components/parameters/name' + summary: Fetch information about a user + tags: + - user + description: Fetch user information using the result of the DESCRIBE command + operationId: fetchUser + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + summary: Delete a user + tags: + - user + description: Delete a user with the given name. + operationId: deleteUser + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) user. + description: Create a (or alter an existing) user. Even if the operation is + just an alter, the full property set must be provided. Note that password + is not currently altered by this operation but is supported for a newly-created + object. + operationId: createOrAlterUser + tags: + - user + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/users/{name}/grants: + get: + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/showLimit' + summary: List all grants to the user + tags: + - user + description: List all grants to the user + operationId: listGrants + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Grant' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Grant a role to the user + tags: + - user + description: Grant a role to the user + operationId: grant + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/users/{name}/grants:revoke: + post: + summary: Revoke grants from the user + tags: + - user + description: Revoke grants from the user + operationId: revokeGrants + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Grant' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Grant: + type: object + properties: + securable: + $ref: '#/components/schemas/Securable' + description: Securable of the grant + containing_scope: + $ref: '#/components/schemas/ContainingScope' + description: Containing scope of the grant + securable_type: + type: string + description: Type of the securable to be granted. Only ROLE is supported + privileges: + type: array + items: + type: string + description: List of privileges to be granted. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the grant was created + granted_by: + type: string + readOnly: true + description: The role that granted this privilege to this grantee + required: + - securable_type + Securable: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable if applicable. + name: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Name of the securable if applicable. + required: + - name + ContainingScope: + type: object + properties: + database: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Database name of the securable scope if applicable. + schema: + type: string + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + description: Schema name of the securable scope if applicable. + required: + - database + User: + description: Properties of user. + type: object + required: + - name + properties: + name: + type: string + description: User name + example: jackpatel + password: + type: string + format: password + description: Password + login_name: + type: string + description: Login name + display_name: + type: string + description: Display name + first_name: + type: string + description: First name + middle_name: + type: string + description: Middle name + last_name: + type: string + description: Last name + email: + type: string + description: Email address + must_change_password: + type: boolean + description: Does this user need to change their password (e.g., after assigning + a temp password) + disabled: + type: boolean + description: Has this user been disabled from the system + days_to_expiry: + type: integer + description: How many days until this user expires + mins_to_unlock: + type: integer + description: How many minutes until the account is unlocked after multiple + failed logins + default_warehouse: + type: string + description: The default warehouse to use when this user starts a session + default_namespace: + type: string + description: The default namespace to use when this user starts a session + default_role: + type: string + description: The default role to use when this user starts a session + default_secondary_roles: + type: string + description: The default secondary roles of this user to use when starting + a session. Only valid set values are ALL or NONE. Default is ALL after + 2024-07 BCR. + enum: + - ALL + - NONE + default: ALL + mins_to_bypass_mfa: + type: integer + description: How many minutes until MFA is required again + rsa_public_key: + type: string + description: RSA public key of the user + rsa_public_key_2: + type: string + description: Second RSA public key of the user + comment: + type: string + description: Comment about the user. + example: A distinguished user + type: + type: string + description: Indicates the type of user (PERSON | SERVICE | LEGACY_SERVICE) + enable_unredacted_query_syntax_error: + type: boolean + description: Whether to show unredacted query syntax errors in the query + history. + network_policy: + type: string + description: Specifies an existing network policy is active for the user. + Otherwise, use account default. + created_on: + type: string + readOnly: true + format: date-time + last_successful_login: + type: string + readOnly: true + format: date-time + expires_at: + type: string + readOnly: true + format: date-time + locked_until: + type: string + readOnly: true + format: date-time + has_password: + type: boolean + readOnly: true + has_rsa_public_key: + type: boolean + readOnly: true + rsa_public_key_fp: + type: string + readOnly: true + description: Fingerprint of the user's RSA public key + rsa_public_key_2_fp: + type: string + readOnly: true + description: Fingerprint of the user's second RSA public key + ext_authn_duo: + type: boolean + readOnly: true + ext_authn_uid: + type: string + readOnly: true + owner: + type: string + readOnly: true + snowflake_lock: + type: boolean + readOnly: true + default: false + description: Whether the user, account, or organization is locked by Snowflake. + snowflake_support: + type: boolean + readOnly: true + default: false + description: Whether Snowflake Support is allowed to use the user or account + mins_to_bypass_network_policy: + type: integer + readOnly: true + description: Temporary bypass network policy on the user for a specified + number of minutes + password_last_set: + type: string + readOnly: true + format: date-time + custom_landing_page_url: + type: string + readOnly: true + custom_landing_page_url_flush_next_ui_load: + type: boolean + readOnly: true + default: false + description: Whether or not to flush the custom landing page of the user + on next UI load + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + users: + methods: + create_user: + operation: + $ref: '#/paths/~1api~1v2~1users/post' + response: + mediaType: '' + openAPIDocKey: '200' + list_users: + operation: + $ref: '#/paths/~1api~1v2~1users/get' + response: + mediaType: application/json + openAPIDocKey: '200' + fetch_user: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_user: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + create_or_alter_user: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/users/methods/list_users' + - $ref: '#/components/x-stackQL-resources/users/methods/fetch_user' + insert: + - $ref: '#/components/x-stackQL-resources/users/methods/create_user' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/users/methods/delete_user' + replace: + - $ref: '#/components/x-stackQL-resources/users/methods/create_or_alter_user' + id: snowflake.user.users + name: users + title: Users + grants: + methods: + list_grants: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}~1grants/get' + response: + mediaType: application/json + openAPIDocKey: '200' + grant: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}~1grants/post' + response: + mediaType: '' + openAPIDocKey: '200' + revoke_grants: + operation: + $ref: '#/paths/~1api~1v2~1users~1{name}~1grants:revoke/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/grants/methods/list_grants' + insert: + - $ref: '#/components/x-stackQL-resources/grants/methods/grant' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/grants/methods/revoke_grants' + replace: [] + id: snowflake.user.grants + name: grants + title: Grants +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/view.yaml b/providers/src/snowflake/v00.00.00000/services/view.yaml new file mode 100644 index 00000000..0ad9f4b0 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/view.yaml @@ -0,0 +1,939 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake View API + description: The Snowflake View API is a REST API that you can use to access, update, + and perform certain actions on View resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/databases/{database}/schemas/{schema}/views: + get: + summary: List views + tags: + - view + description: List views + operationId: listViews + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/like' + - $ref: '#/components/parameters/startsWith' + - $ref: '#/components/parameters/showLimit' + - $ref: '#/components/parameters/fromName' + - name: deep + description: Optionally includes dependency information of the view. + in: query + required: false + schema: + type: boolean + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/View' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + post: + summary: Create a view + tags: + - view + description: Create a view + operationId: createView + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/createMode' + - $ref: '#/components/parameters/copyGrants' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/View' + /api/v2/databases/{database}/schemas/{schema}/views/{name}: + get: + summary: Fetch a view + tags: + - view + description: Fetch a view + operationId: fetchView + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/View' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Delete a view + tags: + - view + description: Delete a view + operationId: deleteView + parameters: + - $ref: '#/components/parameters/database' + - $ref: '#/components/parameters/schema' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/ifExists' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + View: + type: object + description: A Snowflake view + properties: + name: + type: string + description: Name of the view + secure: + type: boolean + description: Whether or not this view is secure + kind: + type: string + enum: + - PERMANENT + - TEMPORARY + description: Kind of the view, permanent (default) or temporary + recursive: + type: boolean + description: Whether or not this view can refer to itself using recursive + syntax withot requiring a CTE (common table expression) + columns: + type: array + items: + $ref: '#/components/schemas/ViewColumn' + description: The columns of the view + comment: + type: string + description: user comment associated to an object in the dictionary + query: + type: string + description: Query used to create the view + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the view was created. + database_name: + type: string + readOnly: true + description: Database in which the view is stored + schema_name: + type: string + readOnly: true + description: Schema in which the view is stored + owner: + type: string + readOnly: true + description: Role that owns the view + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the view + required: + - name + - columns + - query + ViewColumn: + type: object + description: A column specifier in the view + properties: + name: + type: string + description: Column name + comment: + type: string + description: Specifies a comment for the column + datatype: + type: string + readOnly: true + description: The data type for the column + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + views: + methods: + list_views: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1views/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_view: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1views/post' + response: + mediaType: '' + openAPIDocKey: '200' + fetch_view: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1views~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_view: + operation: + $ref: '#/paths/~1api~1v2~1databases~1{database}~1schemas~1{schema}~1views~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/views/methods/list_views' + - $ref: '#/components/x-stackQL-resources/views/methods/fetch_view' + insert: + - $ref: '#/components/x-stackQL-resources/views/methods/create_view' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/views/methods/delete_view' + replace: [] + id: snowflake.view.views + name: views + title: Views +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: [] diff --git a/providers/src/snowflake/v00.00.00000/services/warehouse.yaml b/providers/src/snowflake/v00.00.00000/services/warehouse.yaml new file mode 100644 index 00000000..98c720f9 --- /dev/null +++ b/providers/src/snowflake/v00.00.00000/services/warehouse.yaml @@ -0,0 +1,1431 @@ +openapi: 3.0.0 +servers: +- url: https://{endpoint}.snowflakecomputing.com + description: Multi-tenant Snowflake endpoint + variables: + endpoint: + default: orgid-acctid + description: Organization and Account Name +info: + version: 0.0.1 + title: Snowflake Warehouse API + description: The Snowflake Warehouse API is a REST API that you can use to access, + customize and manage virtual warehouse in a Snowflake account. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/warehouses: + post: + summary: Create or replace warehouse + description: Create a virtual warehouse. Equivalent to CREATE WAREHOUSE in SQL. + operationId: createWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Warehouse' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + get: + summary: List warehouse + description: Show a list of warehouse filtered by pattern. Equivalent to SHOW + WAREHOUSE in SQL. + operationId: listWarehouses + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/like' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Warehouse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}: + get: + summary: Describe warehouse + description: Describes the warehouse, show information of the chosen warehouse. + Equivalent to DESCRIBE WAREHOUSE in SQL. + operationId: fetchWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + $ref: '#/components/schemas/Warehouse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + delete: + summary: Drop warehouse + description: Removes the specified virtual warehouse from the system. Equivalent + to DROP WAREHOUSE in SQL. + operationId: deleteWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) warehouse. + description: Create a (or alter an existing) warehouse. Even if the operation + is just an alter, the full property set must be provided. + operationId: createOrAlterWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Warehouse' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:resume: + post: + summary: Resume warehouse + description: "Bring current warehouse to a usable \u2018Running\u2019 state\ + \ by provisioning compute resources if current warehouse is suspended." + operationId: resumeWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:suspend: + post: + summary: Suspend warehouse + description: "Remove all compute nodes from a warehouse and put the warehouse\ + \ into a \u2018Suspended\u2019 state if current warehouse is not suspended." + operationId: suspendWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:rename: + post: + summary: Update and rename warehouse + description: Specifies a new identifier for the warehouse; must be unique for + current account. + operationId: renameWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Warehouse' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:abort: + post: + summary: Abort all queries + description: Aborts all the queries currently running or queued on the warehouse. + operationId: abortAllQueriesOnWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:use: + post: + summary: Use current warehouse for session + description: '[Deprecated] Specifies the active/current warehouse for the session.' + operationId: useWarehouse + tags: + - warehouse + deprecated: true + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:enable: + post: + summary: enable adaptive warehouse + description: "Enable an adaptive warehouse and put the warehouse into a \u2018\ + enabled\u2019 state, if the warehouse is not enabled." + operationId: enableWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' + /api/v2/warehouses/{name}:disable: + post: + summary: disable adaptive warehouse + description: "Disable an adaptive warehouse and put the warehouse into a \u2018\ + disabled\u2019 state, if the warehouse is not disabled." + operationId: disableWarehouse + tags: + - warehouse + parameters: + - $ref: '#/components/parameters/ifExists' + - $ref: '#/components/parameters/name' + responses: + '200': + $ref: '#/components/responses/200SuccessResponse' + '202': + $ref: '#/components/responses/202SuccessAcceptedResponse' + '400': + $ref: '#/components/responses/400BadRequest' + '401': + $ref: '#/components/responses/401Unauthorized' + '403': + $ref: '#/components/responses/403Forbidden' + '404': + $ref: '#/components/responses/404NotFound' + '405': + $ref: '#/components/responses/405MethodNotAllowed' + '408': + $ref: '#/components/responses/408RequestTimeout' + '409': + $ref: '#/components/responses/409Conflict' + '410': + $ref: '#/components/responses/410Gone' + '429': + $ref: '#/components/responses/429LimitExceeded' + '500': + $ref: '#/components/responses/500InternalServerError' + '503': + $ref: '#/components/responses/503ServiceUnavailable' + '504': + $ref: '#/components/responses/504GatewayTimeout' +components: + schemas: + Warehouse: + type: object + description: A Snowflake virtual warehouse + properties: + name: + $ref: '#/components/schemas/Identifier' + description: Name of warehouse + warehouse_type: + type: string + description: 'Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED' + warehouse_size: + type: string + description: 'Size of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, + LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE' + wait_for_completion: + type: string + enum: + - true + - false + description: When resizing a warehouse, you can use this parameter to block + the return of the ALTER WAREHOUSE command until the resize has finished + provisioning all its compute resources + max_cluster_count: + type: integer + format: int32 + description: Specifies the maximum number of clusters for a multi-cluster + warehouse + min_cluster_count: + type: integer + format: int32 + description: Specifies the minimum number of clusters for a multi-cluster + warehouse + scaling_policy: + type: string + description: 'Scaling policy of warehouse, possible scaling policies: STANDARD, + ECONOMY' + auto_suspend: + type: integer + format: int32 + description: time in seconds before auto suspend + auto_resume: + type: string + enum: + - true + - false + description: Specifies whether to automatically resume a warehouse when + a SQL statement is submitted to it + initially_suspended: + type: string + enum: + - true + - false + description: Specifies whether the warehouse is created initially in the + Suspended state + resource_monitor: + $ref: '#/components/schemas/Identifier' + description: Specifies the name of a resource monitor that is explicitly + assigned to the warehouse. When a resource monitor is explicitly assigned + to a warehouse, the monitor controls the monthly credits used by the warehouse + comment: + type: string + format: comment + description: Specifies a comment for the warehouse + enable_query_acceleration: + type: string + enum: + - true + - false + description: Specifies whether to enable the query acceleration service + for queries that rely on this warehouse for compute resources + query_acceleration_max_scale_factor: + type: integer + format: int32 + description: Specifies the maximum scale factor for leasing compute resources + for query acceleration. The scale factor is used as a multiplier based + on warehouse size + max_concurrency_level: + type: integer + format: int32 + description: Object parameter that specifies the concurrency level for SQL + statements executed by a warehouse cluster + statement_queued_timeout_in_seconds: + type: integer + format: int32 + description: Object parameter that specifies the time, in seconds, a SQL + statement can be queued on a warehouse before it is canceled by the system + statement_timeout_in_seconds: + type: integer + format: int32 + description: Object parameter that specifies the time, in seconds, after + which a running SQL statement is canceled by the system + type: + type: string + description: '[Deprecated] Type of warehouse, possible types: STANDARD, + SNOWPARK-OPTIMIZED' + deprecated: true + size: + type: string + description: '[Deprecated] names of size: X-Small, Small, Medium, Large, + X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large' + deprecated: true + state: + type: string + readOnly: true + description: 'The state of warehouse, possible states: STARTED, STARTING, + DYNAMIC, SUSPENDED, RESIZING, RESUMING, SUSPENDING' + started_clusters: + type: integer + format: int32 + readOnly: true + description: Number of clusters currently started. + running: + type: integer + format: int32 + readOnly: true + description: Number of SQL statements that are being executed by the warehouse. + queued: + type: integer + format: int32 + readOnly: true + description: Number of SQL statements that are queued for the warehouse. + is_default: + type: boolean + readOnly: true + description: Whether the warehouse is the default for the current user. + is_current: + type: boolean + readOnly: true + description: Whether the warehouse is in use for the session. Only one warehouse + can be in use at a time for a session. To specify or change the warehouse + for a session, use the USE WAREHOUSE command. + available: + type: string + format: Percentage + readOnly: true + description: Percentage of the warehouse compute resources that are provisioned + and available. + provisioning: + type: string + format: Percentage + readOnly: true + description: Percentage of the warehouse compute resources that are in the + process of provisioning. + quiescing: + type: string + format: Percentage + readOnly: true + description: Percentage of the warehouse compute resources that are executing + SQL statements, but will be shut down once the queries complete. + other: + type: string + format: Percentage + readOnly: true + description: Percentage of the warehouse compute resources that are in a + state other than available, provisioning, or quiescing. + created_on: + type: string + format: date-time + readOnly: true + description: Date and time when the warehouse was created. + resumed_on: + type: string + format: date-time + readOnly: true + description: Date and time when the warehouse was last started or restarted. + updated_on: + type: string + format: date-time + readOnly: true + description: Date and time when the warehouse was last updated, which includes + changing any of the properties of the warehouse or changing the state + (STARTED, SUSPENDED, RESIZING) of the warehouse. + owner: + type: string + format: role name + readOnly: true + description: Role that owns the warehouse. + budget: + type: string + readOnly: true + description: Comment representing budget for warehouse. + kind: + type: string + format: warehouse + readOnly: true + deprecated: true + owner_role_type: + type: string + readOnly: true + description: The type of role that owns the object. + warehouse_credit_limit: + type: integer + format: int64 + description: Credit limit that are can be executed by the warehouse. + target_statement_size: + type: string + description: 'Names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, + 3X-Large, 4X-Large, 5X-Large, 6X-Large' + required: + - name + Identifier: + type: 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. + + ' + pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$ + example: TEST_NAME + ErrorResponse: + type: object + properties: + message: + type: string + description: Error message returned by the server + code: + type: string + description: Error code. + error_code: + type: string + description: Error code, same as `code` above. This property has been deprecated + and will be removed in a future release, but is temporarily supported + for for short-term backward compatibility. + request_id: + type: string + description: Unique request ID. + example: + message: Compilation error! + error_code: '390189' + request_id: 01afef9d-0607-0550-0001-dd270c3902d7 + SuccessResponse: + type: object + description: Schema for all the success responses returned by the server. + properties: + status: + type: string + description: Message returned by the server. + example: + status: Request successfully completed + SuccessAcceptedResponse: + type: object + description: Schema for a request in progress response returned by the server. + properties: + code: + type: string + description: Message code returned by the server. + message: + type: string + description: Message returned by the server + resultHandler: + type: string + description: Opaque result ID used for checking for request completion through + one or more subsequent completion check operations. + example: + code: '392604' + message: Request execution in progress. Use the provided location header or + result handler ID to perform query monitoring and management. + PointOfTime: + type: object + description: Point of time. + required: + - point_of_time_type + properties: + point_of_time_type: + description: 'Type of the point of time. Possible values include: + + - `timestamp`: Exact time using the standard timezone format. Example: + `2023-09-15 10:59:43`. - `offset`: Interval relative to ''now.'' Example: + `1 day`. - `statement`: ID of a query statement to use as the reference + point for Time + Travel. + + For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.' + type: string + examples: + timestamp: + value: '2023-09-15 10:59:43' + offset: + value: 20 ms + reference: + type: string + description: Relation to the point of time. Currently, the API supports + `at` and `before`. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: Point of time identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + timestamp: + type: string + description: Timestamp of the point of time. + PointOfTimeOffset: + description: Point of time identified by an offset in reference to the current + time, such as `10 min`. + allOf: + - $ref: '#/components/schemas/PointOfTime' + examples: + month: + value: 2 months + milliseconds: + value: 20 ms + properties: + offset: + type: string + description: 'Offset from the point of time. Example: `1 year`' + PointOfTimeStatement: + description: Point of time indicating when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + properties: + statement: + type: string + description: Statement of the point of time. + Parameter: + description: Snowflake parameter defined at the system, account, user, session, + or object level. + type: object + required: + - name + properties: + name: + type: string + description: Parameter name. + value: + type: string + description: Parameter value. + defaultValue: + type: string + description: Default parameter value. + dataType: + type: string + description: Data type of the parameter value. Either BOOLEAN, NUMBER, FLOAT, + or STRING. + level: + type: string + description: Level at which parameter is defined. + description: + type: string + description: Parameter description. + example: + name: SAMPLE_SNOWAPI_PARAM + value: true + defaultValue: false + dataType: boolean + level: ACCOUNT + description: Sample snowflake parameter. + TargetLag: + type: object + description: Specifies the schedule for periodically refreshing the dynamic + table. + properties: + type: + description: Type of lag, can be either USER_DEFINED or DOWNSTREAM. + type: string + discriminator: + propertyName: type + mapping: + USER_DEFINED: UserDefinedLag + DOWNSTREAM: DownstreamLag + UserDefinedLag: + description: User-defined target lag. + allOf: + - $ref: '#/components/schemas/TargetLag' + properties: + seconds: + type: integer + format: int64 + description: Target lag time in seconds. + example: + seconds: 3600 + required: + - seconds + DownstreamLag: + description: Downstream target lag + allOf: + - $ref: '#/components/schemas/TargetLag' + securitySchemes: + KeyPair: + type: http + scheme: bearer + bearerFormat: JWT + description: Set `X-Snowflake-Authorization-Token-Type` to `KEYPAIR_JWT` if + the token is a key-pair authentication JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (see External + OAuth overview.) Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` + and set the Token to the auth token received from the external Auth server. + SnowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + description: Set `X-Snowflake-Authorization-Token-Type` to `OAUTH` if the token + is snowflakeOAuth + parameters: + database: + name: database + description: Identifier (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. + required: true + in: path + schema: + example: TEST_DB + $ref: '#/components/schemas/Identifier' + schema: + name: schema + description: Identifier (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. + required: true + in: path + schema: + example: TEST_SCHEMA + $ref: '#/components/schemas/Identifier' + application: + name: application + description: Identifier (i.e. name) for the application to which the resource + belongs. You can use the `/api/v2/applications/{application}` GET request + to get a list of available applications. + required: true + in: path + schema: + example: TEST_APPLICATION + $ref: '#/components/schemas/Identifier' + name: + name: name + description: Identifier (i.e. name) for the resource. + required: true + in: path + schema: + example: TEST_NAME + $ref: '#/components/schemas/Identifier' + nameWithArgs: + name: nameWithArgs + description: Function's name with Args + required: true + in: path + schema: + type: string + example: foo(a number, b number) + createMode: + name: createMode + description: 'Query parameter allowing support for different modes of resource + creation. Possible values include: + + - `errorIfExists`: Throws an error if you try to create a resource that already + exists. + + - `orReplace`: Automatically replaces the existing resource with the current + one. + + - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent + resource.' + in: query + schema: + type: string + enum: + - errorIfExists + - orReplace + - ifNotExists + example: ifNotExists + default: errorIfExists + mode: + name: mode + description: 'Query parameter determines whether the revoke operation succeeds + or fails for the privileges, based on the whether the privileges had been + re-granted to another role. + + - restrict: If the privilege being revoked has been re-granted to another + role, the REVOKE command fails. + + - cascade: If the privilege being revoked has been re-granted, the REVOKE + command recursively revokes these dependent grants. If the same privilege + on an object has been granted to the target role by a different grantor (parallel + grant), that grant is not affected and the target role retains the privilege.' + in: query + schema: + type: string + enum: + - restrict + - cascade + example: restrict + ifExists: + name: ifExists + description: '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.' + in: query + schema: + type: boolean + example: true + default: false + like: + name: like + description: Query parameter to filter the command output by resource name. + Uses case-insensitive pattern matching, with support for SQL wildcard characters. + in: query + schema: + type: string + example: test_% + pattern: + name: pattern + description: A query parameter that filters the command output by a regular + expression pattern. + in: query + schema: + type: string + example: .*data_0.* + startsWith: + name: startsWith + description: Query parameter to filter the command output based on the string + of characters that appear at the beginning of the object name. Uses case-sensitive + pattern matching. + in: query + schema: + type: string + example: test + rootOnly: + name: rootOnly + description: Query parameter to filter the command output to return only root + resources (resources with no predecessors). + in: query + schema: + type: boolean + example: false + default: false + showLimit: + name: showLimit + description: Query parameter to limit the maximum number of rows returned by + a command. + in: query + schema: + type: integer + example: 10 + minimum: 1 + maximum: 10000 + fromName: + name: fromName + description: Query parameter to enable fetching rows only following the first + row whose object name matches the specified string. Case-sensitive and does + not have to be the full name. + in: query + schema: + type: string + example: from_test + copyGrants: + name: copyGrants + description: Query parameter to enable copy grants when creating the object. + in: query + schema: + type: boolean + example: false + default: false + asyncExec: + name: asyncExec + in: query + description: Asynchronous execution enable/disable. Default is disable. + schema: + type: boolean + default: false + sessionId: + name: sessionId + description: Unique ID for the current session. + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: Content-Type + description: Type of content for the resource. Currently supports `application/json`. + in: header + schema: + type: string + enum: + - application/json + accept: + name: Accept + description: Type of data format accepted by the resource. Currently supports + `application/json`. + in: header + schema: + type: string + enum: + - application/json + x-snowflake-authorization-token-type: + name: X-Snowflake-Authorization-Token-Type + description: Type of the Snowflake authorization token. Currently, keypair-jwt + (`KEYPAIR_JWT`) and OAuth tokens are supported. + in: header + schema: + type: string + enum: + - KEYPAIR_JWT + - OAUTH + x-sfc-session: + name: X-Sfc-Session + description: Token for the current Snowflake session. + in: header + required: false + schema: + type: string + description: Snowflake session token. + example: ver:3-hint:1000-ABCD= + headers: + X-Snowflake-Request-ID: + description: Unique ID of the API request. + schema: + type: string + format: uuid + Link: + description: Links to the page of results (e.g. the first page, the last page, + etc.). The header can include multiple 'url' entries with different 'rel' + attribute values that specify the page to return ('first', 'next', 'prev', + and 'last'). + schema: + type: string + example: ; rel="first",; + rel="next",; + rel="last" + responses: + 200SuccessResponse: + description: Successful request. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 201SuccessCreatedResponse: + description: Successfully created a new resource on the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + 202SuccessAcceptedResponse: + headers: + Location: + schema: + type: string + description: Relative path for checking request status or getting the + result, if available. + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + description: Successfully accepted the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessAcceptedResponse' + 400BadRequest: + description: Bad Request. The request payload is invalid or malformed. This + happens if the application didn't send the correct request payload. The response + body may include the error code and message indicating the actual cause. The + application must reconstruct the request body for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 401Unauthorized: + description: Unauthorized. The request is not authorized. This happens if the + attached access token is invalid or missing. The response body may include + the error code and message indicating the actual cause, e.g., expired, invalid + token. The application must obtain a new access token for retry. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 403Forbidden: + description: Forbidden. The request is forbidden. This can also happen if the + request is made even if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 404NotFound: + description: Not Found. The request endpoint is not valid. This happens if the + API endpoint does not exist, or if the API is not enabled. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 405MethodNotAllowed: + description: Method Not Allowed. The request method doesn't match the supported + API. This happens, for example, if the application calls the API with GET + method but the endpoint accepts only POST. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 408RequestTimeout: + description: Request Timeout. This indicates that the request from the client + timed out and was not completed by the server. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 409Conflict: + description: Conflict. The requested operation could not be performed due to + a conflicting state that could not be resolved. This usually happens when + a CREATE request was performed when there is a pre-existing resource with + the same name, and also without one of the options orReplace/ifNotExists. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 410Gone: + description: Gone. This error is primarily intended to assist the task of web + maintenance by notifying the recipient that the resource is intentionally + unavailable. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 415UnsupportedMediaType: + description: The request header Content-Type includes an unsupported media type. + The API supports application/json only. If none specified, the request payload + is taken as JSON, but if any other media type is specified, this error is + returned. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 429LimitExceeded: + description: Limit Exceeded. The number of requests hit the rate limit. The + application must slow down the frequency of hitting the API endpoints. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 500InternalServerError: + description: Internal Server Error. The server hit an unrecoverable system error. + The response body may include the error code and message for further guidance. + The application owner may need to reach out the customer support. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 503ServiceUnavailable: + description: Service Unavailable. The request was not processed due to server + side timeouts. The application may retry with backoff. The jittered backoff + is recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 504GatewayTimeout: + description: Gateway Timeout. The request was not processed due to server side + timeouts. The application may retry with backoff. The jittered backoff is + recommended. + headers: + X-Snowflake-Request-ID: + $ref: '#/components/headers/X-Snowflake-Request-ID' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-stackQL-resources: + warehouses: + methods: + create_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses/post' + response: + mediaType: '' + openAPIDocKey: '200' + list_warehouses: + operation: + $ref: '#/paths/~1api~1v2~1warehouses/get' + response: + mediaType: application/json + openAPIDocKey: '200' + fetch_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}/delete' + response: + mediaType: '' + openAPIDocKey: '200' + create_or_alter_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}/put' + response: + mediaType: '' + openAPIDocKey: '200' + resume_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:resume/post' + response: + mediaType: '' + openAPIDocKey: '200' + suspend_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:suspend/post' + response: + mediaType: '' + openAPIDocKey: '200' + rename_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:rename/post' + response: + mediaType: '' + openAPIDocKey: '200' + abort_all_queries_on_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:abort/post' + response: + mediaType: '' + openAPIDocKey: '200' + use_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:use/post' + response: + mediaType: '' + openAPIDocKey: '200' + enable_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:enable/post' + response: + mediaType: '' + openAPIDocKey: '200' + disable_warehouse: + operation: + $ref: '#/paths/~1api~1v2~1warehouses~1{name}:disable/post' + response: + mediaType: '' + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/warehouses/methods/list_warehouses' + - $ref: '#/components/x-stackQL-resources/warehouses/methods/fetch_warehouse' + insert: + - $ref: '#/components/x-stackQL-resources/warehouses/methods/create_warehouse' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/warehouses/methods/delete_warehouse' + replace: + - $ref: '#/components/x-stackQL-resources/warehouses/methods/create_or_alter_warehouse' + id: snowflake.warehouse.warehouses + name: warehouses + title: Warehouses +security: +- KeyPair: [] +- ExternalOAuth: [] +- SnowflakeOAuth: []