From ce7b9d5a8b593f4a4fdbf68b0713d945c8b40518 Mon Sep 17 00:00:00 2001 From: ericbaumann <24817191+ericbaumann@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:40:40 -0500 Subject: [PATCH 1/2] add API docs for EAT --- openapi-v2.yaml | 400 +++++++++++++++++++++++++++++++++++++++--------- openapi-v3.yaml | 273 +++++++++++++++++++++++++++++++++ 2 files changed, 603 insertions(+), 70 deletions(-) diff --git a/openapi-v2.yaml b/openapi-v2.yaml index 38e36d0..2ac4da7 100644 --- a/openapi-v2.yaml +++ b/openapi-v2.yaml @@ -873,7 +873,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/InternalJobDefinitionEnveloped' + $ref: '#/components/schemas/HumanReadableJobDefinitionEnveloped' description: '' post: operationId: Create Job @@ -1012,7 +1012,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RunEnveloped' + $ref: '#/components/schemas/RunResponseEnveloped' description: '' /api/v2/accounts/{account_id}/jobs/{id}/: get: @@ -1095,7 +1095,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalJobDefinitionEnveloped' + $ref: '#/components/schemas/HumanReadableJobDefinitionEnveloped' description: '' post: operationId: Update Job @@ -1958,7 +1958,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/RunEnveloped' + $ref: '#/components/schemas/RunResponseEnveloped' description: '' /api/v2/accounts/{account_id}/runs/{id}/: get: @@ -2060,7 +2060,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RunEnveloped' + $ref: '#/components/schemas/RunResponseEnveloped' description: '' /api/v2/accounts/{account_id}/runs/{run_id}/artifacts/: get: @@ -2086,7 +2086,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Defaults' + $ref: '#/components/schemas/ListOfStringsEnveloped' description: '' /api/v2/accounts/{account_id}/runs/{run_id}/artifacts/{remainder}: get: @@ -2158,7 +2158,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Defaults' + $ref: '#/components/schemas/RunResponseEnveloped' description: '' /api/v2/accounts/{account_id}/runs/{run_id}/retry/: get: @@ -2240,7 +2240,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Defaults' + $ref: '#/components/schemas/RunStepEnveloped' description: '' /api/v2/accounts/{account_id}/users/: get: @@ -3166,6 +3166,144 @@ components: - all_projects - group_id - permission_set + HumanReadableJobDefinition: + type: object + required: + - id + - environment_id + - account_id + - project_id + - name + - dbt_version + - triggers + - schedule + - settings + - execution + - state + - generate_docs + - run_generate_sources + properties: + id: + oneOf: + - type: 'null' + - type: integer + environment_id: + type: integer + deferring_job_definition_id: + oneOf: + - type: 'null' + - type: integer + deferring_environment_id: + oneOf: + - type: 'null' + - type: integer + lifecycle_webhooks: + oneOf: + - type: boolean + - type: 'null' + lifecycle_webhooks_url: + oneOf: + - type: string + - type: 'null' + account_id: + type: integer + project_id: + type: integer + name: + allOf: + - type: string + - minLength: 1 + maxLength: 255 + description: + allOf: + - type: string + - minLength: 0 + maxLength: 255 + dbt_version: + oneOf: + - type: string + - type: 'null' + raw_dbt_version: + oneOf: + - type: string + - type: 'null' + triggers: + description: 'only one of the following fields can be true: triggers.github_webhook, + triggers.schedule, & triggers.git_provider_webhook' + created_at: + type: string + format: date-time + readOnly: true + updated_at: + type: string + format: date-time + readOnly: true + execute_steps: + allOf: + - {} + - minLength: 1 + maxLength: 100 + - {} + schedule: + description: schedule is only required if triggers.schedule is true + settings: {} + execution: {} + state: + oneOf: + - {} + - {} + generate_docs: + type: boolean + run_generate_sources: + type: boolean + environment: {} + account: + oneOf: + - {} + - type: 'null' + project: + oneOf: + - {} + - type: 'null' + most_recent_completed_run: + oneOf: + - {} + - type: 'null' + most_recent_run: + oneOf: + - {} + - type: 'null' + is_deferrable: + type: boolean + deactivated: + type: boolean + run_failure_count: + type: integer + job_type: + oneOf: + - {} + - {} + - {} + - type: 'null' + triggers_on_draft_pr: + type: boolean + generate_sources: + type: boolean + additionalProperties: false + definitions: {} + $schema: http://json-schema.org/draft-07/schema# + HumanReadableJobDefinitionEnveloped: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/HumanReadableJobDefinition' + status: + $ref: '#/components/schemas/Status' + required: + - data + - status InternalJobDefinition: type: object required: @@ -3708,6 +3846,30 @@ components: * `ci` - ci * `scheduled` - scheduled * `other` - other + ListOfStringsEnveloped: + type: object + properties: + data: + type: array + items: + type: string + status: + $ref: '#/components/schemas/Status' + required: + - data + - status + LogLocationEnum: + enum: + - legacy + - s3 + - db + - empty + type: string + description: |- + * `legacy` - legacy + * `s3` - s3 + * `db` - db + * `empty` - empty PermissionSetEnum: enum: - owner @@ -4145,6 +4307,18 @@ components: $ref: '#/components/schemas/GitProvider' required: - account_id + RetryNotSupportedReasonEnum: + enum: + - RETRY_UNSUPPORTED_CMD + - RETRY_UNSUPPORTED_VERSION + - RETRY_NOT_LATEST_RUN + - RETRY_NOT_FAILED_RUN + type: string + description: |- + * `RETRY_UNSUPPORTED_CMD` - RETRY_UNSUPPORTED_CMD + * `RETRY_UNSUPPORTED_VERSION` - RETRY_UNSUPPORTED_VERSION + * `RETRY_NOT_LATEST_RUN` - RETRY_NOT_LATEST_RUN + * `RETRY_NOT_FAILED_RUN` - RETRY_NOT_FAILED_RUN Run: type: object properties: @@ -4162,10 +4336,8 @@ components: type: integer status: type: integer - default: 1 dbt_version: type: string - default: 1.6.0-latest git_branch: type: string git_sha: @@ -4180,26 +4352,82 @@ components: type: integer artifacts_saved: type: boolean - default: false artifact_s3_path: type: string has_docs_generated: type: boolean - default: false has_sources_generated: type: boolean - default: false notifications_sent: type: boolean - default: false blocked_by: type: array items: type: integer - default: [] scribe_enabled: type: boolean - default: false + is_running: + type: boolean + required: + - account_id + - artifacts_saved + - blocked_by + - dbt_version + - environment_id + - has_docs_generated + - has_sources_generated + - job_definition_id + - notifications_sent + - project_id + - scribe_enabled + - status + RunResponse: + type: object + properties: + id: + type: integer + trigger_id: + type: integer + account_id: + type: integer + environment_id: + type: integer + project_id: + type: integer + job_definition_id: + type: integer + status: + type: integer + dbt_version: + type: string + git_branch: + type: string + git_sha: + type: string + status_message: + type: string + owner_thread_id: + type: string + executed_by_thread_id: + type: string + deferring_run_id: + type: integer + artifacts_saved: + type: boolean + artifact_s3_path: + type: string + has_docs_generated: + type: boolean + has_sources_generated: + type: boolean + notifications_sent: + type: boolean + blocked_by: + type: array + items: + type: integer + scribe_enabled: + type: boolean created_at: type: string format: date-time @@ -4211,124 +4439,156 @@ components: dequeued_at: type: string format: date-time - readOnly: true started_at: type: string format: date-time - readOnly: true finished_at: type: string format: date-time - readOnly: true last_checked_at: type: string format: date-time - readOnly: true last_heartbeat_at: type: string format: date-time - readOnly: true should_start_at: type: string format: date-time - readOnly: true - trigger: - type: object - additionalProperties: {} - readOnly: true job: type: object additionalProperties: {} - readOnly: true environment: type: object additionalProperties: {} - readOnly: true - run_steps: - type: array - items: {} - readOnly: true - default: [] status_humanized: type: string - readOnly: true in_progress: type: boolean - readOnly: true is_complete: type: boolean - readOnly: true is_success: type: boolean - readOnly: true is_error: type: boolean - readOnly: true is_cancelled: type: boolean - readOnly: true duration: type: string - readOnly: true queued_duration: type: string - readOnly: true run_duration: type: string - readOnly: true duration_humanized: type: string - readOnly: true queued_duration_humanized: type: string - readOnly: true run_duration_humanized: type: string - readOnly: true created_at_humanized: type: string - readOnly: true finished_at_humanized: type: string - readOnly: true + retrying_run_id: + type: integer + can_retry: + type: boolean + retry_not_supported_reason: + $ref: '#/components/schemas/RetryNotSupportedReasonEnum' job_id: type: integer - readOnly: true is_running: type: boolean + href: + type: string + required: + - created_at + - updated_at + RunResponseEnveloped: + type: object + properties: + data: + $ref: '#/components/schemas/RunResponse' + status: + $ref: '#/components/schemas/Status' + required: + - data + - status + RunStep: + type: object + properties: + id: + type: integer + run_id: + type: integer + account_id: + type: integer + index: + type: integer + status: + type: integer + name: + type: string + logs: + type: string + debug_logs: + type: string + log_location: + allOf: + - $ref: '#/components/schemas/LogLocationEnum' + default: db + log_path: + type: string + debug_log_path: + type: string + log_archive_type: + type: string + default: db_flushed + truncated_debug_logs: + type: string + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + updated_at: + type: string + format: date-time + readOnly: true + started_at: + type: string + format: date-time + readOnly: true + finished_at: + type: string + format: date-time + readOnly: true + status_color: + type: string + readOnly: true + status_humanized: + type: string + readOnly: true + duration: + type: string + readOnly: true + duration_humanized: + type: string + readOnly: true required: - created_at - - created_at_humanized - - dequeued_at - duration - duration_humanized - - environment - finished_at - - finished_at_humanized - - in_progress - - is_cancelled - - is_complete - - is_error - - is_success - - job - - job_id - - last_checked_at - - last_heartbeat_at - - queued_duration - - queued_duration_humanized - - run_duration - - run_duration_humanized - - run_steps - - should_start_at - started_at + - status_color - status_humanized - - trigger + - truncated_debug_logs - updated_at - RunEnveloped: + RunStepEnveloped: type: object properties: data: - $ref: '#/components/schemas/Run' + $ref: '#/components/schemas/RunStep' status: $ref: '#/components/schemas/Status' required: diff --git a/openapi-v3.yaml b/openapi-v3.yaml index 539b99d..9e6cdb2 100644 --- a/openapi-v3.yaml +++ b/openapi-v3.yaml @@ -2514,6 +2514,205 @@ paths: responses: '204': description: No response body + /api/v3/accounts/{account_id}/projects/{project_id}/extended-attributes/: + post: + operationId: Create Projects Extended Attribute + description: Create a new Extended Attributes record. + parameters: + - in: path + name: account_id + schema: + type: integer + required: true + - in: path + name: project_id + schema: + type: integer + required: true + tags: + - Projects Extended Attributes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExtendedAttributesRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/ExtendedAttributesRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/ExtendedAttributesRequest' + required: true + security: + - BearerAuthentication: [] + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExtendedAttributesEnveloped' + description: '' + /api/v3/accounts/{account_id}/projects/{project_id}/extended-attributes/{id}/: + get: + operationId: Retrieve Projects Extended Attribute + description: 'Given an account_id, project_id, and primary key: retrieve an + existing Extended Attributes record.' + parameters: + - in: path + name: account_id + schema: + type: integer + required: true + - in: query + name: account_id + schema: + type: integer + - in: path + name: id + schema: + type: integer + required: true + - in: query + name: pk + schema: + type: integer + - in: path + name: project_id + schema: + type: integer + required: true + - in: query + name: project_id + schema: + type: integer + - in: query + name: project_id__in + schema: + type: array + - in: query + name: state + schema: + type: integer + tags: + - Projects Extended Attributes + security: + - BearerAuthentication: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtendedAttributesEnveloped' + description: '' + patch: + operationId: Partial Update Projects Extended Attribute + description: Update an existing Extended Attributes record. + parameters: + - in: path + name: account_id + schema: + type: integer + required: true + - in: query + name: account_id + schema: + type: integer + - in: path + name: id + schema: + type: integer + required: true + - in: query + name: pk + schema: + type: integer + - in: path + name: project_id + schema: + type: integer + required: true + - in: query + name: project_id + schema: + type: integer + - in: query + name: project_id__in + schema: + type: array + - in: query + name: state + schema: + type: integer + tags: + - Projects Extended Attributes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedExtendedAttributesRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedExtendedAttributesRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedExtendedAttributesRequest' + security: + - BearerAuthentication: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtendedAttributesEnveloped' + description: '' + delete: + operationId: Destroy Projects Extended Attribute + description: Delete an existing Extended Attributes record. + parameters: + - in: path + name: account_id + schema: + type: integer + required: true + - in: query + name: account_id + schema: + type: integer + - in: path + name: id + schema: + type: integer + required: true + - in: query + name: pk + schema: + type: integer + - in: path + name: project_id + schema: + type: integer + required: true + - in: query + name: project_id + schema: + type: integer + - in: query + name: project_id__in + schema: + type: array + - in: query + name: state + schema: + type: integer + tags: + - Projects Extended Attributes + security: + - BearerAuthentication: [] + responses: + '204': + description: No response body /api/v3/accounts/{account_id}/projects/{project_id}/group-permissions/: post: operationId: Assign Project Group Permissions @@ -4669,6 +4868,63 @@ components: required: - data - status + ExtendedAttributes: + type: object + properties: + id: + type: integer + account_id: + type: integer + project_id: + type: integer + extended_attributes: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + readOnly: true + updated_at: + type: string + format: date-time + readOnly: true + state: + type: integer + default: 1 + required: + - created_at + - updated_at + ExtendedAttributesEnveloped: + type: object + properties: + data: + $ref: '#/components/schemas/ExtendedAttributes' + status: + $ref: '#/components/schemas/Status' + required: + - data + - status + ExtendedAttributesRequest: + type: object + properties: + id: + type: integer + account_id: + type: integer + project_id: + type: integer + extended_attributes: + type: object + additionalProperties: {} + state: + type: integer + default: 1 + description: A value of 1 means this entity is active and a value of 2 means + this entity is deleted + required: + - account_id + - extended_attributes + - project_id Filters: type: object properties: @@ -5137,6 +5393,23 @@ components: required: - filters - pagination + PatchedExtendedAttributesRequest: + type: object + properties: + id: + type: integer + account_id: + type: integer + project_id: + type: integer + extended_attributes: + type: object + additionalProperties: {} + state: + type: integer + default: 1 + description: A value of 1 means this entity is active and a value of 2 means + this entity is deleted PatchedSemanticLayerCredentialsRequest: type: object properties: From 66cf4c69c11d698579cd0836bfd0bc183d88c08b Mon Sep 17 00:00:00 2001 From: ericbaumann <24817191+ericbaumann@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:51:03 -0500 Subject: [PATCH 2/2] update naming --- openapi-v3.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openapi-v3.yaml b/openapi-v3.yaml index 9e6cdb2..9eea362 100644 --- a/openapi-v3.yaml +++ b/openapi-v3.yaml @@ -2516,7 +2516,7 @@ paths: description: No response body /api/v3/accounts/{account_id}/projects/{project_id}/extended-attributes/: post: - operationId: Create Projects Extended Attribute + operationId: Create Extended Attributes description: Create a new Extended Attributes record. parameters: - in: path @@ -2530,7 +2530,7 @@ paths: type: integer required: true tags: - - Projects Extended Attributes + - Extended Attributes requestBody: content: application/json: @@ -2556,7 +2556,7 @@ paths: description: '' /api/v3/accounts/{account_id}/projects/{project_id}/extended-attributes/{id}/: get: - operationId: Retrieve Projects Extended Attribute + operationId: Retrieve Extended Attributes description: 'Given an account_id, project_id, and primary key: retrieve an existing Extended Attributes record.' parameters: @@ -2596,7 +2596,7 @@ paths: schema: type: integer tags: - - Projects Extended Attributes + - Extended Attributes security: - BearerAuthentication: [] responses: @@ -2607,7 +2607,7 @@ paths: $ref: '#/components/schemas/ExtendedAttributesEnveloped' description: '' patch: - operationId: Partial Update Projects Extended Attribute + operationId: Partial Update Extended Attributes description: Update an existing Extended Attributes record. parameters: - in: path @@ -2646,7 +2646,7 @@ paths: schema: type: integer tags: - - Projects Extended Attributes + - Extended Attributes requestBody: content: application/json: @@ -2668,7 +2668,7 @@ paths: $ref: '#/components/schemas/ExtendedAttributesEnveloped' description: '' delete: - operationId: Destroy Projects Extended Attribute + operationId: Destroy Extended Attributes description: Delete an existing Extended Attributes record. parameters: - in: path @@ -2707,7 +2707,7 @@ paths: schema: type: integer tags: - - Projects Extended Attributes + - Extended Attributes security: - BearerAuthentication: [] responses: