From c7d43794b104636411fe10d6ae72548a8432cb43 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 12:32:13 +0530 Subject: [PATCH 01/27] response to metrics --- cldthrd_api.yaml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index c6b7761..76d15eb 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -62,6 +62,9 @@ paths: responses: 200: description: success + content: + application/json: + $ref: '#/components/schemas/GetCostViewPayload' /unit/metric/{metric_id}: get: @@ -79,6 +82,9 @@ paths: responses: 200: description: success + content: + application/json: + $ref: '#/components/schemas/GetUnitMetricPayload' components: securitySchemes: @@ -226,3 +232,55 @@ components: type: string event_url: type: string + + GetCostViewPayload: + properties: + data: + type: array + items: + $ref: '#/components/schemas/GetCostViewDataPoint' + + GetCostViewDataPoint: + properties: + current_timeframe_cost: + type: float + previous_timeframe_cost: + type: float + pop_diff: + type: float + pop_chnage: + type: float + date: + type: string + + GetUnitMetricPayload: + properties: + data: + type: array + items: + $ref: '#/components/schemas/GetCostMetricDataPoint' + + GetUnitMetricDataPoint: + properties: + current_timeframe_denominator: + type: float + current_timeframe_numerator: + type: float + current_timeframe_unit_metric: + type: float + previous_timeframe_denominator: + type: float + previous_timeframe_numerator: + type: float + previous_timeframe_unit_metric: + type: float + pop_diff: + type: float + pop_chnage: + type: float + date: + type: string + d_agg_func: + type: string + n_agg_func: + type: string From 03b2c78e95004827d99053bd0b7ac79ffd90904c Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 12:42:03 +0530 Subject: [PATCH 02/27] bug fix --- cldthrd_api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 76d15eb..f16823a 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -258,7 +258,7 @@ components: data: type: array items: - $ref: '#/components/schemas/GetCostMetricDataPoint' + $ref: '#/components/schemas/GetUnitMetricDataPoint' GetUnitMetricDataPoint: properties: From f79f1eb9f879466332a1f66700393b9f4d5f6ec7 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 12:44:40 +0530 Subject: [PATCH 03/27] bug fix --- cldthrd_api.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index f16823a..4c43c79 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -64,7 +64,8 @@ paths: description: success content: application/json: - $ref: '#/components/schemas/GetCostViewPayload' + schema: + $ref: '#/components/schemas/GetCostViewPayload' /unit/metric/{metric_id}: get: @@ -84,7 +85,8 @@ paths: description: success content: application/json: - $ref: '#/components/schemas/GetUnitMetricPayload' + schema: + $ref: '#/components/schemas/GetUnitMetricPayload' components: securitySchemes: From bd8934193304804de449fbedaa3079615b1026c0 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 12:50:47 +0530 Subject: [PATCH 04/27] final change --- cldthrd_api.yaml | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 4c43c79..653fbc5 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -61,7 +61,7 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: success + description: metric data content: application/json: schema: @@ -82,7 +82,7 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: success + description: metric data content: application/json: schema: @@ -245,13 +245,17 @@ components: GetCostViewDataPoint: properties: current_timeframe_cost: - type: float + type: number + format: float previous_timeframe_cost: - type: float + type: number + format: float pop_diff: - type: float + type: number + format: float pop_chnage: - type: float + type: number + format: float date: type: string @@ -265,21 +269,29 @@ components: GetUnitMetricDataPoint: properties: current_timeframe_denominator: - type: float + type: number + format: float current_timeframe_numerator: - type: float + type: number + format: float current_timeframe_unit_metric: - type: float + type: number + format: float previous_timeframe_denominator: - type: float + type: number + format: float previous_timeframe_numerator: - type: float + type: number + format: float previous_timeframe_unit_metric: - type: float + type: number + format: float pop_diff: - type: float + type: number + format: float pop_chnage: - type: float + type: number + format: float date: type: string d_agg_func: From adc90e477df179e2fa9dc1b5087e965049227b64 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 13:01:13 +0530 Subject: [PATCH 05/27] adding tagging --- cldthrd_api.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 653fbc5..6e917ac 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -44,7 +44,11 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: success + description: metric data + content: + application/json: + schema: + $ref: '#/components/schemas/GetTagsPayload' /cost/metric/{metric_id}: get: @@ -235,6 +239,13 @@ components: event_url: type: string + GetTagsPayload: + properties: + tags: + type: object + additionalProperties: + type: string + GetCostViewPayload: properties: data: From f12004699ac37f46c502def4c74620ce51ef33e0 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:10:57 +0530 Subject: [PATCH 06/27] small change --- cldthrd_api.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 6e917ac..6f56065 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -269,6 +269,8 @@ components: format: float date: type: string + agg_func: + type: string GetUnitMetricPayload: properties: From 90c744c8ffef880a2fe6a9922b6a54e772808f90 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:27:44 +0530 Subject: [PATCH 07/27] fixing typo --- cldthrd_api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 6f56065..354264a 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -264,7 +264,7 @@ components: pop_diff: type: number format: float - pop_chnage: + pop_change: type: number format: float date: @@ -302,7 +302,7 @@ components: pop_diff: type: number format: float - pop_chnage: + pop_change: type: number format: float date: From ffde2b86518acb9d8399eb51986657c005022f7b Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:30:46 +0530 Subject: [PATCH 08/27] undo issue --- cldthrd_api.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 354264a..73e5f02 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -44,7 +44,7 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: metric data + description: tag data content: application/json: schema: @@ -269,8 +269,6 @@ components: format: float date: type: string - agg_func: - type: string GetUnitMetricPayload: properties: From d3195569543ed011330e20a3fe42f68eab865283 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:33:39 +0530 Subject: [PATCH 09/27] final try --- cldthrd_api.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 73e5f02..0c36e4b 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -269,6 +269,8 @@ components: format: float date: type: string + agg_func: + type: string GetUnitMetricPayload: properties: From f7da8b31d7b19edccd2b0570fefcc1e56f062091 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:39:18 +0530 Subject: [PATCH 10/27] final attempt --- cldthrd_api.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 0c36e4b..3ed41c5 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -267,10 +267,10 @@ components: pop_change: type: number format: float - date: - type: string agg_func: type: string + date: + type: string GetUnitMetricPayload: properties: @@ -305,9 +305,9 @@ components: pop_change: type: number format: float - date: - type: string d_agg_func: type: string n_agg_func: type: string + date: + type: string From f72120b88628b5f456221639b9887b46185736a4 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:51:59 +0530 Subject: [PATCH 11/27] Can't fix --- cldthrd_api.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 3ed41c5..555767d 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -267,8 +267,6 @@ components: pop_change: type: number format: float - agg_func: - type: string date: type: string From aa2f6948cf0266dc11803fcdb06a4928fb4488e3 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 14:56:03 +0530 Subject: [PATCH 12/27] undo change --- cldthrd_api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 555767d..73e5f02 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -303,9 +303,9 @@ components: pop_change: type: number format: float + date: + type: string d_agg_func: type: string n_agg_func: type: string - date: - type: string From 9c5ff491ff5cb87b27685d1e41bab69d68a4f1e6 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Wed, 8 Mar 2023 15:05:31 +0530 Subject: [PATCH 13/27] last try --- cldthrd_api.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 73e5f02..0c36e4b 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -269,6 +269,8 @@ components: format: float date: type: string + agg_func: + type: string GetUnitMetricPayload: properties: From f48e2e3ebdb4e21fbde84e8db62cf3c636e49ba5 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 11:45:18 -0700 Subject: [PATCH 14/27] teams --- cldthrd_api.yaml | 338 ++++++++++++++++++++++++++++++- reference/api-reference/teams.md | 38 ++++ 2 files changed, 371 insertions(+), 5 deletions(-) create mode 100644 reference/api-reference/teams.md diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 0c36e4b..10fef70 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -92,6 +92,132 @@ paths: schema: $ref: '#/components/schemas/GetUnitMetricPayload' + /users: + get: + operationId: get_users + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: list of users + content: + application/json: + schema: + $ref: '#/components/schemas/GetUsersResponse' + /teams: + get: + operationId: get_teams_within_org + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: get teams + content: + application/json: + schema: + $ref: '#/components/schemas/GetTeamsResponse' + + post: + operationId: create_team + requestBody: + $ref: '#/components/requestBodies/CreateTeam' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: create team + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + 400: + description: validation error + 404: + description: slack integration or slack channel not found + + /teams/{team_id}: + get: + operationId: get_team_within_org + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: get team + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + patch: + operationId: update_team + requestBody: + $ref: '#/components/requestBodies/CreateTeam' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: updated + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + 400: + description: validation error + 404: + description: slack integration/slack channel not found/team not found + + delete: + operationId: delete_team + security: + - ApiKeyAuth: [ ] + responses: + 204: + description: deleted + 404: + description: team not found + + /teams/{team_id}/members: + get: + operationId: get_team_members + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: list of team members + content: + application/json: + schema: + $ref: '#/components/schemas/GetUsersResponse' + + /teams/{team_id}/members/assign: + post: + operationId: assign_users_to_team + requestBody: + $ref: '#/components/requestBodies/AssignUsersToTeam' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: list of team members + content: + application/json: + schema: + $ref: '#/components/schemas/GetUsersResponse' + + /teams/{team_id}/members/delete: + post: + operationId: assign_users_to_team + requestBody: + $ref: '#/components/requestBodies/RemoveUsersFromTeam' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: list of team members + content: + application/json: + schema: + $ref: '#/components/schemas/GetUsersResponse' + components: securitySchemes: ApiKeyAuth: @@ -114,7 +240,15 @@ components: description: Cost View or Unit Metric ID required: true schema: - type: in + type: string + + TeamID: + name: team_id + in: path + description: team id + required: true + schema: + type: string StartDate: name: start_date @@ -179,6 +313,36 @@ components: schema: $ref: '#/components/schemas/CreateEvents' + CreateTeam: + description: create team + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTeamRequest' + + AssignUsersToTeam: + description: assign users to team + content: + application/json: + schema: + properties: + users_ids: + type: array + items: + type: string + + RemoveUsersFromTeam: + description: remove users from team + content: + application/json: + schema: + properties: + users_ids: + type: array + items: + type: string + + schemas: StreamData: description: stream data @@ -269,8 +433,6 @@ components: format: float date: type: string - agg_func: - type: string GetUnitMetricPayload: properties: @@ -305,9 +467,175 @@ components: pop_change: type: number format: float - date: - type: string d_agg_func: type: string n_agg_func: type: string + date: + type: string + + User: + properties: + id: + type: string + email: + type: string + name: + type: string + + GetUsersResponse: + type: array + items: + $ref: '#/components/schemas/User' + + + CreateTeamRequest: + properties: + id: + type: string + name: + type: string + slack_channel: + type: string + aws_account_ids: + type: array + items: + type: string + aws_bill_payer_account_ids: + type: array + items: + type: string + aws_region_names: + type: array + items: + type: string + aws_services: + type: array + items: + type: string + aws_tags: + type: array + items: + type: object + aws_account_tags: + type: array + items: + type: object + gcp_project_names: + type: array + items: + type: string + gcp_billing_account_ids: + type: array + items: + type: string + gcp_sku_ids: + type: array + items: + type: string + gcp_locations: + type: array + items: + type: string + gcp_services: + type: array + items: + type: string + gcp_labels: + type: array + items: + type: object + custom_stream_tokens: + type: array + items: + type: string + custom_metric_names: + type: array + items: + type: string + custom_dimensions: + type: array + items: + type: object + opportunity_priorities: + type: array + items: + type: integer + + TeamResponse: + properties: + id: + type: string + name: + type: string + slack_channel: + type: string + aws_account_ids: + type: array + items: + type: string + aws_bill_payer_account_ids: + type: array + items: + type: string + aws_region_names: + type: array + items: + type: string + aws_services: + type: array + items: + type: string + aws_tags: + type: array + items: + type: object + aws_account_tags: + type: array + items: + type: object + gcp_project_names: + type: array + items: + type: string + gcp_billing_account_ids: + type: array + items: + type: string + gcp_sku_ids: + type: array + items: + type: string + gcp_locations: + type: array + items: + type: string + gcp_services: + type: array + items: + type: string + gcp_labels: + type: array + items: + type: object + custom_stream_tokens: + type: array + items: + type: string + custom_metric_names: + type: array + items: + type: string + custom_dimensions: + type: array + items: + type: object + opportunity_priorities: + type: array + items: + type: integer + + GetTeamsResponse: + type: array + items: + $ref: '#/components/schemas/TeamResponse' diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md new file mode 100644 index 0000000..2c0edda --- /dev/null +++ b/reference/api-reference/teams.md @@ -0,0 +1,38 @@ +# Teams + +You can create, edit, and delete Teams via Cloudthread's API. + +## Team POST + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams" method="post" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Team PATCH + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="patch" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Team Delete + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="delete" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Team GET + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Teams GET + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + + +{% hint style="info" %} +**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. +{% endhint %} From f76443c0cb88b7bc9e14f6936297f316c0f02e44 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 11:48:03 -0700 Subject: [PATCH 15/27] users --- cldthrd_api.yaml | 1 + reference/api-reference/teams.md | 18 ++++++++++++++++++ reference/api-reference/users.md | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 reference/api-reference/users.md diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 10fef70..9c624ed 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -104,6 +104,7 @@ paths: application/json: schema: $ref: '#/components/schemas/GetUsersResponse' + /teams: get: operationId: get_teams_within_org diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md index 2c0edda..e42da24 100644 --- a/reference/api-reference/teams.md +++ b/reference/api-reference/teams.md @@ -32,6 +32,24 @@ You can create, edit, and delete Teams via Cloudthread's API. [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} +## Teams Assign Members + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/assign" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Teams Remove Members + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/delete" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + +## Teams GET Members + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + {% hint style="info" %} **Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. diff --git a/reference/api-reference/users.md b/reference/api-reference/users.md new file mode 100644 index 0000000..fb4b187 --- /dev/null +++ b/reference/api-reference/users.md @@ -0,0 +1,14 @@ +# Users + +You can fetch all users from the Cloudthread API to assign team members. + +## Users GET + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/users" method="get" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} + + +{% hint style="info" %} +**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. +{% endhint %} From 363f62f67146ba9c071710c548c495d7abd9c148 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 11:55:44 -0700 Subject: [PATCH 16/27] Adding to summary --- SUMMARY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SUMMARY.md b/SUMMARY.md index 2d1105d..c56a64e 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -9,3 +9,5 @@ * [Events Overlay Ingestion](reference/api-reference/events.md) * [Tag Catalog Fetch](reference/api-reference/tag_catalog.md) * [Metric Fetch](reference/api-reference/metrics.md) + * [Teams(reference/api-reference/teams.md) + * [Users(reference/api-reference/users.md) From fae96b790f2548dcd5a1f4fb8b616119c4af1b1a Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 12:01:16 -0700 Subject: [PATCH 17/27] fix --- SUMMARY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SUMMARY.md b/SUMMARY.md index c56a64e..8f399e1 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -9,5 +9,5 @@ * [Events Overlay Ingestion](reference/api-reference/events.md) * [Tag Catalog Fetch](reference/api-reference/tag_catalog.md) * [Metric Fetch](reference/api-reference/metrics.md) - * [Teams(reference/api-reference/teams.md) - * [Users(reference/api-reference/users.md) + * [Teams](reference/api-reference/teams.md) + * [Users](reference/api-reference/users.md) From b449b4cf4163eb203e8d6f12384f7c9c61b3ae82 Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 12:03:06 -0700 Subject: [PATCH 18/27] fixing --- reference/api-reference/teams.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md index e42da24..f4ed533 100644 --- a/reference/api-reference/teams.md +++ b/reference/api-reference/teams.md @@ -34,13 +34,13 @@ You can create, edit, and delete Teams via Cloudthread's API. ## Teams Assign Members -{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/assign" method="get" %} +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/assign" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} ## Teams Remove Members -{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/delete" method="get" %} +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/delete" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} From cfd53a2b70c11097eae531c96863d5823f1d068b Mon Sep 17 00:00:00 2001 From: Thomas Yopes Date: Tue, 1 Aug 2023 13:49:59 -0700 Subject: [PATCH 19/27] fix --- reference/api-reference/teams.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md index f4ed533..df5d922 100644 --- a/reference/api-reference/teams.md +++ b/reference/api-reference/teams.md @@ -34,13 +34,13 @@ You can create, edit, and delete Teams via Cloudthread's API. ## Teams Assign Members -{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/assign" method="post" %} +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members/assign" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} ## Teams Remove Members -{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="teams/{team_id}/members/delete" method="post" %} +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members/delete" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} From 1d541ed5789741a0f332a63e32b82a34a096eecb Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Tue, 8 Aug 2023 03:59:13 +0000 Subject: [PATCH 20/27] =?UTF-8?q?GITBOOK-8:=20API=20docs=20refresh=20=20?= =?UTF-8?q?=E2=80=93=20Aug=202023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitbook/assets/api.yaml | 1282 ++++++++++++++++++++++++ SUMMARY.md | 5 +- reference/api-reference/README.md | 31 +- reference/api-reference/metrics.md | 8 +- reference/api-reference/savings-hub.md | 7 + reference/api-reference/teams.md | 15 +- 6 files changed, 1334 insertions(+), 14 deletions(-) create mode 100644 .gitbook/assets/api.yaml create mode 100644 reference/api-reference/savings-hub.md diff --git a/.gitbook/assets/api.yaml b/.gitbook/assets/api.yaml new file mode 100644 index 0000000..5578215 --- /dev/null +++ b/.gitbook/assets/api.yaml @@ -0,0 +1,1282 @@ +openapi: 3.0.3 +info: + version: 0.0.1 + title: Cloudthread backend +servers: + - url: 'https://api.core.{environment}.cloudthread.io/' + description: cloudthread.io + variables: + environment: + enum: + - development + - production + default: development + - url: 'http://localhost:{port}' + description: Local API Server + variables: + port: + default: '3000' +paths: + /ping: + get: + operationId: ping + summary: Just ping + tags: + - Monitoring + responses: + 200: + description: OK + + /user: + get: + operationId: getUser + summary: Get user profile + description: This method returns authorized user profile + tags: + - Users + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/User' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + patch: + operationId: updateUser + summary: Change user profile + description: Change user profile details + tags: + - Users + security: + - tokenAuth: [ ] + requestBody: + $ref: '#/components/requestBodies/User' + responses: + 200: + $ref: '#/components/responses/User' + 400: + $ref: '#/components/responses/BadRequest' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /organizations: + post: + operationId: createOrganization + summary: Create organization + description: Create organization + tags: + - Organizations + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/Organizations' + 400: + $ref: '#/components/responses/BadRequest' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /signin: + post: + operationId: signin + summary: Application sign in + description: Application sign in with email and password + tags: + - Auth + requestBody: + $ref: '#/components/requestBodies/SignIn' + responses: + 204: + $ref: '#/components/responses/AuthSuccessful' + 500: + description: internal server error + + /signout: + get: + operationId: signout + summary: User sign out + tags: + - Auth + security: + - tokenAuth: [ ] + responses: + 204: + description: Logout user + headers: + Set-Cookie: + description: Delete token + schema: + type: string + example: token=; Path=/; Domain=app.cloudthread.io; Expires=; + 500: + description: internal server error + + /signup: + post: + operationId: signup + summary: Register + description: Register with user details + tags: + - Auth + requestBody: + $ref: '#/components/requestBodies/SignUp' + responses: + 204: + $ref: '#/components/responses/AuthSuccessful' + 500: + description: internal server error + + /signin/google: + get: + operationId: signinGoogle + summary: Google social login + description: Redirect to Google social_login dialog + tags: + - Auth + responses: + 302: + $ref: '#/components/responses/AuthDialog' + 500: + description: internal server error + + /signin/google/callback: + get: + operationId: signinGoogleCallback + summary: Processing callback + description: Processing callback + tags: + - Auth + parameters: + - $ref: '#/components/parameters/SocialServiceAuthCode' + responses: + 200: + $ref: '#/components/responses/AuthSuccessful' + 500: + description: internal server error + + /signin/github: + get: + operationId: signinGithub + summary: Github social_login + description: Redirect to Github social_login dialog + tags: + - Auth + responses: + 302: + $ref: '#/components/responses/AuthDialog' + 500: + description: internal server error + + /signin/github/callback: + get: + operationId: signinGithubCallback + summary: Processing callback + description: Processing callback + tags: + - Auth + parameters: + - $ref: '#/components/parameters/SocialServiceAuthCode' + responses: + 200: + $ref: '#/components/responses/AuthSuccessful' + 500: + description: internal server error + + /email/verify: + get: + operationId: emailVerify + summary: Verify email + description: Processing callback + tags: + - Auth + parameters: + - $ref: '#/components/parameters/VerificationToken' + responses: + 204: + $ref: '#/components/responses/VerificationSuccessful' + 500: + description: internal server error + + /configs/datacollector: + get: + operationId: dataCollectionConfigs + summary: Get user organization data collection configs + description: This method returns all data collection configs for the organization the user owns based on query params + tags: + - Data Collection + parameters: + - $ref: '#/components/parameters/DataSourceId' + - $ref: '#/components/parameters/DataCollectionCadence' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollections' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + post: + operationId: dataCollectionConfigsCreate + summary: Create data collection config for user organization + description: This method creates a data collection config for the organization the user owns + tags: + - Data Collection + requestBody: + $ref: '#/components/requestBodies/DataCollection' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /configs/datacollector/{config_id:\d+}: + get: + operationId: dataCollectionConfig + summary: Get user organization data collection config + description: This method returns a single config for the organization the user owns based on config_id + tags: + - Data Collection + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + patch: + operationId: dataCollectionConfigsUpdate + summary: Update data collection config for user organization + description: This method updates a data collection config for the organization the user owns based on config_id + tags: + - Data Collection + requestBody: + $ref: '#/components/requestBodies/DataCollection' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + + /internal/dataconfigs: + get: + operationId: adminDataCollectionConfigs + summary: Get data collection configs + description: This method returns all data collection configs based on query params + tags: + - Data Collection + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/DataSourceId' + - $ref: '#/components/parameters/DataCollectionCadence' + security: + - adminAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollections' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + post: + operationId: adminDataCollectionConfigsCreate + summary: Create data collection config + description: This method creates a data collection config + tags: + - Data Collection + requestBody: + $ref: '#/components/requestBodies/AdminDataCollection' + security: + - adminAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /internal/dataconfigs/{config_id:\d+}: + get: + operationId: adminDataCollectionConfig + summary: Get data collection config + description: This method returns a single config based on config_id + tags: + - Data Collection + security: + - adminAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + patch: + operationId: adminDataCollectionConfigUpdate + summary: Update data collection config + description: This method updates a data collection config based on config_id + tags: + - Data Collection + requestBody: + $ref: '#/components/requestBodies/DataCollection' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/DataCollection' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /configs/report: + get: + operationId: reportConfigs + summary: Get user organization report configs + description: This method returns all report configs for the organization the user owns based on query params + tags: + - Reports + parameters: + - $ref: '#/components/parameters/OwnerId' + - $ref: '#/components/parameters/ReportTypeId' + - $ref: '#/components/parameters/ReportCadence' + - $ref: '#/components/parameters/ReportName' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/Reports' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + post: + operationId: reportConfigsCreate + summary: Create report config for user organization + description: This method creates a report config for the organization the user owns + tags: + - Reports + requestBody: + $ref: '#/components/requestBodies/Report' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/Report' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /configs/report/{config_id:\d+}: + get: + operationId: reportConfig + summary: Get user organization report config + description: This method returns a single config for the organization the user owns based on config_id + tags: + - Reports + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/ReportWithOwner' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + patch: + operationId: reportConfigUpdate + summary: Update report config for user organization + description: This method updates a report config for the organization the user owns based on config_id + tags: + - Reports + requestBody: + $ref: '#/components/requestBodies/Report' + security: + - tokenAuth: [ ] + responses: + 200: + $ref: '#/components/responses/Report' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /internal/reportconfigs: + get: + operationId: adminReportConfigs + summary: Get report configs + description: This method returns all report configs based on query params + tags: + - Reports + parameters: + - $ref: '#/components/parameters/OwnerId' + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ReportTypeId' + - $ref: '#/components/parameters/ReportCadence' + - $ref: '#/components/parameters/ReportName' + security: + - adminAuth: [ ] + responses: + 200: + $ref: '#/components/responses/Reports' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /internal/reportconfigs/{config_id:\d+}: + get: + operationId: adminReportConfig + summary: Get report config + description: This method returns a single config based on config_id + tags: + - Reports + security: + - adminAuth: [ ] + responses: + 200: + $ref: '#/components/responses/ReportWithOwner' + 401: + $ref: '#/components/responses/Unauthorized' + 500: + description: internal server error + + /metrics/unit: + post: + operationId: getUnitMetricFilter + summary: Get unit metric filter + description: Get unit metric by filter + tags: + - Metrics + parameters: + - $ref: '#/components/parameters/StartDate' + - $ref: '#/components/parameters/EndDate' + - $ref: '#/components/parameters/Granularity' + requestBody: + $ref: '#/components/requestBodies/UnitMetricFilter' + responses: + 200: + $ref: '#/components/responses/UnitMetricResponse' + 400: + $ref: '#/components/responses/BadRequest' + 500: + description: internal server error + get: + operationId: getUnitMetricFilters + summary: Get unit metric filters + description: Get unit metric filters + tags: + - Metrics + responses: + 200: + $ref: '#/components/responses/SavedUnitMetricFilters' + 500: + description: internal server error + + /metrics/cost: + post: + operationId: getCostMetric + summary: Get cost metric + description: Get cost metric by filter + tags: + - Metrics + parameters: + - $ref: '#/components/parameters/StartDate' + - $ref: '#/components/parameters/EndDate' + - $ref: '#/components/parameters/Granularity' + requestBody: + $ref: '#/components/requestBodies/CostMetricFilter' + responses: + 200: + $ref: '#/components/responses/CostMetricResponse' + 400: + $ref: '#/components/responses/BadRequest' + 500: + description: internal server error + + /metrics/unit/save: + post: + operationId: SavedUnitMetricFilter + summary: Save unit metric filter + description: Save unit metric filter + tags: + - Metrics + requestBody: + $ref: '#/components/requestBodies/SavedUnitMetricFilter' + responses: + 200: + $ref: '#/components/responses/MetricFilterResponse' + 400: + $ref: '#/components/responses/BadRequest' + 500: + description: internal server error + + /metrics/unit/{filter_id}: + post: + operationId: SavedUnitMetricFilter + summary: Save unit metric filter + description: Save unit metric filter + tags: + - Metrics + responses: + 200: + $ref: '#/components/responses/MetricFilterResponse' + 500: + description: internal server error + + /metrics/unit/constructor: + get: + operationId: getUnitMetricConstructor + summary: Get Unit Metric Constructor + description: Get resources for unit metric filter page + tags: + - Metrics + responses: + 200: + $ref: '#/components/responses/UnitMetricConstructor' + 500: + description: internal server error + + /metrics/cost/constructor: + get: + operationId: getCostMetricConstructor + summary: Get Cost Metric Constructor + description: Get resources for the page cost overview filters + tags: + - Metrics + responses: + 200: + $ref: '#/components/responses/CostMetricConstructor' + 500: + description: internal server error + +components: + responses: + User: + description: User profile + content: + application/json: + schema: + $ref: '#/components/schemas/User' + + DataCollection: + description: Data collection config + content: + application/json: + schema: + $ref: '#/components/schemas/DataCollection' + + DataCollections: + description: Data collection configs + content: + application/json: + schema: + $ref: '#/components/schemas/DataCollections' + + Organizations: + description: Organizations + content: + application/json: + schema: + $ref: '#/components/schemas/Organizations' + + Report: + description: Report + content: + application/json: + schema: + $ref: '#/components/schemas/Report' + + ReportWithOwner: + description: Report + content: + application/json: + schema: + $ref: '#/components/schemas/ReportWithOwner' + + Reports: + description: Reports + content: + application/json: + schema: + $ref: '#/components/schemas/Reports' + + Unauthorized: + description: Missing or invalid social_login token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + BadRequest: + description: Bad request body + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + AuthSuccessful: + description: OK + headers: + Set-Cookie: + description: Set social_login token + schema: + type: string + example: token={jwt_token}; Domain=localhost; HttpOnly; Max-Age=36000s; Path=/ + + VerificationSuccessful: + description: OK + + AuthDialog: + description: Auth dialog + headers: + Location: + description: Link to social_login dialog + schema: + type: string + format: uri + example: https://example.com/login/oauth/authorize?redirect_uri={redirect_uri}&client_id={client_id}&scope=public_profile,email + + UnitMetricResponse: + description: Data for chart + content: + application/json: + schema: + $ref: '#/components/schemas/UnitMetricResponse' + + CostMetricResponse: + description: Data for chart + content: + application/json: + schema: + $ref: '#/components/schemas/CostMetricResponse' + + MetricFilterResponse: + description: Saved filter + content: + application/json: + schema: + $ref: '#/components/schemas/SavedMetricFilter' + + SavedUnitMetricFilters: + description: Saved filters + content: + application/json: + schema: + $ref: '#/components/schemas/SavedUnitMetricFilters' + + CostMetricConstructor: + description: CUR resources for cost overview filters + content: + application/json: + schema: + $ref: '#/components/schemas/CURResources' + + UnitMetricConstructor: + description: Resources for unit metric filters page + content: + application/json: + schema: + $ref: '#/components/schemas/UnitMetricConstructor' + +# ------------------------- + + schemas: + User: + description: User profile + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + name: + type: string + example: John Doe + email: + type: string + format: email + example: john.doe@example.com + is_confirmed: + type: boolean + readOnly: true + is_active: + type: boolean + readOnly: true + + UserResponse: + description: User profile + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + name: + type: string + example: John Doe + email: + type: string + format: email + example: john.doe@example.com + + Organization: + description: organization + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + name: + type: string + example: Some LLC + owner_id: + type: integer + format: int64 + readOnly: true + example: 1234 + + OrganizationResponse: + description: organization + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + name: + type: string + example: Some LLC + + Organizations: + type: array + items: + $ref: '#/components/schemas/Organization' + + DataCollectionRequestBody: + description: Create data collection config + properties: + data_source_id: + type: string + example: AWSCUR + cadence: + type: string + example: daily + collection_details: + type: object + example: '{"aws_account_id": "1234"}' + + AdminDataCollectionRequestBody: + description: Create data collection config for Cloudthread Admin + properties: + organization_id: + type: integer + format: int64 + readOnly: true + example: 1234 + data_source_id: + type: string + example: AWSCUR + cadence: + type: string + example: daily + collection_details: + type: object + example: '{"aws_account_id": "1234"}' + + DataCollection: + description: Response data collection config + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + organization_id: + type: integer + format: int64 + readOnly: true + example: 1234 + data_source_id: + type: string + example: AWSCUR + cadence: + type: string + example: weekly + collection_details: + type: object + example: '{"aws_account_id": "1234"}' + + DataCollections: + type: array + items: + $ref: '#/components/schemas/DataCollection' + + ReportRequestBody: + description: Create report config + properties: + report_type_id: + type: string + example: GENERALCOST + cadence: + type: string + example: weekly + report_details: + type: object + example: '{"email_recipients": [x@y.com],}' + name: + type: string + example: Report 1 + + Report: + description: Response report config + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + owner_id: + type: integer + format: int64 + readOnly: true + example: 1234 + organization_id: + type: integer + format: int64 + readOnly: true + example: 1234 + report_type_id: + type: string + example: GENERALCOST + cadence: + type: string + example: weekly + report_details: + type: object + example: '{"email_recipients": [x@y.com],}' + name: + type: string + example: Report 1 + + ReportWithOwner: + description: Response report config + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1234 + owner: + type: object + $ref: '#/components/schemas/UserResponse' + organization: + type: object + $ref: '#/components/schemas/OrganizationResponse' + report_type_id: + type: string + example: GENERALCOST + cadence: + type: string + example: weekly + report_details: + type: object + example: '{"email_recipients": [x@y.com],}' + name: + type: string + example: Report 1 + + Reports: + type: array + items: + $ref: '#/components/schemas/ReportWithOwner' + + SocialLogin: + description: User's social account + properties: + id: + type: string + format: int64 + example: 1234 + provider: + $ref: '#/components/schemas/Provider' + + Provider: + type: string + enum: + - google + - github + + Error: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + required: + - code + + SignIn: + type: object + properties: + email: + type: string + password: + type: string + + SignUp: + type: object + properties: + email: + type: string + password: + type: string + name: + type: string + company_name: + type: string + + UnitMetricFilter: + type: object + properties: + numerator: + $ref: '#/components/schemas/MetricFilter' + denominator: + $ref: '#/components/schemas/MetricFilter' + + UnitMetricResponse: + type: object + properties: + metadata: + type: object + properties: + unit_metric: + $ref: '#/components/schemas/ChartData' + numerator: + $ref: '#/components/schemas/ChartData' + denominator: + $ref: '#/components/schemas/ChartData' + data: + type: array + items: + type: object + + MetricFilter: + type: object + properties: + operator: + type: string + conditions: + type: array + items: + type: object + + SavedUnitMetricFilter: + type: object + properties: + name: + type: string + filter: + $ref: '#/components/schemas/UnitMetricFilter' + id: + type: integer + owner_id: + type: integer + organization_id: + type: integer + + SavedUnitMetricFilters: + type: array + items: + $ref: '#/components/schemas/SavedUnitMetricFilter' + + CostMetricResponse: + type: object + properties: + metadata: + $ref: '#/components/schemas/ChartData' + data: + type: array + items: + type: object + + ChartData: + type: object + properties: + x_axis: + type: object + properties: + column: + type: string + granularity: + type: string + range: + type: array + items: + type: string + dimensions: + type: array + y_axis: + type: object + properties: + column: + type: string + range: + type: array + items: + type: string + + SavedMetricFilter: + type: object + properties: + id: + type: integer + filter: + $ref: '#/components/schemas/MetricFilter' + owner_id: + type: integer + name: + type: string + organization_id: + type: integer + + CURResources: + type: object + properties: + services: + type: array + items: + type: string + region_names: + type: array + items: + type: string + aws_account_ids: + type: array + items: + type: integer + tags: + type: array + items: + type: object + + CWResources: + type: object + properties: + region_names: + type: array + items: + type: string + aws_account_ids: + type: array + items: + type: integer + metrics: + type: object + tags: + type: array + items: + type: object + + UnitMetricConstructor: + type: object + properties: + numerator: + $ref: '#/components/schemas/CURResources' + denominator: + $ref: '#/components/schemas/CWResources' + +# ------------------------- + + requestBodies: + User: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + + DataCollection: + content: + application/json: + schema: + $ref: '#/components/schemas/DataCollectionRequestBody' + + AdminDataCollection: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDataCollectionRequestBody' + + Report: + content: + application/json: + schema: + $ref: '#/components/schemas/ReportRequestBody' + + SignIn: + content: + application/json: + schema: + $ref: '#/components/schemas/SignIn' + + SignUp: + content: + application/json: + schema: + $ref: '#/components/schemas/SignUp' + + UnitMetricFilter: + content: + application/json: + schema: + $ref: '#/components/schemas/UnitMetricFilter' + + SavedUnitMetricFilter: + content: + application/json: + schema: + $ref: '#/components/schemas/SavedUnitMetricFilter' + + CostMetricFilter: + content: + application/json: + schema: + $ref: '#/components/schemas/MetricFilter' + +# ------------------------- + + securitySchemes: + tokenAuth: + description: Auth token + type: apiKey + in: cookie + name: token + + adminAuth: + description: Admin token + type: apiKey + in: header + name: admin-token + +# ------------------------- + + parameters: + OrganizationId: + name: organization_id + in: query + description: Defined by DB + required: false + schema: + type: integer + + OwnerId: + name: owner_id + in: query + description: User id who owns object + required: false + schema: + type: integer + + DataSourceId: + name: data_source_id + in: query + description: Data source type + required: false + schema: + type: string + + DataCollectionCadence: + name: cadence + in: query + description: Data collection cadence + schema: + type: string + + ReportTypeId: + name: report_type_id + in: query + description: Report type + required: false + schema: + type: string + + ReportCadence: + name: cadence + in: query + description: Report cadence + required: false + schema: + type: string + + ReportName: + name: name + in: query + description: Report name + required: false + schema: + type: string + + SocialServiceAuthCode: + name: code + in: query + description: Received from social service + required: true + schema: + type: string + + VerificationToken: + name: token + in: query + description: Token that was sent to user's email + required: true + schema: + type: string + + StartDate: + name: start_date + in: query + description: Date from (incl) + required: false + schema: + type: string + + EndDate: + name: end_date + in: query + description: Date from (incl) + required: false + schema: + type: string + + Granularity: + name: granularity + in: query + description: Granularity + required: false + schema: + type: string diff --git a/SUMMARY.md b/SUMMARY.md index 8f399e1..4ea0f59 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -5,9 +5,10 @@ ## Reference * [API Reference](reference/api-reference/README.md) - * [Data Ingestion](reference/api-reference/custom_data.md) + * [Data Ingestion](reference/api-reference/custom\_data.md) * [Events Overlay Ingestion](reference/api-reference/events.md) - * [Tag Catalog Fetch](reference/api-reference/tag_catalog.md) + * [Tag Catalog Fetch](reference/api-reference/tag\_catalog.md) * [Metric Fetch](reference/api-reference/metrics.md) * [Teams](reference/api-reference/teams.md) * [Users](reference/api-reference/users.md) + * [Savings Hub](reference/api-reference/savings-hub.md) diff --git a/reference/api-reference/README.md b/reference/api-reference/README.md index d78b2ef..a287eb9 100644 --- a/reference/api-reference/README.md +++ b/reference/api-reference/README.md @@ -1,4 +1,4 @@ -# Quick Start +# API Reference Cloudthread provides a powerful and flexible REST Developer API to help you get the most out of your data. @@ -24,7 +24,9 @@ Cloudthread provides the ability to send custom data to our systems that can the In order to send custom data, you must provision a **Custom Data - Data Stream Token** on the Cloudthread platform within the **Settings** tab. -* [Data Ingestion](reference/api-reference/custom_data.md) +{% content-ref url="custom_data.md" %} +[custom\_data.md](custom\_data.md) +{% endcontent-ref %} Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab** on Cloudthread's platform. @@ -32,7 +34,9 @@ Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab* Cloudthread provides the ability to send webhook Events that can be overlayed on top of your Cost Views and Unit Metrics. -* [Events Overlay Ingestion](reference/api-reference/events.md) +{% content-ref url="events.md" %} +[events.md](events.md) +{% endcontent-ref %} Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab** on Cloudthread's platform. @@ -40,11 +44,26 @@ Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab* Cloudthread provides the ability to fetch a Tag Catalog entry via catalog key. -* [Tag Catalog Fetch](reference/api-reference/tag_catalog.md) - +{% content-ref url="tag_catalog.md" %} +[tag\_catalog.md](tag\_catalog.md) +{% endcontent-ref %} ## Cost View and Unit Metric Data Fetch Cloudthread provides the ability to fetch a Cost View and Unit Metric data. -* [Metric Fetch](reference/api-reference/metrics.md) +{% content-ref url="metrics.md" %} +[metrics.md](metrics.md) +{% endcontent-ref %} + +## Users and Teams setup + +API can be used to set up Users and Teams. + +{% content-ref url="users.md" %} +[users.md](users.md) +{% endcontent-ref %} + +{% content-ref url="teams.md" %} +[teams.md](teams.md) +{% endcontent-ref %} diff --git a/reference/api-reference/metrics.md b/reference/api-reference/metrics.md index 26b3b57..d747a5e 100644 --- a/reference/api-reference/metrics.md +++ b/reference/api-reference/metrics.md @@ -1,14 +1,14 @@ -# Metry Fetch +# Metric Fetch ## Cost View Fetch -Cloudthread provides the ability to query your Cost Views. +Cloudthread provides the ability to query your [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view). {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/cost/metric/{metric_id}" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -* `metric_id`: the ID of the Unit Metric you wish to query. +* `metric_id`: the ID of the Cost View you wish to query. To query Cost Views, use the endpoint above and the following query parameters @@ -19,7 +19,7 @@ If the data pass validation a `200` status code. ## Unit Metric Fetch -Cloudthread provides the ability to query your Unit Metrics. +Cloudthread provides the ability to query your [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric). {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/unit/metric/{metric_id}" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) diff --git a/reference/api-reference/savings-hub.md b/reference/api-reference/savings-hub.md new file mode 100644 index 0000000..f04f58d --- /dev/null +++ b/reference/api-reference/savings-hub.md @@ -0,0 +1,7 @@ +# Savings Hub + + + +You can interact with Savings Hub via API. + +\ diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md index df5d922..667e016 100644 --- a/reference/api-reference/teams.md +++ b/reference/api-reference/teams.md @@ -1,15 +1,27 @@ # Teams -You can create, edit, and delete Teams via Cloudthread's API. +Cloudthread platform allows for manipulation of [Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/teams "mention") via an API. + +{% hint style="info" %} +You can **create**, **edit**, and **delete** Teams via Cloudthread's API. +{% endhint %} + +{% hint style="info" %} +See [Setting up Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/guides/onboarding/setting-up-teams "mention") for a guide on setting up teams through the UI. +{% endhint %} ## Team POST +Creating new team. + {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} ## Team PATCH +Editing the team. + {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="patch" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} @@ -50,7 +62,6 @@ You can create, edit, and delete Teams via Cloudthread's API. [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} - {% hint style="info" %} **Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. {% endhint %} From 059fda0e195f0d3e6affb89a48870d97652d40c9 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Tue, 15 Aug 2023 11:53:47 -0700 Subject: [PATCH 21/27] Update cldthrd_api.yaml --- cldthrd_api.yaml | 112 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 9c624ed..efc0142 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -49,6 +49,21 @@ paths: application/json: schema: $ref: '#/components/schemas/GetTagsPayload' + + /cost-optimization/opportunities/list: + post: + operationId: get_opportunities + requestBody: + $ref: '#/components/requestBodies/GetOpportunitiesQuery' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: opportunities list + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpportunitiesResponse' /cost/metric/{metric_id}: get: @@ -104,7 +119,6 @@ paths: application/json: schema: $ref: '#/components/schemas/GetUsersResponse' - /teams: get: operationId: get_teams_within_org @@ -314,6 +328,13 @@ components: schema: $ref: '#/components/schemas/CreateEvents' + GetOpportunitiesQuery: + description: get opportunities payload + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpportunitiesQuery' + CreateTeam: description: create team content: @@ -375,6 +396,95 @@ components: custom_dimensions: type: object + GetOpportunitiesQuery: + properties: + opportunity_type_id: + type: string + status: + type: string + code_automation: + type: boolean + thread_id: + type: integer + account: + type: string + region: + type: string + service: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/Tags' + category: + type: string + record_id: + type: string + source: + type: string + github_pr_key: + type: string + secondary_id: + type: integer + last_detected_start_date: + type: string + format: date + last_detected_end_date: + type: string + format: date + status_updated_start_date: + type: string + format: date + status_updated_end_date: + type: string + format: date + details: + type: boolean + priority: + type: integer + + Tags: + properties: + Key: + type: string + Value: + type: string + + GetOpportunities: + properties: + id: + type: integer + source: + type: string + opportunity_details: + type: object + opportunity_type_id: + type: string + cost_impact: + type: number + record_id: + type: string + status_updated_at: + type: string + format: date-time + created_at: + type: string + format: date-time + status: + type: string + last_detected_at: + type: string + format: date-time + thread_id: + type: integer + github_pr_key: + type: string + + GetOpportunitiesResponse: + type: array + items: + $ref: '#/components/schemas/GetOpportunities' + CreateEvents: properties: data: From 755892559d9fa376c3b95a6fb4916fc996645754 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Tue, 15 Aug 2023 12:03:59 -0700 Subject: [PATCH 22/27] Update cldthrd_api.yaml --- cldthrd_api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index efc0142..418622d 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -2,8 +2,10 @@ openapi: 3.0.3 info: version: 0.0.1 title: Cloudthread API + servers: - url: 'https://api.cloudthread.io' + paths: /streams/ingest: post: @@ -364,7 +366,6 @@ components: items: type: string - schemas: StreamData: description: stream data @@ -599,7 +600,6 @@ components: items: $ref: '#/components/schemas/User' - CreateTeamRequest: properties: id: From d2ac66751063383e81f3d52b10fdb694ffbbf769 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Mon, 21 Aug 2023 16:50:59 -0700 Subject: [PATCH 23/27] API docs v 0.0.2 --- cldthrd_api.yaml | 455 +++++++++++++++++++++++++++++++---------------- 1 file changed, 304 insertions(+), 151 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 418622d..7dea5a5 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -1,75 +1,121 @@ openapi: 3.0.3 info: - version: 0.0.1 + version: 0.0.2 title: Cloudthread API + description: | + This API allows for interaction with Cloudthread cloud cost management Platform. + termsOfService: https://www.cloudthread.io/terms-of-use + contact: + email: hey@cloudthread.io servers: - url: 'https://api.cloudthread.io' +tags: + - name: streams + description: Data ingestion streams + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/custom_data + - name: events + description: Custom events that can be overlayed on top of your Cost Views and Unit Metrics + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/events + - name: tag-catalog + description: Tag catalog manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/tag_catalog + - name: cost-views + description: Cost Views manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/metrics#cost-view-fetch + - name: unit-metrics + description: Unit Metric manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/metrics#unit-metric-fetch + - name: users + description: Users manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/users + + - name: teams + description: Teams manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/teams + + - name: savings-opportunities + description: Savings Opportunities manipulation + externalDocs: + description: Find out more + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/savings-hub/opportunities + paths: /streams/ingest: post: + description: Ingests data into created Data Stream operationId: ingest_stream_data + tags: + - streams requestBody: $ref: '#/components/requestBodies/StreamData' security: - ApiKeyAuth: [] responses: 201: - description: created + description: Ingested successfully 400: - description: validation error + description: Validation error 404: - description: no stream found + description: No stream found /events: post: + description: Ingests the custom events data that can be overlayed on top of your Cost Views and Unit Metrics operationId: create_events + tags: + - events requestBody: $ref: '#/components/requestBodies/CreateEvents' security: - ApiKeyAuth: [ ] responses: 201: - description: created + description: Ingested successfully 400: - description: validation error + description: Validation error 404: - description: no team found + description: No team found /tag-catalog: get: + description: Fetches a Tag Catalog entry via catalog key operationId: get_tag_catalog + tags: + - tag-catalog parameters: - $ref: '#/components/parameters/CatalogKey' security: - ApiKeyAuth: [ ] responses: 200: - description: tag data - content: - application/json: - schema: - $ref: '#/components/schemas/GetTagsPayload' - - /cost-optimization/opportunities/list: - post: - operationId: get_opportunities - requestBody: - $ref: '#/components/requestBodies/GetOpportunitiesQuery' - security: - - ApiKeyAuth: [ ] - responses: - 200: - description: opportunities list + description: Tag catalog data content: application/json: schema: - $ref: '#/components/schemas/GetOpportunitiesResponse' + $ref: '#/components/schemas/GetTagCatalogPayload' /cost/metric/{metric_id}: get: + description: Returns cost data from Cloudthread Cost View operationId: get_cost_metric_filter_data + tags: + - cost-views parameters: - $ref: '#/components/parameters/MetricID' - $ref: '#/components/parameters/StartDate' @@ -82,7 +128,7 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: metric data + description: Metric data content: application/json: schema: @@ -90,7 +136,10 @@ paths: /unit/metric/{metric_id}: get: + description: Returns cost data from Cloudthread Unit Metric operationId: get_unit_metric_filter_data + tags: + - unit-metrics parameters: - $ref: '#/components/parameters/MetricID' - $ref: '#/components/parameters/StartDate' @@ -103,7 +152,7 @@ paths: - ApiKeyAuth: [ ] responses: 200: - description: metric data + description: Metric data content: application/json: schema: @@ -111,95 +160,117 @@ paths: /users: get: + description: Allows to return data on registered Users of Cloudthread platform operationId: get_users + tags: + - users security: - ApiKeyAuth: [ ] responses: 200: - description: list of users + description: List of users content: application/json: schema: $ref: '#/components/schemas/GetUsersResponse' + /teams: get: + description: Fetches list of Teams within the org operationId: get_teams_within_org + tags: + - teams security: - ApiKeyAuth: [ ] responses: 200: - description: get teams + description: List of teams content: application/json: schema: $ref: '#/components/schemas/GetTeamsResponse' post: + description: Creates new Team within the org operationId: create_team + tags: + - teams requestBody: $ref: '#/components/requestBodies/CreateTeam' security: - ApiKeyAuth: [ ] responses: 200: - description: create team + description: Team created successfully content: application/json: schema: $ref: '#/components/schemas/TeamResponse' 400: - description: validation error + description: Validation error 404: - description: slack integration or slack channel not found + description: Slack integration or Slack channel not found /teams/{team_id}: get: + description: Fetches data on a specific Team within the org operationId: get_team_within_org + tags: + - teams security: - ApiKeyAuth: [ ] responses: 200: - description: get team + description: Get team content: application/json: schema: $ref: '#/components/schemas/TeamResponse' patch: + description: Updates existing Team definition operationId: update_team + tags: + - teams requestBody: $ref: '#/components/requestBodies/CreateTeam' security: - ApiKeyAuth: [ ] responses: 200: - description: updated + description: Updated content: application/json: schema: $ref: '#/components/schemas/TeamResponse' 400: - description: validation error + description: Validation error 404: - description: slack integration/slack channel not found/team not found + description: Slack integration/slack channel not found/team not found delete: + description: Deletes existing Team operationId: delete_team + tags: + - teams security: - ApiKeyAuth: [ ] responses: 204: - description: deleted + description: Deleted 404: - description: team not found + description: Team not found /teams/{team_id}/members: get: operationId: get_team_members + description: Fetches list of members of specific Team + tags: + - teams security: - ApiKeyAuth: [ ] responses: 200: - description: list of team members + description: List of team members content: application/json: schema: @@ -208,13 +279,16 @@ paths: /teams/{team_id}/members/assign: post: operationId: assign_users_to_team + description: Adds new Users to specific Team + tags: + - teams requestBody: $ref: '#/components/requestBodies/AssignUsersToTeam' security: - ApiKeyAuth: [ ] responses: 200: - description: list of team members + description: List of team members content: application/json: schema: @@ -223,18 +297,39 @@ paths: /teams/{team_id}/members/delete: post: operationId: assign_users_to_team + description: Deletes Users from specific Team + tags: + - teams requestBody: $ref: '#/components/requestBodies/RemoveUsersFromTeam' security: - ApiKeyAuth: [ ] responses: 200: - description: list of team members + description: List of team members content: application/json: schema: $ref: '#/components/schemas/GetUsersResponse' + /cost-optimization/opportunities/list: + post: + operationId: get_opportunities + description: Fetches the list of savings opportunities + tags: + - savings-opportunities + requestBody: + $ref: '#/components/requestBodies/GetOpportunitiesQuery' + security: + - ApiKeyAuth: [ ] + responses: + 200: + description: List of savings opportunities + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpportunitiesResponse' + components: securitySchemes: ApiKeyAuth: @@ -250,7 +345,7 @@ components: required: true schema: type: string - + MetricID: name: metric_id in: path @@ -289,7 +384,9 @@ components: description: Cost Type or Cost Column ID required: false schema: - type: string or integer + oneOf: + - type: string + - type: integer Amortization: name: amortization @@ -305,7 +402,7 @@ components: description: Excluded Payment Types required: false schema: - type: comma-seperated string + type: string Granularity: name: granularity @@ -317,38 +414,32 @@ components: requestBodies: StreamData: - description: stream data + description: Definition of the data stream content: application/json: schema: $ref: '#/components/schemas/StreamData' CreateEvents: - description: create events + description: Create events for Events Overlay content: application/json: schema: $ref: '#/components/schemas/CreateEvents' - GetOpportunitiesQuery: - description: get opportunities payload - content: - application/json: - schema: - $ref: '#/components/schemas/GetOpportunitiesQuery' - CreateTeam: - description: create team + description: Create team content: application/json: schema: $ref: '#/components/schemas/CreateTeamRequest' AssignUsersToTeam: - description: assign users to team + description: Assign Users to Team content: application/json: schema: + description: List of Users properties: users_ids: type: array @@ -356,19 +447,31 @@ components: type: string RemoveUsersFromTeam: - description: remove users from team + description: Remove users from Team content: application/json: schema: + description: List of Users properties: users_ids: type: array items: type: string + GetOpportunitiesQuery: + description: Query to filter opportunities + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpportunitiesQuery' + schemas: StreamData: - description: stream data + description: Stream data + required: + - data_stream_token + - metric_agg_func + - data properties: data_stream_token: type: string @@ -382,111 +485,33 @@ components: $ref: '#/components/schemas/StreamDataPayload' StreamDataPayload: + description: Payload for data ingestion stream + required: + - timestamp + - metric_name + - metric_value properties: timestamp: type: string format: date-time - example: 1234567890 - description: can be either timestamp or datetime string + example: yyyyMMddHHmmss + description: Can be either timestamp or datetime string metric_name: type: string + example: customers + description: The name pf the metric being ingested metric_value: type: number format: float example: 3.14 + description: The value of the metric being ingested custom_dimensions: type: object - - GetOpportunitiesQuery: - properties: - opportunity_type_id: - type: string - status: - type: string - code_automation: - type: boolean - thread_id: - type: integer - account: - type: string - region: - type: string - service: - type: string - tags: - type: array - items: - $ref: '#/components/schemas/Tags' - category: - type: string - record_id: - type: string - source: - type: string - github_pr_key: - type: string - secondary_id: - type: integer - last_detected_start_date: - type: string - format: date - last_detected_end_date: - type: string - format: date - status_updated_start_date: - type: string - format: date - status_updated_end_date: - type: string - format: date - details: - type: boolean - priority: - type: integer - - Tags: - properties: - Key: - type: string - Value: - type: string - - GetOpportunities: - properties: - id: - type: integer - source: - type: string - opportunity_details: - type: object - opportunity_type_id: - type: string - cost_impact: - type: number - record_id: - type: string - status_updated_at: - type: string - format: date-time - created_at: - type: string - format: date-time - status: - type: string - last_detected_at: - type: string - format: date-time - thread_id: - type: integer - github_pr_key: - type: string - - GetOpportunitiesResponse: - type: array - items: - $ref: '#/components/schemas/GetOpportunities' + description: Map of up to 10 key value pairs that you will be able to segment the data by on the Cloudthread platform + example: [[region1, 20.5], [region2, 7.0]] CreateEvents: + description: List of Events with their properties properties: data: type: array @@ -494,28 +519,40 @@ components: $ref: '#/components/schemas/CreateEventsData' CreateEventsData: + description: Properties defining the Event + required: + - timestamp + - payload properties: timestamp: type: string format: date-time - example: 1234567890 + example: yyyyMMddHHmmss description: can be either timestamp or datetime string - payload: - $ref: '#/components/schemas/EventsPayload' team_id: type: integer example: 1 + description: ID of the team that events are relevant to (if teams are defined) + payload: + $ref: '#/components/schemas/EventsPayload' EventsPayload: + description: Events data payload + required: + - type properties: type: type: string + example: deploy description: type: string + example: Major code improvements event_url: type: string + example: https://foo.org - GetTagsPayload: + GetTagCatalogPayload: + description: Tag Catalog fetch response properties: tags: type: object @@ -523,13 +560,16 @@ components: type: string GetCostViewPayload: + description: Data returned by query of Cost View properties: data: type: array + description: List of Cost View data points (timeseries) items: $ref: '#/components/schemas/GetCostViewDataPoint' GetCostViewDataPoint: + description: Data point for Cost View for specific date properties: current_timeframe_cost: type: number @@ -545,15 +585,19 @@ components: format: float date: type: string + example: YYYYMMDD GetUnitMetricPayload: + description: Data returned by query of Unit Metric properties: data: type: array + description: List of Unit Metric data points (timeseries) items: $ref: '#/components/schemas/GetUnitMetricDataPoint' GetUnitMetricDataPoint: + description: Data point for Unit Metric for specific date properties: current_timeframe_denominator: type: number @@ -587,6 +631,11 @@ components: type: string User: + description: Registered User on Cloudthread platform + required: + - id + - email + - name properties: id: type: string @@ -596,11 +645,16 @@ components: type: string GetUsersResponse: + description: List of Users type: array items: $ref: '#/components/schemas/User' CreateTeamRequest: + description: Properties defining the Team + required: + - id + - name properties: id: type: string @@ -674,6 +728,7 @@ components: type: integer TeamResponse: + description: Properties defining the Team properties: id: type: string @@ -747,6 +802,104 @@ components: type: integer GetTeamsResponse: + description: List of Teams with their properties type: array items: $ref: '#/components/schemas/TeamResponse' + + GetOpportunitiesQuery: + description: Opportunity properties + properties: + opportunity_type_id: + type: string + status: + type: string + code_automation: + type: boolean + thread_id: + type: integer + account: + type: string + region: + type: string + service: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/Tags' + category: + type: string + record_id: + type: string + source: + type: string + github_pr_key: + type: string + secondary_id: + type: integer + last_detected_start_date: + type: string + format: date + last_detected_end_date: + type: string + format: date + status_updated_start_date: + type: string + format: date + status_updated_end_date: + type: string + format: date + details: + type: boolean + priority: + type: integer + + Tags: + description: Cost allocation resource tags + properties: + Key: + type: string + Value: + type: string + + GetOpportunitiesResponse: + description: List of filtered opportunities + type: array + items: + $ref: '#/components/schemas/GetOpportunities' + + GetOpportunities: + description: Opportunity data + properties: + id: + type: integer + source: + type: string + opportunity_details: + type: object + opportunity_type_id: + type: string + cost_impact: + type: number + record_id: + type: string + status_updated_at: + type: string + format: date-time + created_at: + type: string + format: date-time + status: + type: string + last_detected_at: + type: string + format: date-time + thread_id: + type: integer + github_pr_key: + type: string + +externalDocs: + description: Find out more about Cloudthread platform + url: https://docs.cloudthread.io \ No newline at end of file From 0be0055d41628849cbe53ec454496b0d5997bdea Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Mon, 21 Aug 2023 20:26:54 -0700 Subject: [PATCH 24/27] Object type definition --- cldthrd_api.yaml | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index 7dea5a5..d016706 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -58,7 +58,7 @@ tags: paths: /streams/ingest: post: - description: Ingests data into created Data Stream + summary: Ingests data into created Data Stream operationId: ingest_stream_data tags: - streams @@ -76,6 +76,7 @@ paths: /events: post: + summary: Ingests the custom events data description: Ingests the custom events data that can be overlayed on top of your Cost Views and Unit Metrics operationId: create_events tags: @@ -94,7 +95,7 @@ paths: /tag-catalog: get: - description: Fetches a Tag Catalog entry via catalog key + summary: Fetches a Tag Catalog entry via catalog key operationId: get_tag_catalog tags: - tag-catalog @@ -112,7 +113,7 @@ paths: /cost/metric/{metric_id}: get: - description: Returns cost data from Cloudthread Cost View + summary: Returns cost data from Cloudthread Cost View operationId: get_cost_metric_filter_data tags: - cost-views @@ -136,7 +137,7 @@ paths: /unit/metric/{metric_id}: get: - description: Returns cost data from Cloudthread Unit Metric + summary: Returns cost data from Cloudthread Unit Metric operationId: get_unit_metric_filter_data tags: - unit-metrics @@ -160,7 +161,8 @@ paths: /users: get: - description: Allows to return data on registered Users of Cloudthread platform + summary: Returns data on users + description: Returns data on registered Users of Cloudthread platform operationId: get_users tags: - users @@ -176,6 +178,7 @@ paths: /teams: get: + summary: Returns list of Teams description: Fetches list of Teams within the org operationId: get_teams_within_org tags: @@ -191,6 +194,7 @@ paths: $ref: '#/components/schemas/GetTeamsResponse' post: + summary: Creates new Team description: Creates new Team within the org operationId: create_team tags: @@ -213,6 +217,7 @@ paths: /teams/{team_id}: get: + summary: Returns specific Team description: Fetches data on a specific Team within the org operationId: get_team_within_org tags: @@ -227,7 +232,7 @@ paths: schema: $ref: '#/components/schemas/TeamResponse' patch: - description: Updates existing Team definition + summary: Updates existing Team operationId: update_team tags: - teams @@ -248,7 +253,7 @@ paths: description: Slack integration/slack channel not found/team not found delete: - description: Deletes existing Team + summary: Deletes existing Team operationId: delete_team tags: - teams @@ -263,6 +268,7 @@ paths: /teams/{team_id}/members: get: operationId: get_team_members + summary: Returns list of Team members description: Fetches list of members of specific Team tags: - teams @@ -279,7 +285,7 @@ paths: /teams/{team_id}/members/assign: post: operationId: assign_users_to_team - description: Adds new Users to specific Team + summary: Adds new Users to specific Team tags: - teams requestBody: @@ -297,7 +303,7 @@ paths: /teams/{team_id}/members/delete: post: operationId: assign_users_to_team - description: Deletes Users from specific Team + summary: Deletes Users from specific Team tags: - teams requestBody: @@ -315,7 +321,7 @@ paths: /cost-optimization/opportunities/list: post: operationId: get_opportunities - description: Fetches the list of savings opportunities + summary: Returns the list of Savings Opportunities tags: - savings-opportunities requestBody: @@ -468,6 +474,7 @@ components: schemas: StreamData: description: Stream data + type: object required: - data_stream_token - metric_agg_func @@ -486,6 +493,7 @@ components: StreamDataPayload: description: Payload for data ingestion stream + type: object required: - timestamp - metric_name @@ -512,6 +520,7 @@ components: CreateEvents: description: List of Events with their properties + type: object properties: data: type: array @@ -520,6 +529,7 @@ components: CreateEventsData: description: Properties defining the Event + type: object required: - timestamp - payload @@ -538,6 +548,7 @@ components: EventsPayload: description: Events data payload + type: object required: - type properties: @@ -553,6 +564,7 @@ components: GetTagCatalogPayload: description: Tag Catalog fetch response + type: object properties: tags: type: object @@ -561,6 +573,7 @@ components: GetCostViewPayload: description: Data returned by query of Cost View + type: object properties: data: type: array @@ -570,6 +583,7 @@ components: GetCostViewDataPoint: description: Data point for Cost View for specific date + type: object properties: current_timeframe_cost: type: number @@ -589,6 +603,7 @@ components: GetUnitMetricPayload: description: Data returned by query of Unit Metric + type: object properties: data: type: array @@ -598,6 +613,7 @@ components: GetUnitMetricDataPoint: description: Data point for Unit Metric for specific date + type: object properties: current_timeframe_denominator: type: number @@ -632,6 +648,7 @@ components: User: description: Registered User on Cloudthread platform + type: object required: - id - email @@ -652,6 +669,7 @@ components: CreateTeamRequest: description: Properties defining the Team + type: object required: - id - name @@ -729,6 +747,7 @@ components: TeamResponse: description: Properties defining the Team + type: object properties: id: type: string @@ -809,6 +828,7 @@ components: GetOpportunitiesQuery: description: Opportunity properties + type: object properties: opportunity_type_id: type: string @@ -857,6 +877,7 @@ components: Tags: description: Cost allocation resource tags + type: object properties: Key: type: string @@ -871,6 +892,7 @@ components: GetOpportunities: description: Opportunity data + type: object properties: id: type: integer From ed01d0c6c4e0ded07e1e7ba7ea50584e90e0fe54 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Mon, 21 Aug 2023 20:42:32 -0700 Subject: [PATCH 25/27] Minor fixes --- .gitbook/assets/api.yaml | 1282 -------------------------------------- cldthrd_api.yaml | 4 +- 2 files changed, 1 insertion(+), 1285 deletions(-) delete mode 100644 .gitbook/assets/api.yaml diff --git a/.gitbook/assets/api.yaml b/.gitbook/assets/api.yaml deleted file mode 100644 index 5578215..0000000 --- a/.gitbook/assets/api.yaml +++ /dev/null @@ -1,1282 +0,0 @@ -openapi: 3.0.3 -info: - version: 0.0.1 - title: Cloudthread backend -servers: - - url: 'https://api.core.{environment}.cloudthread.io/' - description: cloudthread.io - variables: - environment: - enum: - - development - - production - default: development - - url: 'http://localhost:{port}' - description: Local API Server - variables: - port: - default: '3000' -paths: - /ping: - get: - operationId: ping - summary: Just ping - tags: - - Monitoring - responses: - 200: - description: OK - - /user: - get: - operationId: getUser - summary: Get user profile - description: This method returns authorized user profile - tags: - - Users - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/User' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - patch: - operationId: updateUser - summary: Change user profile - description: Change user profile details - tags: - - Users - security: - - tokenAuth: [ ] - requestBody: - $ref: '#/components/requestBodies/User' - responses: - 200: - $ref: '#/components/responses/User' - 400: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /organizations: - post: - operationId: createOrganization - summary: Create organization - description: Create organization - tags: - - Organizations - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/Organizations' - 400: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /signin: - post: - operationId: signin - summary: Application sign in - description: Application sign in with email and password - tags: - - Auth - requestBody: - $ref: '#/components/requestBodies/SignIn' - responses: - 204: - $ref: '#/components/responses/AuthSuccessful' - 500: - description: internal server error - - /signout: - get: - operationId: signout - summary: User sign out - tags: - - Auth - security: - - tokenAuth: [ ] - responses: - 204: - description: Logout user - headers: - Set-Cookie: - description: Delete token - schema: - type: string - example: token=; Path=/; Domain=app.cloudthread.io; Expires=; - 500: - description: internal server error - - /signup: - post: - operationId: signup - summary: Register - description: Register with user details - tags: - - Auth - requestBody: - $ref: '#/components/requestBodies/SignUp' - responses: - 204: - $ref: '#/components/responses/AuthSuccessful' - 500: - description: internal server error - - /signin/google: - get: - operationId: signinGoogle - summary: Google social login - description: Redirect to Google social_login dialog - tags: - - Auth - responses: - 302: - $ref: '#/components/responses/AuthDialog' - 500: - description: internal server error - - /signin/google/callback: - get: - operationId: signinGoogleCallback - summary: Processing callback - description: Processing callback - tags: - - Auth - parameters: - - $ref: '#/components/parameters/SocialServiceAuthCode' - responses: - 200: - $ref: '#/components/responses/AuthSuccessful' - 500: - description: internal server error - - /signin/github: - get: - operationId: signinGithub - summary: Github social_login - description: Redirect to Github social_login dialog - tags: - - Auth - responses: - 302: - $ref: '#/components/responses/AuthDialog' - 500: - description: internal server error - - /signin/github/callback: - get: - operationId: signinGithubCallback - summary: Processing callback - description: Processing callback - tags: - - Auth - parameters: - - $ref: '#/components/parameters/SocialServiceAuthCode' - responses: - 200: - $ref: '#/components/responses/AuthSuccessful' - 500: - description: internal server error - - /email/verify: - get: - operationId: emailVerify - summary: Verify email - description: Processing callback - tags: - - Auth - parameters: - - $ref: '#/components/parameters/VerificationToken' - responses: - 204: - $ref: '#/components/responses/VerificationSuccessful' - 500: - description: internal server error - - /configs/datacollector: - get: - operationId: dataCollectionConfigs - summary: Get user organization data collection configs - description: This method returns all data collection configs for the organization the user owns based on query params - tags: - - Data Collection - parameters: - - $ref: '#/components/parameters/DataSourceId' - - $ref: '#/components/parameters/DataCollectionCadence' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollections' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - post: - operationId: dataCollectionConfigsCreate - summary: Create data collection config for user organization - description: This method creates a data collection config for the organization the user owns - tags: - - Data Collection - requestBody: - $ref: '#/components/requestBodies/DataCollection' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /configs/datacollector/{config_id:\d+}: - get: - operationId: dataCollectionConfig - summary: Get user organization data collection config - description: This method returns a single config for the organization the user owns based on config_id - tags: - - Data Collection - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - patch: - operationId: dataCollectionConfigsUpdate - summary: Update data collection config for user organization - description: This method updates a data collection config for the organization the user owns based on config_id - tags: - - Data Collection - requestBody: - $ref: '#/components/requestBodies/DataCollection' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - - /internal/dataconfigs: - get: - operationId: adminDataCollectionConfigs - summary: Get data collection configs - description: This method returns all data collection configs based on query params - tags: - - Data Collection - parameters: - - $ref: '#/components/parameters/OrganizationId' - - $ref: '#/components/parameters/DataSourceId' - - $ref: '#/components/parameters/DataCollectionCadence' - security: - - adminAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollections' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - post: - operationId: adminDataCollectionConfigsCreate - summary: Create data collection config - description: This method creates a data collection config - tags: - - Data Collection - requestBody: - $ref: '#/components/requestBodies/AdminDataCollection' - security: - - adminAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /internal/dataconfigs/{config_id:\d+}: - get: - operationId: adminDataCollectionConfig - summary: Get data collection config - description: This method returns a single config based on config_id - tags: - - Data Collection - security: - - adminAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - patch: - operationId: adminDataCollectionConfigUpdate - summary: Update data collection config - description: This method updates a data collection config based on config_id - tags: - - Data Collection - requestBody: - $ref: '#/components/requestBodies/DataCollection' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/DataCollection' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /configs/report: - get: - operationId: reportConfigs - summary: Get user organization report configs - description: This method returns all report configs for the organization the user owns based on query params - tags: - - Reports - parameters: - - $ref: '#/components/parameters/OwnerId' - - $ref: '#/components/parameters/ReportTypeId' - - $ref: '#/components/parameters/ReportCadence' - - $ref: '#/components/parameters/ReportName' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/Reports' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - post: - operationId: reportConfigsCreate - summary: Create report config for user organization - description: This method creates a report config for the organization the user owns - tags: - - Reports - requestBody: - $ref: '#/components/requestBodies/Report' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/Report' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /configs/report/{config_id:\d+}: - get: - operationId: reportConfig - summary: Get user organization report config - description: This method returns a single config for the organization the user owns based on config_id - tags: - - Reports - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/ReportWithOwner' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - patch: - operationId: reportConfigUpdate - summary: Update report config for user organization - description: This method updates a report config for the organization the user owns based on config_id - tags: - - Reports - requestBody: - $ref: '#/components/requestBodies/Report' - security: - - tokenAuth: [ ] - responses: - 200: - $ref: '#/components/responses/Report' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /internal/reportconfigs: - get: - operationId: adminReportConfigs - summary: Get report configs - description: This method returns all report configs based on query params - tags: - - Reports - parameters: - - $ref: '#/components/parameters/OwnerId' - - $ref: '#/components/parameters/OrganizationId' - - $ref: '#/components/parameters/ReportTypeId' - - $ref: '#/components/parameters/ReportCadence' - - $ref: '#/components/parameters/ReportName' - security: - - adminAuth: [ ] - responses: - 200: - $ref: '#/components/responses/Reports' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /internal/reportconfigs/{config_id:\d+}: - get: - operationId: adminReportConfig - summary: Get report config - description: This method returns a single config based on config_id - tags: - - Reports - security: - - adminAuth: [ ] - responses: - 200: - $ref: '#/components/responses/ReportWithOwner' - 401: - $ref: '#/components/responses/Unauthorized' - 500: - description: internal server error - - /metrics/unit: - post: - operationId: getUnitMetricFilter - summary: Get unit metric filter - description: Get unit metric by filter - tags: - - Metrics - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/EndDate' - - $ref: '#/components/parameters/Granularity' - requestBody: - $ref: '#/components/requestBodies/UnitMetricFilter' - responses: - 200: - $ref: '#/components/responses/UnitMetricResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - description: internal server error - get: - operationId: getUnitMetricFilters - summary: Get unit metric filters - description: Get unit metric filters - tags: - - Metrics - responses: - 200: - $ref: '#/components/responses/SavedUnitMetricFilters' - 500: - description: internal server error - - /metrics/cost: - post: - operationId: getCostMetric - summary: Get cost metric - description: Get cost metric by filter - tags: - - Metrics - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/EndDate' - - $ref: '#/components/parameters/Granularity' - requestBody: - $ref: '#/components/requestBodies/CostMetricFilter' - responses: - 200: - $ref: '#/components/responses/CostMetricResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - description: internal server error - - /metrics/unit/save: - post: - operationId: SavedUnitMetricFilter - summary: Save unit metric filter - description: Save unit metric filter - tags: - - Metrics - requestBody: - $ref: '#/components/requestBodies/SavedUnitMetricFilter' - responses: - 200: - $ref: '#/components/responses/MetricFilterResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - description: internal server error - - /metrics/unit/{filter_id}: - post: - operationId: SavedUnitMetricFilter - summary: Save unit metric filter - description: Save unit metric filter - tags: - - Metrics - responses: - 200: - $ref: '#/components/responses/MetricFilterResponse' - 500: - description: internal server error - - /metrics/unit/constructor: - get: - operationId: getUnitMetricConstructor - summary: Get Unit Metric Constructor - description: Get resources for unit metric filter page - tags: - - Metrics - responses: - 200: - $ref: '#/components/responses/UnitMetricConstructor' - 500: - description: internal server error - - /metrics/cost/constructor: - get: - operationId: getCostMetricConstructor - summary: Get Cost Metric Constructor - description: Get resources for the page cost overview filters - tags: - - Metrics - responses: - 200: - $ref: '#/components/responses/CostMetricConstructor' - 500: - description: internal server error - -components: - responses: - User: - description: User profile - content: - application/json: - schema: - $ref: '#/components/schemas/User' - - DataCollection: - description: Data collection config - content: - application/json: - schema: - $ref: '#/components/schemas/DataCollection' - - DataCollections: - description: Data collection configs - content: - application/json: - schema: - $ref: '#/components/schemas/DataCollections' - - Organizations: - description: Organizations - content: - application/json: - schema: - $ref: '#/components/schemas/Organizations' - - Report: - description: Report - content: - application/json: - schema: - $ref: '#/components/schemas/Report' - - ReportWithOwner: - description: Report - content: - application/json: - schema: - $ref: '#/components/schemas/ReportWithOwner' - - Reports: - description: Reports - content: - application/json: - schema: - $ref: '#/components/schemas/Reports' - - Unauthorized: - description: Missing or invalid social_login token - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - - BadRequest: - description: Bad request body - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - - AuthSuccessful: - description: OK - headers: - Set-Cookie: - description: Set social_login token - schema: - type: string - example: token={jwt_token}; Domain=localhost; HttpOnly; Max-Age=36000s; Path=/ - - VerificationSuccessful: - description: OK - - AuthDialog: - description: Auth dialog - headers: - Location: - description: Link to social_login dialog - schema: - type: string - format: uri - example: https://example.com/login/oauth/authorize?redirect_uri={redirect_uri}&client_id={client_id}&scope=public_profile,email - - UnitMetricResponse: - description: Data for chart - content: - application/json: - schema: - $ref: '#/components/schemas/UnitMetricResponse' - - CostMetricResponse: - description: Data for chart - content: - application/json: - schema: - $ref: '#/components/schemas/CostMetricResponse' - - MetricFilterResponse: - description: Saved filter - content: - application/json: - schema: - $ref: '#/components/schemas/SavedMetricFilter' - - SavedUnitMetricFilters: - description: Saved filters - content: - application/json: - schema: - $ref: '#/components/schemas/SavedUnitMetricFilters' - - CostMetricConstructor: - description: CUR resources for cost overview filters - content: - application/json: - schema: - $ref: '#/components/schemas/CURResources' - - UnitMetricConstructor: - description: Resources for unit metric filters page - content: - application/json: - schema: - $ref: '#/components/schemas/UnitMetricConstructor' - -# ------------------------- - - schemas: - User: - description: User profile - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - name: - type: string - example: John Doe - email: - type: string - format: email - example: john.doe@example.com - is_confirmed: - type: boolean - readOnly: true - is_active: - type: boolean - readOnly: true - - UserResponse: - description: User profile - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - name: - type: string - example: John Doe - email: - type: string - format: email - example: john.doe@example.com - - Organization: - description: organization - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - name: - type: string - example: Some LLC - owner_id: - type: integer - format: int64 - readOnly: true - example: 1234 - - OrganizationResponse: - description: organization - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - name: - type: string - example: Some LLC - - Organizations: - type: array - items: - $ref: '#/components/schemas/Organization' - - DataCollectionRequestBody: - description: Create data collection config - properties: - data_source_id: - type: string - example: AWSCUR - cadence: - type: string - example: daily - collection_details: - type: object - example: '{"aws_account_id": "1234"}' - - AdminDataCollectionRequestBody: - description: Create data collection config for Cloudthread Admin - properties: - organization_id: - type: integer - format: int64 - readOnly: true - example: 1234 - data_source_id: - type: string - example: AWSCUR - cadence: - type: string - example: daily - collection_details: - type: object - example: '{"aws_account_id": "1234"}' - - DataCollection: - description: Response data collection config - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - organization_id: - type: integer - format: int64 - readOnly: true - example: 1234 - data_source_id: - type: string - example: AWSCUR - cadence: - type: string - example: weekly - collection_details: - type: object - example: '{"aws_account_id": "1234"}' - - DataCollections: - type: array - items: - $ref: '#/components/schemas/DataCollection' - - ReportRequestBody: - description: Create report config - properties: - report_type_id: - type: string - example: GENERALCOST - cadence: - type: string - example: weekly - report_details: - type: object - example: '{"email_recipients": [x@y.com],}' - name: - type: string - example: Report 1 - - Report: - description: Response report config - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - owner_id: - type: integer - format: int64 - readOnly: true - example: 1234 - organization_id: - type: integer - format: int64 - readOnly: true - example: 1234 - report_type_id: - type: string - example: GENERALCOST - cadence: - type: string - example: weekly - report_details: - type: object - example: '{"email_recipients": [x@y.com],}' - name: - type: string - example: Report 1 - - ReportWithOwner: - description: Response report config - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1234 - owner: - type: object - $ref: '#/components/schemas/UserResponse' - organization: - type: object - $ref: '#/components/schemas/OrganizationResponse' - report_type_id: - type: string - example: GENERALCOST - cadence: - type: string - example: weekly - report_details: - type: object - example: '{"email_recipients": [x@y.com],}' - name: - type: string - example: Report 1 - - Reports: - type: array - items: - $ref: '#/components/schemas/ReportWithOwner' - - SocialLogin: - description: User's social account - properties: - id: - type: string - format: int64 - example: 1234 - provider: - $ref: '#/components/schemas/Provider' - - Provider: - type: string - enum: - - google - - github - - Error: - type: object - properties: - error: - type: object - properties: - code: - type: string - message: - type: string - required: - - code - - SignIn: - type: object - properties: - email: - type: string - password: - type: string - - SignUp: - type: object - properties: - email: - type: string - password: - type: string - name: - type: string - company_name: - type: string - - UnitMetricFilter: - type: object - properties: - numerator: - $ref: '#/components/schemas/MetricFilter' - denominator: - $ref: '#/components/schemas/MetricFilter' - - UnitMetricResponse: - type: object - properties: - metadata: - type: object - properties: - unit_metric: - $ref: '#/components/schemas/ChartData' - numerator: - $ref: '#/components/schemas/ChartData' - denominator: - $ref: '#/components/schemas/ChartData' - data: - type: array - items: - type: object - - MetricFilter: - type: object - properties: - operator: - type: string - conditions: - type: array - items: - type: object - - SavedUnitMetricFilter: - type: object - properties: - name: - type: string - filter: - $ref: '#/components/schemas/UnitMetricFilter' - id: - type: integer - owner_id: - type: integer - organization_id: - type: integer - - SavedUnitMetricFilters: - type: array - items: - $ref: '#/components/schemas/SavedUnitMetricFilter' - - CostMetricResponse: - type: object - properties: - metadata: - $ref: '#/components/schemas/ChartData' - data: - type: array - items: - type: object - - ChartData: - type: object - properties: - x_axis: - type: object - properties: - column: - type: string - granularity: - type: string - range: - type: array - items: - type: string - dimensions: - type: array - y_axis: - type: object - properties: - column: - type: string - range: - type: array - items: - type: string - - SavedMetricFilter: - type: object - properties: - id: - type: integer - filter: - $ref: '#/components/schemas/MetricFilter' - owner_id: - type: integer - name: - type: string - organization_id: - type: integer - - CURResources: - type: object - properties: - services: - type: array - items: - type: string - region_names: - type: array - items: - type: string - aws_account_ids: - type: array - items: - type: integer - tags: - type: array - items: - type: object - - CWResources: - type: object - properties: - region_names: - type: array - items: - type: string - aws_account_ids: - type: array - items: - type: integer - metrics: - type: object - tags: - type: array - items: - type: object - - UnitMetricConstructor: - type: object - properties: - numerator: - $ref: '#/components/schemas/CURResources' - denominator: - $ref: '#/components/schemas/CWResources' - -# ------------------------- - - requestBodies: - User: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - - DataCollection: - content: - application/json: - schema: - $ref: '#/components/schemas/DataCollectionRequestBody' - - AdminDataCollection: - content: - application/json: - schema: - $ref: '#/components/schemas/AdminDataCollectionRequestBody' - - Report: - content: - application/json: - schema: - $ref: '#/components/schemas/ReportRequestBody' - - SignIn: - content: - application/json: - schema: - $ref: '#/components/schemas/SignIn' - - SignUp: - content: - application/json: - schema: - $ref: '#/components/schemas/SignUp' - - UnitMetricFilter: - content: - application/json: - schema: - $ref: '#/components/schemas/UnitMetricFilter' - - SavedUnitMetricFilter: - content: - application/json: - schema: - $ref: '#/components/schemas/SavedUnitMetricFilter' - - CostMetricFilter: - content: - application/json: - schema: - $ref: '#/components/schemas/MetricFilter' - -# ------------------------- - - securitySchemes: - tokenAuth: - description: Auth token - type: apiKey - in: cookie - name: token - - adminAuth: - description: Admin token - type: apiKey - in: header - name: admin-token - -# ------------------------- - - parameters: - OrganizationId: - name: organization_id - in: query - description: Defined by DB - required: false - schema: - type: integer - - OwnerId: - name: owner_id - in: query - description: User id who owns object - required: false - schema: - type: integer - - DataSourceId: - name: data_source_id - in: query - description: Data source type - required: false - schema: - type: string - - DataCollectionCadence: - name: cadence - in: query - description: Data collection cadence - schema: - type: string - - ReportTypeId: - name: report_type_id - in: query - description: Report type - required: false - schema: - type: string - - ReportCadence: - name: cadence - in: query - description: Report cadence - required: false - schema: - type: string - - ReportName: - name: name - in: query - description: Report name - required: false - schema: - type: string - - SocialServiceAuthCode: - name: code - in: query - description: Received from social service - required: true - schema: - type: string - - VerificationToken: - name: token - in: query - description: Token that was sent to user's email - required: true - schema: - type: string - - StartDate: - name: start_date - in: query - description: Date from (incl) - required: false - schema: - type: string - - EndDate: - name: end_date - in: query - description: Date from (incl) - required: false - schema: - type: string - - Granularity: - name: granularity - in: query - description: Granularity - required: false - schema: - type: string diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index d016706..d1ebcdf 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -42,18 +42,16 @@ tags: externalDocs: description: Find out more url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/users - - name: teams description: Teams manipulation externalDocs: description: Find out more url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/teams - - name: savings-opportunities description: Savings Opportunities manipulation externalDocs: description: Find out more - url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/savings-hub/opportunities + url: https://docs.cloudthread.io/v/api-docs/reference/api-reference/savings-hub/opportunities-explorer paths: /streams/ingest: From 8267d6beb63e767f0adde797ad8b832a4bec3d60 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Mon, 21 Aug 2023 22:31:44 -0700 Subject: [PATCH 26/27] Parameter description coverage --- cldthrd_api.yaml | 150 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 142 insertions(+), 8 deletions(-) diff --git a/cldthrd_api.yaml b/cldthrd_api.yaml index d1ebcdf..c98c586 100644 --- a/cldthrd_api.yaml +++ b/cldthrd_api.yaml @@ -447,8 +447,10 @@ components: properties: users_ids: type: array + description: List of User IDs items: type: string + description: User ID RemoveUsersFromTeam: description: Remove users from Team @@ -459,8 +461,10 @@ components: properties: users_ids: type: array + description: List of User IDs items: type: string + description: User ID GetOpportunitiesQuery: description: Query to filter opportunities @@ -481,11 +485,14 @@ components: data_stream_token: type: string example: sometoken + description: Data stream token metric_agg_func: type: string example: Sum | Average | Minimum | Maximum + description: Aggregation function identifier (Sum | Average | Minimum | Maximum) data: type: array + description: Data timeseries items: $ref: '#/components/schemas/StreamDataPayload' @@ -505,7 +512,7 @@ components: metric_name: type: string example: customers - description: The name pf the metric being ingested + description: The name of the metric being ingested metric_value: type: number format: float @@ -522,6 +529,7 @@ components: properties: data: type: array + description: Event data items: $ref: '#/components/schemas/CreateEventsData' @@ -536,7 +544,7 @@ components: type: string format: date-time example: yyyyMMddHHmmss - description: can be either timestamp or datetime string + description: Can be either timestamp or datetime string team_id: type: integer example: 1 @@ -553,21 +561,25 @@ components: type: type: string example: deploy + description: Event type (deploy, outage, etc.) description: type: string example: Major code improvements + description: Event description event_url: type: string example: https://foo.org + description: Link to event details if applicable GetTagCatalogPayload: description: Tag Catalog fetch response type: object properties: tags: - type: object - additionalProperties: - type: string + type: array + description: List of tags + items: + $ref: '#/components/schemas/Tags' GetCostViewPayload: description: Data returned by query of Cost View @@ -586,18 +598,23 @@ components: current_timeframe_cost: type: number format: float + description: Cost ($) for current period previous_timeframe_cost: type: number format: float + description: Cost ($) for previous period pop_diff: type: number format: float + description: Period-over-period difference total ($) pop_change: type: number format: float + description: Period-over-period change (% decimal) date: type: string example: YYYYMMDD + description: Period date GetUnitMetricPayload: description: Data returned by query of Unit Metric @@ -616,33 +633,44 @@ components: current_timeframe_denominator: type: number format: float + description: Denominator value for current period current_timeframe_numerator: type: number format: float + description: Numerator value for current period ($) current_timeframe_unit_metric: type: number format: float + description: Calculated unit metric for current period ($) previous_timeframe_denominator: type: number format: float + description: Denominator value for previous period previous_timeframe_numerator: type: number format: float + description: Numerator value for previous period ($) previous_timeframe_unit_metric: type: number format: float + description: Calculated unit metric for previous period ($) pop_diff: type: number format: float + description: Period-over-period difference total ($) pop_change: type: number format: float + description: Period-over-period change (% decimal) d_agg_func: type: string + description: Denominator aggregation function (SUM, AVERAGE, etc.) n_agg_func: type: string + description: Denominator aggregation function (SUM, AVERAGE, etc.) date: type: string + description: Period date User: description: Registered User on Cloudthread platform @@ -654,10 +682,13 @@ components: properties: id: type: string + description: User type (Admin, User) email: type: string + description: User email name: type: string + description: User name GetUsersResponse: description: List of Users @@ -666,7 +697,7 @@ components: $ref: '#/components/schemas/User' CreateTeamRequest: - description: Properties defining the Team + description: Request to create a Team definition type: object required: - id @@ -674,74 +705,109 @@ components: properties: id: type: string + description: Team ID name: type: string + description: Team name slack_channel: type: string + description: Slack channel link for the team notifications aws_account_ids: type: array + description: Team-level data filter – AWS accounts list items: type: string + description: AWS account ID aws_bill_payer_account_ids: type: array + description: Team-level data filter – AWS Payer accounts list items: type: string + description: AWS account ID aws_region_names: type: array + description: Team-level data filter – AWS regions list items: type: string + description: AWS region name (e.g. us-east-1) aws_services: type: array + description: Team-level data filter – AWS services list items: type: string + description: AWS service name (e.g. Amazon S3) aws_tags: type: array + description: Team-level data filter – AWS resource tags list items: type: object + description: AWS resource tag (key-value pair) aws_account_tags: type: array + description: Team-level data filter – AWS account tags list items: type: object + description: AWS account tag (key-value pair) gcp_project_names: type: array + description: Team-level data filter – GCP projects list items: type: string + description: GCP project ID gcp_billing_account_ids: type: array + description: Team-level data filter – GCP billing accounts ID list items: type: string + description: GCP billing account ID gcp_sku_ids: type: array + description: Team-level data filter – GCP SKU ID list items: type: string + description: GCP SKU ID gcp_locations: type: array + description: Team-level data filter – GCP locations list items: type: string + description: GCP location name gcp_services: type: array + description: Team-level data filter – GCP services list items: type: string + description: GCP service name gcp_labels: type: array + description: Team-level data filter – GCP labels list items: type: object + description: GCP label (key-value pair) custom_stream_tokens: type: array + description: Custom stream tokens list items: type: string + description: Custom stream token custom_metric_names: type: array + description: Custom stream metrics list items: type: string + description: Custom stream metric custom_dimensions: type: array + description: Custom dimensions list items: type: object + description: Custom dimension opportunity_priorities: type: array + description: Opportunity priority definition list items: type: integer + description: Opportunity priority identifier TeamResponse: description: Properties defining the Team @@ -749,74 +815,109 @@ components: properties: id: type: string + description: Team ID name: type: string + description: Team name slack_channel: type: string + description: Slack channel link for the team notifications aws_account_ids: type: array + description: Team-level data filter – AWS accounts list items: type: string + description: AWS account ID aws_bill_payer_account_ids: type: array + description: Team-level data filter – AWS Payer accounts list items: type: string + description: AWS account ID aws_region_names: type: array + description: Team-level data filter – AWS regions list items: type: string + description: AWS region name (e.g. us-east-1) aws_services: type: array + description: Team-level data filter – AWS services list items: type: string + description: AWS service name (e.g. Amazon S3) aws_tags: type: array + description: Team-level data filter – AWS resource tags list items: type: object + description: AWS resource tag (key-value pair) aws_account_tags: type: array + description: Team-level data filter – AWS account tags list items: type: object + description: AWS account tag (key-value pair) gcp_project_names: type: array + description: Team-level data filter – GCP projects list items: type: string + description: GCP project ID gcp_billing_account_ids: type: array + description: Team-level data filter – GCP billing accounts ID list items: type: string + description: GCP billing account ID gcp_sku_ids: type: array + description: Team-level data filter – GCP SKU ID list items: type: string + description: GCP SKU ID gcp_locations: type: array + description: Team-level data filter – GCP locations list items: type: string + description: GCP location name gcp_services: type: array + description: Team-level data filter – GCP services list items: type: string + description: GCP service name gcp_labels: type: array + description: Team-level data filter – GCP labels list items: type: object + description: GCP label (key-value pair) custom_stream_tokens: type: array + description: Custom stream tokens list items: type: string + description: Custom stream token custom_metric_names: type: array + description: Custom stream metrics list items: type: string + description: Custom stream metric custom_dimensions: type: array + description: Custom dimensions list items: type: object + description: Custom dimension opportunity_priorities: type: array + description: Opportunity priority definition list items: type: integer + description: Opportunity priority identifier GetTeamsResponse: description: List of Teams with their properties @@ -825,53 +926,72 @@ components: $ref: '#/components/schemas/TeamResponse' GetOpportunitiesQuery: - description: Opportunity properties + description: Filter parameters to retrieve the list of matching opportunities type: object properties: opportunity_type_id: type: string + description: Opportunity type ID status: type: string + description: Opportunity status (e.g. Assigned, In Progress, Validation, Done, etc.) code_automation: type: boolean + description: Opportunity automation option (True/False) thread_id: type: integer + description: ID of Thread that contains opportunity (if assigned) account: type: string + description: ID of cloud account related to resource featured in opportunity region: type: string + description: Name of region related to resource featured in opportunity service: type: string + description: Name of service related to resource featured in opportunity tags: type: array + description: Tags of resource featured in opportunity items: $ref: '#/components/schemas/Tags' category: type: string + description: Opportunity category (e.g. Redshift Righsizing) record_id: type: string + description: ID of resource featured in opportunity source: type: string + description: Opportunity data source (e.g. Cloudthread, AWS Compute Optimizer, etc.) github_pr_key: type: string + description: GitHub Pull Request related to opportunity secondary_id: type: integer + description: Secondary ID of opportunity last_detected_start_date: type: string format: date + description: Date filter for last detected date (start value) last_detected_end_date: type: string format: date + description: Date filter for last detected date (end value) status_updated_start_date: type: string format: date + description: Date filter for status updated date (start value) status_updated_end_date: type: string format: date + description: Date filter for status updated date (end value) details: type: boolean + description: If opportunity details present (True/False) priority: type: integer + description: Opportunity priority (1, 2, 3, etc.) Tags: description: Cost allocation resource tags @@ -879,9 +999,11 @@ components: properties: Key: type: string + description: Resource tag key Value: type: string - + description: Resource tag value + GetOpportunitiesResponse: description: List of filtered opportunities type: array @@ -894,31 +1016,43 @@ components: properties: id: type: integer + description: Opportunity ID source: type: string + description: Opportunity data source (e.g. Cloudthread, AWS Compute Optimizer, etc.) opportunity_details: type: object + description: Opportunity details (JSON) opportunity_type_id: type: string + description: Opportunity type ID cost_impact: type: number + description: Opportunity estimated savings record_id: type: string + description: ID of resource featured in opportunity status_updated_at: type: string format: date-time + description: Date when opportunity status was last updated created_at: type: string format: date-time + description: Date when opportunity was created status: type: string + description: Opportunity status (e.g. Assigned, In Progress, Validation, Done, etc.) last_detected_at: type: string format: date-time + description: Date when opportunity was last detected thread_id: type: integer + description: ID of Thread that contains opportunity (if assigned) github_pr_key: type: string + description: GitHub Pull Request related to opportunity (if any) externalDocs: description: Find out more about Cloudthread platform From 2b52752670be2ed70beb9f0ec1a23ebf98e36f85 Mon Sep 17 00:00:00 2001 From: Ilia Semenov Date: Tue, 22 Aug 2023 05:43:29 +0000 Subject: [PATCH 27/27] =?UTF-8?q?GITBOOK-9:=20API=20docs=20refresh=20=20?= =?UTF-8?q?=E2=80=93=20Aug=202023=20=E2=80=93=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- SUMMARY.md | 5 +- reference/api-reference/README.md | 52 +++++++++++++------ reference/api-reference/custom_data.md | 22 ++++---- reference/api-reference/events.md | 20 ++++--- reference/api-reference/metrics.md | 46 ++++++++++------ reference/api-reference/savings-hub.md | 7 --- reference/api-reference/savings-hub/README.md | 2 + .../savings-hub/opportunities-explorer.md | 7 +++ reference/api-reference/tag_catalog.md | 12 ++--- reference/api-reference/teams.md | 26 ++++------ reference/api-reference/users.md | 7 +-- 12 files changed, 116 insertions(+), 92 deletions(-) delete mode 100644 reference/api-reference/savings-hub.md create mode 100644 reference/api-reference/savings-hub/README.md create mode 100644 reference/api-reference/savings-hub/opportunities-explorer.md diff --git a/README.md b/README.md index 5b38ef9..9dade4c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Welcome to Cloudthread Developer API -Welcome to Cloudthread Developer API! Here you'll find all the documentation you need to get up and running with the cloud cost management API. +Welcome to Cloudthread **Developer API**! Here you'll find all the documentation you need to get up and running with the cloud cost management API. ## Want to check it out? diff --git a/SUMMARY.md b/SUMMARY.md index 4ea0f59..979bfcd 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -9,6 +9,7 @@ * [Events Overlay Ingestion](reference/api-reference/events.md) * [Tag Catalog Fetch](reference/api-reference/tag\_catalog.md) * [Metric Fetch](reference/api-reference/metrics.md) - * [Teams](reference/api-reference/teams.md) * [Users](reference/api-reference/users.md) - * [Savings Hub](reference/api-reference/savings-hub.md) + * [Teams](reference/api-reference/teams.md) + * [Savings Hub](reference/api-reference/savings-hub/README.md) + * [Opportunities Explorer](reference/api-reference/savings-hub/opportunities-explorer.md) diff --git a/reference/api-reference/README.md b/reference/api-reference/README.md index a287eb9..402091f 100644 --- a/reference/api-reference/README.md +++ b/reference/api-reference/README.md @@ -1,56 +1,66 @@ # API Reference -Cloudthread provides a powerful and flexible REST Developer API to help you get the most out of your data. +Cloudthread provides a powerful and flexible **REST Developer API** to help you get the most out of your data. -This page shows how to use the API, and what features are currently available. +These docs show how to use the API, and what features are currently available. + +{% hint style="info" %} +**Good to know:** All the API methods referenced in the docs are synced to a Swagger file URL (**OpenAPI v3**) and are kept up to date **automatically** with changes to the API. +{% endhint %} ## Basic setup -Cloudthread's Developer API lives at +Cloudthread's **Developer API** lives at: + +{% embed url="https://api.cloudthread.io" fullWidth="false" %} -`https://api.cloudthread.io` +{% hint style="warning" %} +Cloudthread requires an **API Token** to process incoming developer API requests. -Cloudthread requires an API Token to process incoming developer API requests. Admin's have the ability to generate API Tokens on the Cloudthread platform within the **Settings** tab. +Admin's have the ability to generate API Tokens on the Cloudthread platform within the [Settings](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings "mention") tab. +{% endhint %} This API Token should be included in the headers for all Developer API requests as follows: `x-api-key: {API_TOKEN}` -Any request without a valid token will be rejected. +{% hint style="danger" %} +Any request without a valid token will be **rejected**. +{% endhint %} -## Custom Data Ingestion +## Custom Data ingestion Cloudthread provides the ability to send custom data to our systems that can then be used in your Cost Views and Unit Metrics. -In order to send custom data, you must provision a **Custom Data - Data Stream Token** on the Cloudthread platform within the **Settings** tab. +In order to send custom data, you must provision a **Custom Data - Data Stream Token** on the Cloudthread platform within the [Settings](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings "mention") tab. {% content-ref url="custom_data.md" %} [custom\_data.md](custom\_data.md) {% endcontent-ref %} -Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab** on Cloudthread's platform. +Data sent via this API will appear in [Costs Overview](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/costs-overview "mention") and [Unit Metrics Lab](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/unit-metrics-lab "mention") on Cloudthread's platform. -## Event Overlay Ingestion +## Event Overlay ingestion -Cloudthread provides the ability to send webhook Events that can be overlayed on top of your Cost Views and Unit Metrics. +Cloudthread provides the ability to send **webhook** **events** that can be overlayed on top of your [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention") and [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention"). See [Events Overlay](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/events-overlay "mention") for more details. {% content-ref url="events.md" %} [events.md](events.md) {% endcontent-ref %} -Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab** on Cloudthread's platform. +Data sent via this API will appear in [Costs Overview](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/costs-overview "mention") and [Unit Metrics Lab](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/unit-metrics-lab "mention") on Cloudthread's platform. -## Tag Catalog Fetch +## Tag Catalog fetch -Cloudthread provides the ability to fetch a Tag Catalog entry via catalog key. +Cloudthread provides the ability to fetch a [Tags Catalog](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/tag-assistant/tag-catalogs "mention") entry via catalog key. {% content-ref url="tag_catalog.md" %} [tag\_catalog.md](tag\_catalog.md) {% endcontent-ref %} -## Cost View and Unit Metric Data Fetch +## Cost View and Unit Metric Data fetch -Cloudthread provides the ability to fetch a Cost View and Unit Metric data. +Cloudthread provides the ability to fetch [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention") and [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention") data. {% content-ref url="metrics.md" %} [metrics.md](metrics.md) @@ -58,7 +68,7 @@ Cloudthread provides the ability to fetch a Cost View and Unit Metric data. ## Users and Teams setup -API can be used to set up Users and Teams. +API can be used to set up and change **Users** (see [User Management](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/account-and-team-management "mention")) and [Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/teams "mention"). {% content-ref url="users.md" %} [users.md](users.md) @@ -67,3 +77,11 @@ API can be used to set up Users and Teams. {% content-ref url="teams.md" %} [teams.md](teams.md) {% endcontent-ref %} + +## Savings Hub manipulation + +API to retrive and setup [Savings Opportunities](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-savings/key-concepts/optimization-opportunities "mention") and [Savings Threads](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-savings/key-concepts/savings-threads "mention"). + +{% content-ref url="savings-hub/" %} +[savings-hub](savings-hub/) +{% endcontent-ref %} diff --git a/reference/api-reference/custom_data.md b/reference/api-reference/custom_data.md index 52a0dff..1787b6b 100644 --- a/reference/api-reference/custom_data.md +++ b/reference/api-reference/custom_data.md @@ -1,14 +1,18 @@ # Data Ingestion -Cloudthread can process custom data for generating Cost Views and Unit Metrics. +Cloudthread can process custom data for generating [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention") and [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention"). -In order to send custom data, you must provision a **Custom Data - Data Stream Token** on the Cloudthread platform within the **Settings** tab. +In order to send custom data, you must provision a **Custom Data - Data Stream Token** on the Cloudthread platform within the [Settings](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings "mention") tab. + +{% hint style="info" %} +See more in [Ingesting Custom Data](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/guides/monitoring-cloud-costs/ingesting-custom-data "mention") guide. +{% endhint %} {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/streams/ingest" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -To send custom data to Cloudthread, use the endpoint above with the provisioned Data Stream Token and the following payload +To send custom data to Cloudthread, use the endpoint above with the provisioned **Data Stream Token** and the following payload: ```json { @@ -35,10 +39,10 @@ To send custom data to Cloudthread, use the endpoint above with the provisioned * `mertic_value`: float convertiable value of the metric. * `custom_dimensions`: map of **up to 10** key value pairs that you will be able to segment the data by on the Cloudthread platform. -If the data pass validation and successfully save you'll receive a `201` status code. - -Cloudthread creates a record ID for each data point by hashing the metric name, metric aggreation function, and the custom dimensions into a single key. To update a data point that's already been sent, the incoming data point must match along these fields -- otherwise a new data point will be generated. You can then update a given timestamp and metric value pair by sending in the matching timestamp with a new metric value. - -{% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. +{% hint style="success" %} +If the data pass **validation** and successfully save you'll receive a `201` status code. {% endhint %} + +* Cloudthread creates a record ID for each data point by hashing the metric name, metric aggregation function, and the custom dimensions into a single key. +* To update a data point that's already been sent, the incoming data point must match along these fields -- otherwise a new data point will be generated. +* You can then update a given timestamp and metric value pair by sending in the matching timestamp with a new metric value. diff --git a/reference/api-reference/events.md b/reference/api-reference/events.md index 8677cae..4ba707b 100644 --- a/reference/api-reference/events.md +++ b/reference/api-reference/events.md @@ -2,13 +2,13 @@ ## Event Overlay Ingestion -Cloudthread can process webhook events that can be overlayed on top of your Cost Views and Unit Metrics. +Cloudthread can process **webhook events** that can be overlayed on top of your [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention") and [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention"). {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/events" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -To send events data to Cloudthread, use the endpoint above and the following payload +To send events data to Cloudthread, use the endpoint above and the following payload: ```json { @@ -28,15 +28,13 @@ To send events data to Cloudthread, use the endpoint above and the following pay ``` * `timestamp`: datetime with **hourly** granularity. Any timestamp with minutes, seconds, etc. will be rejected. E.g. `'2022-10-01 00:00:00'`. To send daily data, send data with the timepart = `00:00:00`. -* `team_id`: OPITIONAL - integer ID of the team for which the event is tied. If this value is set, only users on this team (and admins) will be able to see this event on the platform. Invalid team IDs will be rejected. +* `team_id`: OPITIONAL – integer ID of the team for which the event is tied. If this value is set, only users on this team (and admins) will be able to see this event on the platform. Invalid team IDs will be rejected. * `decscription`: text describing event. -* `type`: event type to help organize and filter events on the platform - please ensure types are consistent across events to create easy filtering. -* `event_url`: OPTIONAL - link to get more information about the sent event. +* `type`: event type to help organize and filter events on the platform – please ensure types are consistent across events to create easy filtering. +* `event_url`: OPTIONAL – link to get more information about the sent event. -If the data pass validation and successfully save you'll receive a `201` status code. - -Data sent via this API will appear in **Costs Overview** and **Unit Metrics Lab** on Cloudthread's platform. - -{% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. +{% hint style="success" %} +If the data pass **validation** and successfully save you'll receive a `201` status code. {% endhint %} + +Data sent via this API will appear in [Costs Overview](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/costs-overview "mention") and [Unit Metrics Lab](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/unit-metrics-lab "mention") on Cloudthread's platform. diff --git a/reference/api-reference/metrics.md b/reference/api-reference/metrics.md index d747a5e..6ee5023 100644 --- a/reference/api-reference/metrics.md +++ b/reference/api-reference/metrics.md @@ -2,38 +2,52 @@ ## Cost View Fetch -Cloudthread provides the ability to query your [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view). +Cloudthread provides the ability to query your [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention"). {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/cost/metric/{metric_id}" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -* `metric_id`: the ID of the Cost View you wish to query. +To query [Cost Views](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-transparency/key-concepts/cost-view "mention"), use the endpoint above and the following query parameters: -To query Cost Views, use the endpoint above and the following query parameters +* Path (go after `/` in the URL) + * `metric_id`: the ID of the Cost View you wish to query +* Query (go after `?` in the URL) + * `start_date`: start date of the timeframe you wish to query – formatted as YYYY-MM-DD, required + * `end_date`: inclusive end date of the timeframe you wish to query – formatted as YYYY-MM-DD + * `cost_type`: OPTIONAL – specifies the cost type (Unblended, Public, etc.) + * `amortization`: OPTIONAL – specifies if to include amortization + * `exclude`: OPTIONAL – specifies if to exclude taxes, refunds, etc. + * `granularity`: OPTIONAL – specifies the data granularity (hour, day, week, quarter, year) -* `start_date`: start date of the timeframe you wish to query - formatted as YYYY-MM-DD -* `end_date`: inclusive end date of the timeframe you wish to query - formatted as YYYY-MM-DD - -If the data pass validation a `200` status code. +{% hint style="info" %} +If the data pass **validation** a `200` status code. +{% endhint %} ## Unit Metric Fetch -Cloudthread provides the ability to query your [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric). +Cloudthread provides the ability to query your [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention"). {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/unit/metric/{metric_id}" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -* `metric_id`: the ID of the Unit Metric you wish to query. - -To query Unit Metrics, use the endpoint above and the following query parameters +To query [Unit Metrics](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/unit-metrics/key-concepts/unit-metric "mention") use the endpoint above and the following query parameters: -* `start_date`: start date of the timeframe you wish to query - formatted as YYYY-MM-DD -* `end_date`: inclusive end date of the timeframe you wish to query - formatted as YYYY-MM-DD - -If the data pass validation a `200` status code. +* Path (go after `/` in the URL) + * `metric_id`: the ID of the Unit Metric you wish to query. +* Query (go after `?` in the URL) + * `start_date`: start date of the timeframe you wish to query - formatted as YYYY-MM-DD + * `end_date`: inclusive end date of the timeframe you wish to query - formatted as YYYY-MM-DD + * `cost_type`: OPTIONAL – specifies the cost type (Unblended, Public, etc.) + * `amortization`: OPTIONAL – specifies if to include amortization + * `exclude`: OPTIONAL – specifies if to exclude taxes, refunds, etc. + * `granularity`: OPTIONAL – specifies the data granularity (hour, day, week, quarter, year) {% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. +If the data pass **validation** a `200` status code. +{% endhint %} + +{% hint style="success" %} +See the response data **schema** at the method description above. {% endhint %} diff --git a/reference/api-reference/savings-hub.md b/reference/api-reference/savings-hub.md deleted file mode 100644 index f04f58d..0000000 --- a/reference/api-reference/savings-hub.md +++ /dev/null @@ -1,7 +0,0 @@ -# Savings Hub - - - -You can interact with Savings Hub via API. - -\ diff --git a/reference/api-reference/savings-hub/README.md b/reference/api-reference/savings-hub/README.md new file mode 100644 index 0000000..6779bcf --- /dev/null +++ b/reference/api-reference/savings-hub/README.md @@ -0,0 +1,2 @@ +# Savings Hub + diff --git a/reference/api-reference/savings-hub/opportunities-explorer.md b/reference/api-reference/savings-hub/opportunities-explorer.md new file mode 100644 index 0000000..dc73ad4 --- /dev/null +++ b/reference/api-reference/savings-hub/opportunities-explorer.md @@ -0,0 +1,7 @@ +# Opportunities Explorer + +This API allows to work with [Savings Opportunities](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/cost-savings/key-concepts/optimization-opportunities "mention"). + +{% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/cost-optimization/opportunities/list" method="post" %} +[https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) +{% endswagger %} diff --git a/reference/api-reference/tag_catalog.md b/reference/api-reference/tag_catalog.md index 77465db..488caa5 100644 --- a/reference/api-reference/tag_catalog.md +++ b/reference/api-reference/tag_catalog.md @@ -2,16 +2,16 @@ ## Tag Catalog Fetch -Cloudthread provides the ability to fetch a Tag Catalog entry via catalog key. +Cloudthread provides the ability to fetch a [Tags Catalog](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/tag-assistant/tag-catalogs "mention") entry via catalog key. + +{% hint style="info" %} +See [Setting up Tag Catalog](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/guides/tagging-cloud-resources/setting-up-tag-catalog "mention") guide for more details. +{% endhint %} {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/tag-catalog" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -To query Tag Catalog, use the endpoint above and the following query parameters +To query [Tags Catalog](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/tag-assistant/tag-catalogs "mention"), use the endpoint above and the following query parameters * `catalog_key`: the ID of the Catalog entry you wish to query - -{% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. -{% endhint %} \ No newline at end of file diff --git a/reference/api-reference/teams.md b/reference/api-reference/teams.md index 667e016..64431af 100644 --- a/reference/api-reference/teams.md +++ b/reference/api-reference/teams.md @@ -1,32 +1,28 @@ # Teams -Cloudthread platform allows for manipulation of [Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/teams "mention") via an API. +Cloudthread platform allows for manipulation of [Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/teams "mention") via an API. See [Setting up Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/guides/onboarding/setting-up-teams "mention") for a guide on setting up teams through the UI. -{% hint style="info" %} +{% hint style="success" %} You can **create**, **edit**, and **delete** Teams via Cloudthread's API. -{% endhint %} -{% hint style="info" %} -See [Setting up Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/guides/onboarding/setting-up-teams "mention") for a guide on setting up teams through the UI. +See the API method specifications to learn more about the parameters of paths, queries, and responses. {% endhint %} ## Team POST -Creating new team. - {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -## Team PATCH +To create a new Team (see [Teams](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/teams "mention")) you need to issue a **POST** request with the team definition parameters in the form of **JSON** request body. -Editing the team. +## Team PATCH {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="patch" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -## Team Delete +## Team DELETE {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}" method="delete" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) @@ -44,24 +40,20 @@ Editing the team. [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -## Teams Assign Members +## Teams POST – Assign Members {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members/assign" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -## Teams Remove Members +## Teams POST – Remove Members {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members/delete" method="post" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} -## Teams GET Members +## Teams GET – Members List {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/teams/{team_id}/members" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} - -{% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. -{% endhint %} diff --git a/reference/api-reference/users.md b/reference/api-reference/users.md index fb4b187..e5a0fe3 100644 --- a/reference/api-reference/users.md +++ b/reference/api-reference/users.md @@ -1,14 +1,9 @@ # Users -You can fetch all users from the Cloudthread API to assign team members. +Cloudthread platform allows for manipulation of **Users** via an API. See [User Management](http://127.0.0.1:5000/s/XCkDKj2xeiQhlyRGF6Wr/fundamentals/settings/account-and-team-management "mention") to learn more about the User roles and functions. ## Users GET {% swagger src="https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml" path="/users" method="get" %} [https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml](https://raw.githubusercontent.com/cloudthread/docs-api/main/cldthrd_api.yaml) {% endswagger %} - - -{% hint style="info" %} -**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API. -{% endhint %}