diff --git a/.gitignore b/.gitignore index 921447b..f4b4b6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Created by https://www.gitignore.io/api/c,c++,node,java,python,intellij,netbeans # Edit at https://www.gitignore.io/?templates=c,c++,node,java,python,intellij,netbeans +.DS_Store ### C ### # Prerequisites diff --git a/specification/private-preview/2023-11-13-private-preview/common.yaml b/specification/private-preview/2023-11-13-private-preview/common.yaml new file mode 100644 index 0000000..7ed12a6 --- /dev/null +++ b/specification/private-preview/2023-11-13-private-preview/common.yaml @@ -0,0 +1,310 @@ +components: + schemas: + description: 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. + Identifier: + type: string + pattern: '^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$' + ErrorResponse: + type: object + properties: + message: + type: string + description: "Error message returned by server" + error_code: + type: string + description: "Error code" + 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 response returned by server" + properties: + status: + type: string + description: "Message returned by server" + example: + status: "Request successfully completed" + Clone: + type: object + description: When cloning an obejct we need the source's name and a point of time that we want to clone at. + properties: + source: + $ref: './common.yaml#/components/schemas/Identifier' + point_of_time: + $ref: '#/components/schemas/PointOfTime' + required: + - "source" + PointOfTime: + type: object + required: + - point_of_time_type + properties: + point_of_time_type: + type: string + reference: + type: string + description: The relation to the point of time. + At the time of writing at and before are supported. + when: + type: string + description: The actual description of the point of time. + discriminator: + propertyName: point_of_time_type + mapping: + timestamp: PointOfTimeTimestamp + offset: PointOfTimeOffset + statement: PointOfTimeStatement + PointOfTimeTimestamp: + description: A point of time that is identified by a timestamp. + allOf: + - $ref: '#/components/schemas/PointOfTime' + PointOfTimeOffset: + description: A point of time that is identified by an offset in reference to right now. + allOf: + - $ref: '#/components/schemas/PointOfTime' + PointOfTimeStatement: + description: A point of time that is identified by when a statement was executed. + allOf: + - $ref: '#/components/schemas/PointOfTime' + parameters: + database: + name: database + required: true + in: 'path' + schema: + example: TEST_DB + $ref: './common.yaml#/components/schemas/Identifier' + schema: + name: schema + required: true + in: 'path' + schema: + example: TEST_SCHEMA + $ref: './common.yaml#/components/schemas/Identifier' + name: + name: name + required: true + in: 'path' + schema: + example: TEST_NAME + $ref: './common.yaml#/components/schemas/Identifier' + tag: + name: 'tag' + in: 'query' + schema: + type: object + example: TEST_TAG + additionalProperties: true + createMode: + name: 'createMode' + in: 'query' + schema: + type: string + enum: [errorIfExists, orReplace, ifNotExists] + example: errorIfExists + default: errorIfExists + ifExists: + name: 'ifExists' + in: 'query' + schema: + type: boolean + example: false + default: false + like: + name: 'like' + in: 'query' + schema: + type: string + example: "test_%" + startsWith: + name: 'startsWith' + in: 'query' + schema: + type: string + example: "test" + rootOnly: + name: 'rootOnly' + in: 'query' + schema: + type: boolean + example: false + default: false + showLimit: + name: 'showLimit' + in: 'query' + schema: + type: integer + example: 10 + fromName: + name: 'fromName' + in: 'query' + schema: + type: string + example: "from_test" + sessionId: + name: 'sessionId' + required: true + in: path + schema: + type: integer + format: uuid + example: 524514326772799 + content-type: + name: 'Content-Type' + in: header + schema: + type: string + enum: ['application/json'] + accept: + name: 'Accept' + in: header + schema: + type: string + enum: ['application/json'] + x-snowflake-authorization-token-type: + name: 'X-Snowflake-Authorization-Token-Type' + in: header + schema: + type: string + enum: ['KEYPAIR_JWT'] + x-sfc-session: + name: 'X-Sfc-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 authn JWT. + ExternalOAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Configure External Oauth with Snowflake (refer to docs). Set X-Snowflake-Authorization-Token-Type to OAUTH and set the Token to auth token received from the external Auth server. + snowflakeOAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: /oauth/authorize + scopes: {} + responses: + '200SuccessResponse': + description: Successful + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + + '201SuccessCreatedResponse': + description: Successfully create new resource on server. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + + '202SuccessAcceptedResponse': + description: Successfully accept the request, but it is not completed yet. + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessResponse' + + '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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + + security: + - keyPair: [] + - ExternalOAuth: [] + - snowflakeOAuth: [] diff --git a/specification/private-preview/2023-11-13-private-preview/compute-pool.yaml b/specification/private-preview/2023-11-13-private-preview/compute-pool.yaml new file mode 100644 index 0000000..1d16aa7 --- /dev/null +++ b/specification/private-preview/2023-11-13-private-preview/compute-pool.yaml @@ -0,0 +1,341 @@ +openapi: 3.0.0 +servers: + - description: Snowflake Compute Pools API + url: https://org-account.snowflakecomputing.com +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 certain actions on Compute Pool resources. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + /api/v2/compute-pools: + get: + summary: List compute pools + tags: + - compute-pool + description: Lists the compute pools under the account. + operationId: fetchComputePools + parameters: + - $ref: 'common.yaml#/components/parameters/like' + - $ref: 'common.yaml#/components/parameters/startsWith' + - $ref: 'common.yaml#/components/parameters/showLimit' + responses: + '200': + description: successful + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ComputePool' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + post: + summary: Create a compute pool + tags: + - compute-pool + description: Create 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: 'common.yaml#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}: + get: + summary: Fetch a compute pool. + tags: + - compute-pool + description: Fetch a compute pool using the SHOW command output. + operationId: fetchComputePool + parameters: + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + description: successful + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + put: + summary: Create a (or alter an existing) compute pool. + tags: + - compute-pool + description: Create a (or alter an existing) . Even if the operation + is just an alter, the full property set must be provided. + operationId: createOrAlterComputePool + parameters: + - $ref: 'common.yaml#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ComputePool' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: 'common.yaml#/components/parameters/name' + - $ref: 'common.yaml#/components/parameters/ifExists' + summary: Delete a compute pool + tags: + - compute-pool + description: Delete a compute pool with the given name. If ifExists is used, the operation will + succeed even if the object does not exist. Otherwise, there will be a 404 failure + if the drop is unsuccessful. + operationId: deleteComputePool + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:resume: + post: + summary: Resume a compute pool + tags: + - compute-pool + description: Resume a compute pool, if suspended. This is a no-op if it is already running. + operationId: resumeComputePool + parameters: + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:suspend: + post: + summary: Perform an action on a compute pool + tags: + - compute-pool + description: Suspend a compute pool. + operationId: suspendComputePool + parameters: + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/compute-pools/{name}:stopallservices: + post: + summary: Stops all services on the compute pool. + tags: + - compute-pool + description: Stop all services in the compute pool. + operationId: stopAllServicesInComputePool + parameters: + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' +components: + schemas: + ComputePool: + type: object + properties: + name: + $ref: './common.yaml#/components/schemas/Identifier' + warehouse: + $ref: './common.yaml#/components/schemas/Identifier' + min_nodes: + type: integer + max_nodes: + type: integer + instance_family: + type: string + auto_resume: + type: boolean + comment: + type: string + state: + type: string + readOnly: true + enum: [UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, RESIZING] + num_services: + type: integer + readOnly: true + auto_suspend_secs: + type: integer + format: int64 + active_nodes: + type: integer + readOnly: true + idle_nodes: + type: integer + readOnly: true + created_on: + type: string + format: date-time + readOnly: true + resumed_on: + type: string + format: date-time + readOnly: true + updated_on: + type: string + format: date-time + readOnly: true + owner: + type: string + 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 + auto_suspend_secs: 10 + active_nodes: 2 + idle_nodes: 2 + created_on: "YYYY-MM-DDTHH:MI:SS.FF6" + updated_on: "YYYY-MM-DDTHH:MI:SS.FF6" + resumed_on: "YYYY-MM-DDTHH:MI:SS.FF6" + owner: POOL_ADMIN + required: + - name + - instance_family + - min_nodes + - max_nodes +tags: + - name: compute-pool diff --git a/specification/private-preview/2023-11-13-private-preview/image-repository.yaml b/specification/private-preview/2023-11-13-private-preview/image-repository.yaml new file mode 100644 index 0000000..f0b855a --- /dev/null +++ b/specification/private-preview/2023-11-13-private-preview/image-repository.yaml @@ -0,0 +1,195 @@ +openapi: 3.0.0 +servers: + - description: Snowflake Image Repository API + url: https://org-account.snowflakecomputing.com +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 certain 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: List image repositories + tags: + - image-repository + description: Lists the image repositories under the database and schema. + operationId: listImageRepositories + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/like' + responses: + '200': + description: successful + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageRepository' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + post: + summary: Create an image repository + tags: + - image-repository + description: Create an image repository, with standard create modifiers + as query parameters. See the ImageRepository component definition + for what is required to be provided in the request body. + operationId: createImageRepository + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ImageRepository' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/image-repositories/{name}: + get: + summary: Fetch an image repository. + tags: + - image-repository + description: Fetch an image repository using the SHOW command output. + operationId: fetchImageRepository + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + description: successful + content: + application/json: + schema: + $ref: '#/components/schemas/ImageRepository' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - $ref: 'common.yaml#/components/parameters/ifExists' + summary: Delete an image repository + tags: + - image-repository + description: Delete an image repository 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: deleteImageRepository + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' +components: + schemas: + ImageRepository: + type: object + properties: + name: + $ref: './common.yaml#/components/schemas/Identifier' + database_name: + $ref: './common.yaml#/components/schemas/Identifier' + readOnly: true + schema_name: + $ref: './common.yaml#/components/schemas/Identifier' + readOnly: true + created_on: + type: string + format: date-time + readOnly: true + repository_url: + type: string + readOnly: true + owner: + type: string + readOnly: true + owner_role_type: + type: string + readOnly: true + example: + name: image_repository_name + database_name: test_db + schema_name: test_schema + created_on: "YYYY-MM-DDTHH:MI:SS.FF6" + repository_url: https://www.snowflake.com + owner: IMAGE_ADMIN + owner_role_type: ADMIN + required: + - name +tags: + - name: image-repository diff --git a/specification/private-preview/2023-11-13-private-preview/service.yaml b/specification/private-preview/2023-11-13-private-preview/service.yaml new file mode 100644 index 0000000..1109de8 --- /dev/null +++ b/specification/private-preview/2023-11-13-private-preview/service.yaml @@ -0,0 +1,364 @@ +openapi: 3.0.0 +servers: + - description: Snowflake Services API + url: https://org-account.snowflakecomputing.com +info: + version: 0.0.1 + title: Snowflake Services API + description: >- + The Snowflake Services API is a REST API that you can use to access, update, and perform certain actions on Services resource in a Snowflake database. + contact: + name: Snowflake, Inc. + url: https://snowflake.com + email: support@snowflake.com +paths: + + /api/v2/databases/{database}/schemas/{schema}/services: + get: + summary: List services + tags: + - service + description: Lists the services under the database and schema. + operationId: listServices + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/like' + - $ref: 'common.yaml#/components/parameters/startsWith' + - $ref: 'common.yaml#/components/parameters/showLimit' + responses: + '200': + description: successful + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceFull' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + post: + summary: Create a service + tags: + - service + description: Create a service, with standard create modifiers + as query parameters. See the Service component definition + for what is required to be provided in the request body. + operationId: createService + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Service' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/services/{name}: + get: + summary: Fetch a service. + tags: + - service + description: Fetch a Service using the SHOW command output. + operationId: fetchService + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + description: successful + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ServiceFull' + - $ref: '#/components/schemas/ServiceWithSpec' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - $ref: 'common.yaml#/components/parameters/ifExists' + summary: Delete a service + tags: + - service + description: Delete a service 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: deleteService + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/services/{name}/logs: + get: + summary: Fetch the logs for a given service. + tags: + - service + description: Fetch the logs for a service. + operationId: fetchServiceLogs + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - in: query + name: instance_id + schema: + type: integer + - in: query + name: container_name + schema: + type: string + responses: + '200': + description: successful + content: + application/json: + schema: + type: string + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/services/{name}/status: + get: + summary: Fetch the status for a given service. + tags: + - service + description: Fetch the status for a service. + operationId: fetchServiceStatus + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - in: query + name: timeout + schema: + type: integer + responses: + '200': + description: successful + content: + application/json: + schema: + type: string + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/services/{name}:resume: + post: + summary: Resume a service + tags: + - service + description: Resume a service. + operationId: resumeService + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + + /api/v2/databases/{database}/schemas/{schema}/services/{name}:suspend: + post: + summary: Suspend a service + tags: + - service + description: Suspend a service. + operationId: suspendService + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' +components: + schemas: + Service: + type: object + properties: + name: + $ref: './common.yaml#/components/schemas/Identifier' + compute_pool: + type: string + min_instances: + type: integer + max_instances: + type: integer + database_name: + $ref: './common.yaml#/components/schemas/Identifier' + readOnly: true + schema_name: + $ref: './common.yaml#/components/schemas/Identifier' + readOnly: true + owner: + type: string + readOnly: true + dns_name: + type: string + readOnly: true + public_endpoints: + type: string + readOnly: true + required: + - name + - compute_pool + - min_instances + - max_instances + + ServiceWithSpec: + allOf: + - $ref: '#/components/schemas/Service' + - type: object + properties: + spec: + type: string + readOnly: true + + ServiceFull: + allOf: + - $ref: '#/components/schemas/Service' + - type: object + properties: + class_database: + type: string + readOnly: true + class_schema: + type: string + readOnly: true + class_name: + type: string + readOnly: true + class_version: + type: string + readOnly: true + +tags: + - name: service diff --git a/specification/private-preview/2023-11-13-private-preview/task.yaml b/specification/private-preview/2023-11-13-private-preview/task.yaml new file mode 100644 index 0000000..e159046 --- /dev/null +++ b/specification/private-preview/2023-11-13-private-preview/task.yaml @@ -0,0 +1,641 @@ +openapi: 3.0.0 +servers: + - description: Snowflake Task API + url: https://org-account.snowflakecomputing.com +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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/rootOnly' + - $ref: 'common.yaml#/components/parameters/like' + - $ref: 'common.yaml#/components/parameters/startsWith' + - $ref: 'common.yaml#/components/parameters/showLimit' + responses: + '200': + description: successful + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Task' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/createMode' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '409': + $ref: 'common.yaml#/components/responses/409Conflict' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + description: successful + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + delete: + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - $ref: 'common.yaml#/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: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + - name: retryLast + in: query + description: Retry the last failed run of the DAG. + schema: + type: boolean + default: false + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' + /api/v2/databases/{database}/schemas/{schema}/tasks/{name}:suspend: + post: + summary: Suspends a running task. + tags: + - task + description: Suspends a running task. This is equivalent to an ALTER TASK ... SUSPEND. + operationId: suspendTask + parameters: + - $ref: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + $ref: 'common.yaml#/components/responses/200SuccessResponse' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/components/parameters/name' + responses: + '200': + description: successful + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Task' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/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 + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/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: 'common.yaml#/components/parameters/database' + - $ref: 'common.yaml#/components/parameters/schema' + - $ref: 'common.yaml#/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 + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskRun' + '400': + $ref: 'common.yaml#/components/responses/400BadRequest' + '401': + $ref: 'common.yaml#/components/responses/401Unauthorized' + '403': + $ref: 'common.yaml#/components/responses/403Forbidden' + '404': + $ref: 'common.yaml#/components/responses/404NotFound' + '405': + $ref: 'common.yaml#/components/responses/405MethodNotAllowed' + '429': + $ref: 'common.yaml#/components/responses/429LimitExceeded' + '500': + $ref: 'common.yaml#/components/responses/500InternalServerError' + '503': + $ref: 'common.yaml#/components/responses/503ServiceUnavailable' + '504': + $ref: 'common.yaml#/components/responses/504GatewayTimeout' +components: + schemas: + TaskRun: + type: object + properties: + root_task_name: + type: string + readOnly: true + database_name: + type: string + readOnly: true + schema_name: + type: string + readOnly: true + state: + type: string + enum: [SCHEDULED, EXECUTING, SUCCEEDED, FAILED, CANCELLED] + readOnly: true + first_error_task_name: + type: string + readOnly: true + first_error_code: + type: integer + readOnly: true + first_error_message: + type: string + readOnly: true + scheduled_time: + type: string + format: date-time + readOnly: true + query_start_time: + type: string + format: date-time + readOnly: true + next_scheduled_time: + type: string + format: date-time + readOnly: true + completed_time: + type: string + format: date-time + readOnly: true + root_task_id: + type: string + readOnly: true + graph_version: + type: integer + readOnly: true + run_id: + type: integer + 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: "YYYY-MM-DDTHH24:MI:SS.FF6" + query_start_time: "YYYY-MM-DDTHH24:MI:SS.FF6" + next_scheduled_time: "YYYY-MM-DDTHH24:MI:SS.FF6" + completed_time: "YYYY-MM-DDTHH24:MI:SS.FF6" + 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 + properties: + name: + $ref: './common.yaml#/components/schemas/Identifier' + warehouse: + $ref: './common.yaml#/components/schemas/Identifier' + schedule: + oneOf: + - $ref: '#/components/schemas/MinutesSchedule' + - $ref: '#/components/schemas/CronSchedule' + discriminator: + propertyName: schedule_type + mapping: + CRON_TYPE: '#/components/schemas/CronSchedule' + MINUTES_TYPE: '#/components/schemas/MinutesSchedule' + comment: + type: string + config: + type: object + additionalProperties: true + description: Task Config + definition: + type: string + predecessors: + type: array + items: + type: string + user_task_managed_initial_warehouse_size: + type: string + user_task_timeout_ms: + type: integer + suspend_task_after_num_failures: + type: integer + condition: + type: string + allow_overlapping_execution: + type: boolean + error_integration: + type: string + created_on: + type: string + format: date-time + readOnly: true + id: + type: string + readOnly: true + owner: + type: string + readOnly: true + owner_role_type: + type: string + readOnly: true + state: + type: string + readOnly: true + enum: [started, suspended] + last_committed_on: + type: string + readOnly: true + format: date-time + last_suspended_on: + type: string + readOnly: true + format: date-time + database_name: + type: string + readOnly: true + schema_name: + type: string + readOnly: true + example: + name: task_name + warehouse: test_wh + 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: XSMALL + 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: "YYYY-MM-DDTHH:MI:SS.FF6" + id: task_id + owner: TASK_ADMIN + owner_role_type: ADMIN + state: started + last_committed_on: "YYYY-MM-DDTHH:MI:SS.FF6" + last_suspended_on: "YYYY-MM-DDTHH:MI:SS.FF6" + database_name: TESTDB + schema_name: TESTSCHEMA + required: + - name + - definition + CronSchedule: + type: object + properties: + cron_expr: + type: string + timezone: + type: string + example: + cron_expr: "* * * * ? *" + timezone: america/los_angeles + required: + - cron_expr + - timezone + MinutesSchedule: + type: object + properties: + minutes: + type: integer + example: + minutes: 10 + required: + - minutes +externalDocs: + description: Streams and Tasks Reference + url: https://docs.snowflake.com/en/sql-reference/commands-stream +tags: + - name: task