Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
649 changes: 649 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions features/v2/cloud_cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ Feature: Cloud Cost Management
Then the response status is 200 OK
And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34"

@generated @skip @team:DataDog/ccm-roi
Scenario: Create a unit cost returns "Bad Request" response
Given operation "CreateUnitCost" enabled
And new "CreateUnitCost" request
And body with value {"data": {"attributes": {"denominator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "description": "Amortized cloud spend divided by the number of active users.", "name": "Cloud cost per active user", "numerator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "unit_label": "user"}, "type": "unit_cost"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ccm-roi
Scenario: Create a unit cost returns "Created" response
Given operation "CreateUnitCost" enabled
And new "CreateUnitCost" request
And body with value {"data": {"attributes": {"denominator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "description": "Amortized cloud spend divided by the number of active users.", "name": "Cloud cost per active user", "numerator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "unit_label": "user"}, "type": "unit_cost"}}
When the request is sent
Then the response status is 201 Created

@replay-only @team:DataDog/cloud-cost-management
Scenario: Create custom allocation rule returns "OK" response
Given new "CreateCustomAllocationRule" request
Expand Down Expand Up @@ -253,6 +269,30 @@ Feature: Cloud Cost Management
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ccm-roi
Scenario: Delete a unit cost returns "Bad Request" response
Given operation "DeleteUnitCost" enabled
And new "DeleteUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ccm-roi
Scenario: Delete a unit cost returns "No Content" response
Given operation "DeleteUnitCost" enabled
And new "DeleteUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/ccm-roi
Scenario: Delete a unit cost returns "Not Found" response
Given operation "DeleteUnitCost" enabled
And new "DeleteUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Delete budget returns "No Content" response
Given new "DeleteBudget" request
Expand Down Expand Up @@ -399,6 +439,30 @@ Feature: Cloud Cost Management
And the response "data.type" is equal to "ruleset"
And the response "data.attributes.name" is equal to "EVP Cost Tags"

@generated @skip @team:DataDog/ccm-roi
Scenario: Get a unit cost returns "Bad Request" response
Given operation "GetUnitCost" enabled
And new "GetUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ccm-roi
Scenario: Get a unit cost returns "Not Found" response
Given operation "GetUnitCost" enabled
And new "GetUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ccm-roi
Scenario: Get a unit cost returns "OK" response
Given operation "GetUnitCost" enabled
And new "GetUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Get account filters returns "Bad Request" response
Given new "GetCostAccountFilters" request
Expand Down Expand Up @@ -885,6 +949,13 @@ Feature: Cloud Cost Management
Then the response status is 200 OK
And the response "data[0].attributes.name" is equal to "New Ruleset"

@generated @skip @team:DataDog/ccm-roi
Scenario: List unit costs returns "OK" response
Given operation "ListUnitCosts" enabled
And new "ListUnitCosts" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Reorder custom allocation rules returns "Successfully reordered rules" response
Given new "ReorderCustomAllocationRules" request
Expand Down Expand Up @@ -974,6 +1045,33 @@ Feature: Cloud Cost Management
Then the response status is 200 OK
And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34"

@generated @skip @team:DataDog/ccm-roi
Scenario: Update a unit cost returns "Bad Request" response
Given operation "UpdateUnitCost" enabled
And new "UpdateUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"denominator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "description": "Amortized cloud spend divided by the number of active users.", "name": "Cloud cost per active user", "numerator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "unit_label": "user"}, "id": "64aecd58-e355-4f07-9c3a-56ff6bda6cd8", "type": "unit_cost"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ccm-roi
Scenario: Update a unit cost returns "Not Found" response
Given operation "UpdateUnitCost" enabled
And new "UpdateUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"denominator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "description": "Amortized cloud spend divided by the number of active users.", "name": "Cloud cost per active user", "numerator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "unit_label": "user"}, "id": "64aecd58-e355-4f07-9c3a-56ff6bda6cd8", "type": "unit_cost"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ccm-roi
Scenario: Update a unit cost returns "OK" response
Given operation "UpdateUnitCost" enabled
And new "UpdateUnitCost" request
And request contains "unit_cost_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"denominator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "description": "Amortized cloud spend divided by the number of active users.", "name": "Cloud cost per active user", "numerator_query": {"formulas": [{"formula": "numerator"}], "queries": [{"data_source": "cloud_cost", "name": "numerator", "query": "sum:aws.cost.net.amortized.shared.resources.allocated{*}.rollup(sum, daily)"}]}, "unit_label": "user"}, "id": "64aecd58-e355-4f07-9c3a-56ff6bda6cd8", "type": "unit_cost"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-cost-management
Scenario: Update account filters returns "Bad Request" response
Given new "UpdateCostAccountFilters" request
Expand Down
37 changes: 37 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,43 @@
"type": "safe"
}
},
"ListUnitCosts": {
"tag": "Cloud Cost Management",
"undo": {
"type": "safe"
}
},
"CreateUnitCost": {
"tag": "Cloud Cost Management",
"undo": {
"operationId": "DeleteUnitCost",
"parameters": [
{
"name": "unit_cost_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteUnitCost": {
"tag": "Cloud Cost Management",
"undo": {
"type": "idempotent"
}
},
"GetUnitCost": {
"tag": "Cloud Cost Management",
"undo": {
"type": "safe"
}
},
"UpdateUnitCost": {
"tag": "Cloud Cost Management",
"undo": {
"type": "idempotent"
}
},
"GetActiveBillingDimensions": {
"tag": "Usage Metering",
"undo": {
Expand Down
35 changes: 35 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8499,6 +8499,41 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "CostTagsResponse",
},
"CloudCostManagementApi.V2.ListUnitCosts": {
operationResponseType: "UnitCostsResponse",
},
"CloudCostManagementApi.V2.CreateUnitCost": {
body: {
type: "UnitCostCreateRequest",
format: "",
},
operationResponseType: "UnitCostResponse",
},
"CloudCostManagementApi.V2.GetUnitCost": {
unitCostId: {
type: "string",
format: "uuid",
},
operationResponseType: "UnitCostResponse",
},
"CloudCostManagementApi.V2.UpdateUnitCost": {
unitCostId: {
type: "string",
format: "uuid",
},
body: {
type: "UnitCostUpdateRequest",
format: "",
},
operationResponseType: "UnitCostResponse",
},
"CloudCostManagementApi.V2.DeleteUnitCost": {
unitCostId: {
type: "string",
format: "uuid",
},
operationResponseType: "{}",
},
"CloudCostManagementApi.V2.ListTagPipelinesRulesets": {
operationResponseType: "RulesetRespArray",
},
Expand Down
Loading
Loading