-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC-2181 - add docs for Billing Engine setup APIs. Supports AWS and Azure configurations. #695
Closed
paul-van-wichen
wants to merge
1
commit into
master
from
DOC-2181-API-routes-for-FinOps-BE-setup-APIs
+332
−11
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
api/services/beci/setup/paths/cloudBillingV1SetupAccount.yaml
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (please put a space between "set" and "up") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set up Billing Engine (please put a space between "set" and "up") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
get: | ||
tags: | ||
- Accounts | ||
summary: Get Billing Engine Registered Accounts | ||
description: Get list of Spot accounts where Billing Engine has been setup. | ||
operationId: listAccountsCloudBillingV1SetupAccountGet | ||
parameters: | ||
- name: paginationSize | ||
in: query | ||
required: false | ||
schema: | ||
type: integer | ||
description: Number of items to include in the response | ||
description: Number of items to include in the response | ||
- name: paginationKey | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
description: Key used to fetch a specific page of items | ||
description: Key used to fetch a specific page of items | ||
responses: | ||
'200': | ||
$ref: ../responses/get200cloudBillingV1SetupAccount.yaml | ||
'400': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Invalid request error response. Adjust the request before retrying. | ||
'404': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Not found error response. The requested resource does not exist. | ||
'422': | ||
description: Error response. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
post: | ||
tags: | ||
- Accounts | ||
summary: Setup Billing Engine | ||
description: Sets up and enables Billing Engine functionality on a Spot account. The Spot account must already have credentials and be linked to a valid cloud provider account (e.g. AWS account, Azure billing account, etc). | ||
operationId: setupAccountCloudBillingV1SetupAccountPost | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../schemas/BERegisteredSetupAccountUpdateRequest.yaml | ||
responses: | ||
'200': | ||
$ref: ../responses/post200cloudBillingV1SetupAccount.yaml | ||
'400': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Invalid request error response. Adjust the request before retrying. | ||
'404': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Not found error response. The requested resource does not exist. | ||
'422': | ||
description: Error response. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml |
33 changes: 33 additions & 0 deletions
33
api/services/beci/setup/paths/cloudBillingV1SetupAccountValidation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
post: | ||
tags: | ||
- Accounts | ||
summary: Perform Billing Engine Setup Validations | ||
description: Validate that Billing Engine can be setup on the specified Spot Account. | ||
operationId: validateSetupAccountCloudBillingV1SetupAccountValidationPost | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../schemas/BERegisteredSetupAccountUpdateRequest.yaml | ||
responses: | ||
'200': | ||
$ref: ../responses/post200cloudBillingV1SetupAccountValidation.yaml | ||
'400': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Invalid request error response. Adjust the request before retrying. | ||
'404': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml | ||
description: Not found error response. The requested resource does not exist. | ||
'422': | ||
description: Error response. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../../../commons/schemas/errorResponse.yaml |
24 changes: 24 additions & 0 deletions
24
api/services/beci/setup/responses/get200cloudBillingV1SetupAccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml | ||
- type: object | ||
properties: | ||
request: | ||
type: object | ||
properties: | ||
url: | ||
example: /cloudBilling/v1/setup/account | ||
method: | ||
example: GET | ||
response: | ||
type: object | ||
properties: | ||
items: | ||
type: array | ||
items: | ||
$ref: ../schemas/setupBERegisteredAccountWithStatusResponse.yaml | ||
kind: | ||
example: spotinst:cloudBilling:beRegisteredAccount |
24 changes: 24 additions & 0 deletions
24
api/services/beci/setup/responses/post200cloudBillingV1SetupAccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: ../../../../commons/schemas/responseItemWrapper.yaml | ||
- type: object | ||
properties: | ||
request: | ||
type: object | ||
properties: | ||
url: | ||
example: /cloudBilling/v1/setup/account | ||
method: | ||
example: POST | ||
response: | ||
type: object | ||
properties: | ||
items: | ||
type: array | ||
items: | ||
$ref: ../schemas/setupCreateBERegisteredAccountResponse.yaml | ||
kind: | ||
example: spotinst:cloudBilling:beRegisteredAccount |
24 changes: 24 additions & 0 deletions
24
api/services/beci/setup/responses/post200cloudBillingV1SetupAccountValidation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: ../../../../commons/schemas/responseItemWrapper.yaml | ||
- type: object | ||
properties: | ||
request: | ||
type: object | ||
properties: | ||
url: | ||
example: /cloudBilling/v1/setup/account/validation | ||
method: | ||
example: POST | ||
response: | ||
type: object | ||
properties: | ||
items: | ||
type: array | ||
items: | ||
$ref: ../schemas/validationModelResponse.yaml | ||
kind: | ||
example: spotinst:cbi:accountRegistrationValidation |
9 changes: 9 additions & 0 deletions
9
api/services/beci/setup/schemas/BERegisteredSetupAccountAwsConfig.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
properties: | ||
billingSource: | ||
$ref: BERegisteredSetupAccountAwsConfigBillingSource.yaml | ||
description: Configuration settings used to collect AWS billing data. | ||
type: object | ||
required: | ||
- billingSource | ||
title: BERegisteredSetupAccountAwsConfig | ||
description: Configuration settings used to collect AWS billing data. Requires that the target Spot account is linked to an AWS account with billing data (e.g. master payer account). |
16 changes: 16 additions & 0 deletions
16
api/services/beci/setup/schemas/BERegisteredSetupAccountAwsConfigBillingSource.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
properties: | ||
bucket: | ||
type: string | ||
description: The name of the AWS S3 bucket where the AWS CUR is stored. | ||
region: | ||
type: string | ||
description: The AWS buckets AWS region (e.g. us-east-1). | ||
pathPrefix: | ||
type: string | ||
description: The prefix path and report name generated for the AWS CUR you configured. | ||
type: object | ||
required: | ||
- bucket | ||
- region | ||
- pathPrefix | ||
title: BERegisteredSetupAccountAwsConfigBillingSource |
4 changes: 4 additions & 0 deletions
4
api/services/beci/setup/schemas/BERegisteredSetupAccountAzureConfig.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
properties: {} | ||
type: object | ||
title: BERegisteredSetupAccountAzureConfig | ||
description: Configuration settings used to collect Azure billing data. Requires that the target Spot account is linked to an Azure billing account. |
16 changes: 16 additions & 0 deletions
16
api/services/beci/setup/schemas/BERegisteredSetupAccountUpdateRequest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
properties: | ||
accountId: | ||
type: string | ||
description: Spot Account ID. | ||
example: act-23432 | ||
config: | ||
anyOf: | ||
- type: object | ||
- $ref: BERegisteredSetupAccountAwsConfig.yaml | ||
- $ref: BERegisteredSetupAccountAzureConfig.yaml | ||
description: Configuration for the Billing Engine (e.g. location of the billing data) | ||
nullable: true | ||
type: object | ||
required: | ||
- accountId | ||
title: BERegisteredSetupAccountUpdateRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
api/services/beci/setup/schemas/setupBERegisteredAccountWithStatusResponse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
properties: | ||
accountId: | ||
type: string | ||
description: Spot Account ID. | ||
example: act-23432 | ||
organizationId: | ||
description: Spot Organization ID. | ||
example: '634563908342' | ||
type: string | ||
nullable: true | ||
cloudProvider: | ||
type: string | ||
description: Cloud provider. | ||
example: aws | ||
externalProviderId: | ||
type: string | ||
description: Cloud provider account ID. | ||
example: '435345634' | ||
externalProviderName: | ||
description: Cloud provider account name. | ||
example: Provider account name 1 | ||
type: string | ||
nullable: true | ||
enabledDate: | ||
type: string | ||
format: date-time | ||
description: Timestamp when the Spot account was onboarded to Billing Engine. | ||
example: '2019-08-24T14:15:22Z' | ||
updatedDate: | ||
type: string | ||
format: date-time | ||
description: Timestamp when Billing Engine config was last modified. | ||
example: '2019-08-24T14:15:22Z' | ||
statusSummary: | ||
$ref: accountStatusSummary.yaml | ||
description: Billing Engine account connection status. | ||
status: | ||
description: Billing Engine account status info. | ||
type: array | ||
items: | ||
$ref: accountStatusItem.yaml | ||
nullable: true | ||
type: object | ||
required: | ||
- accountId | ||
- organizationId | ||
- cloudProvider | ||
- externalProviderId | ||
- externalProviderName | ||
- enabledDate | ||
- updatedDate | ||
- statusSummary | ||
title: SetupBERegisteredAccountWithStatusResponse | ||
description: Represents a Spot account on which Billing Engine has been registered / enabled. [kind/spotinst:cloudBilling:beRegisteredAccount] |
44 changes: 44 additions & 0 deletions
44
api/services/beci/setup/schemas/setupCreateBERegisteredAccountResponse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
properties: | ||
accountId: | ||
type: string | ||
description: Spot Account ID. | ||
example: act-23432 | ||
organizationId: | ||
description: Spot Organization ID | ||
example: '634563908342' | ||
type: string | ||
nullable: true | ||
cloudProvider: | ||
type: string | ||
description: Cloud provider | ||
example: aws | ||
externalProviderId: | ||
type: string | ||
description: Cloud provider account ID | ||
example: '435345634' | ||
isBillingAccount: | ||
type: boolean | ||
description: True if Spot account is a billing account. | ||
enabledDate: | ||
type: string | ||
description: Timestamp when the Spot account was onboarded to Billing Engine. | ||
example: '2019-08-24T14:15:22Z' | ||
updatedDate: | ||
type: string | ||
description: Timestamp when Billing Engine config was last modified. | ||
example: '2019-08-24T14:15:22Z' | ||
config: | ||
description: Provider-specific configuration. | ||
type: object | ||
nullable: true | ||
type: object | ||
required: | ||
- accountId | ||
- organizationId | ||
- cloudProvider | ||
- externalProviderId | ||
- isBillingAccount | ||
- enabledDate | ||
- updatedDate | ||
title: SetupCreateBERegisteredAccountResponse | ||
description: Represents a Spot account on which Billing Engine has been registered / enabled. [kind/spotinst:cloudBilling:beRegisteredAccount] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate that Cost Intelligence can be set up on the specified Spot
Account. (please put a space between "set" and "up")