From 07c5c19749b83b2e042ec77b41df6c573084fdb3 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:36:00 +0000 Subject: [PATCH] Update description, operationId and examples for tag pipeline and custom allocation rules (#2709) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 334 +++++++-- ...trary-cost-rule-returns-OK-response.frozen | 1 - ...allocation-rule-returns-OK-response.frozen | 1 + ...m-allocation-rule-returns-OK-response.yml} | 12 +- .../Create-ruleset-returns-OK-response.frozen | 1 - ...ipeline-ruleset-returns-OK-response.frozen | 1 + ...-pipeline-ruleset-returns-OK-response.yml} | 6 +- ...st-rule-returns-No-Content-response.frozen | 1 - ...on-rule-returns-No-Content-response.frozen | 1 + ...tion-rule-returns-No-Content-response.yml} | 4 +- ...ruleset-returns-No-Content-response.frozen | 1 - ...ruleset-returns-No-Content-response.frozen | 1 + ...e-ruleset-returns-No-Content-response.yml} | 4 +- ...trary-cost-rule-returns-OK-response.frozen | 1 - ...rbitrary-cost-rule-returns-OK-response.yml | 21 - ...allocation-rule-returns-OK-response.frozen | 1 + ...om-allocation-rule-returns-OK-response.yml | 21 + .../Get-ruleset-returns-OK-response.frozen | 1 - .../Get-ruleset-returns-OK-response.yml | 22 - ...ipeline-ruleset-returns-OK-response.frozen | 1 + ...g-pipeline-ruleset-returns-OK-response.yml | 23 + ...rary-cost-rules-returns-OK-response.frozen | 1 - ...bitrary-cost-rules-returns-OK-response.yml | 21 - ...llocation-rules-returns-OK-response.frozen | 1 + ...m-allocation-rules-returns-OK-response.yml | 21 + .../List-rulesets-returns-OK-response.frozen | 1 - .../List-rulesets-returns-OK-response.yml | 22 - ...peline-rulesets-returns-OK-response.frozen | 1 + ...-pipeline-rulesets-returns-OK-response.yml | 23 + ...trary-cost-rule-returns-OK-response.frozen | 1 - ...allocation-rule-returns-OK-response.frozen | 1 + ...m-allocation-rule-returns-OK-response.yml} | 10 +- .../Update-ruleset-returns-OK-response.frozen | 1 - ...ipeline-ruleset-returns-OK-response.frozen | 1 + ...-pipeline-ruleset-returns-OK-response.yml} | 12 +- ...tRule.rb => CreateCustomAllocationRule.rb} | 6 +- ...uleset.rb => CreateTagPipelinesRuleset.rb} | 4 +- .../DeleteArbitraryCostRule.rb | 5 - .../DeleteCustomAllocationRule.rb | 5 + .../v2/cloud-cost-management/DeleteRuleset.rb | 5 - .../DeleteTagPipelinesRuleset.rb | 5 + .../GetArbitraryCostRule.rb | 5 - .../GetCustomAllocationRule.rb | 5 + ...etRuleset.rb => GetTagPipelinesRuleset.rb} | 2 +- .../GetTagPipelinesRuleset_2339377367.rb | 5 + .../ListArbitraryCostRules.rb | 5 - .../ListCustomAllocationRules.rb | 5 + .../v2/cloud-cost-management/ListRulesets.rb | 5 - .../ListTagPipelinesRulesets.rb | 5 + ...les.rb => ReorderCustomAllocationRules.rb} | 4 +- .../cloud-cost-management/ReorderRulesets.rb | 13 - .../ReorderTagPipelinesRulesets.rb | 22 + ...tRule.rb => UpdateCustomAllocationRule.rb} | 4 +- ...uleset.rb => UpdateTagPipelinesRuleset.rb} | 7 +- features/scenarios_model_mapping.rb | 20 +- features/v2/cloud_cost_management.feature | 209 +++--- features/v2/undo.json | 24 +- lib/datadog_api_client/inflector.rb | 1 + .../v2/api/cloud_cost_management_api.rb | 672 +++++++++--------- .../models/arbitrary_rule_response_array.rb | 16 +- .../arbitrary_rule_response_array_meta.rb | 105 +++ ...arbitrary_rule_response_data_attributes.rb | 12 +- .../v2/models/ruleset_resp_data_attributes.rb | 12 +- 63 files changed, 1087 insertions(+), 677 deletions(-) delete mode 100644 cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.frozen rename cassettes/features/v2/cloud_cost_management/{Update-arbitrary-cost-rule-returns-OK-response.yml => Create-custom-allocation-rule-returns-OK-response.yml} (52%) delete mode 100644 cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.frozen rename cassettes/features/v2/cloud_cost_management/{Create-ruleset-returns-OK-response.yml => Create-tag-pipeline-ruleset-returns-OK-response.yml} (75%) delete mode 100644 cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.frozen rename cassettes/features/v2/cloud_cost_management/{Delete-arbitrary-cost-rule-returns-No-Content-response.yml => Delete-custom-allocation-rule-returns-No-Content-response.yml} (69%) delete mode 100644 cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.frozen rename cassettes/features/v2/cloud_cost_management/{Delete-ruleset-returns-No-Content-response.yml => Delete-tag-pipeline-ruleset-returns-No-Content-response.yml} (65%) delete mode 100644 cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.frozen delete mode 100644 cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.yml create mode 100644 cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.yml delete mode 100644 cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.frozen delete mode 100644 cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.yml create mode 100644 cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.yml delete mode 100644 cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.frozen delete mode 100644 cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.yml create mode 100644 cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.yml delete mode 100644 cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.frozen delete mode 100644 cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.yml create mode 100644 cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.yml delete mode 100644 cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.frozen rename cassettes/features/v2/cloud_cost_management/{Create-arbitrary-cost-rule-returns-OK-response.yml => Update-custom-allocation-rule-returns-OK-response.yml} (67%) delete mode 100644 cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.frozen rename cassettes/features/v2/cloud_cost_management/{Update-ruleset-returns-OK-response.yml => Update-tag-pipeline-ruleset-returns-OK-response.yml} (55%) rename examples/v2/cloud-cost-management/{UpdateArbitraryCostRule.rb => CreateCustomAllocationRule.rb} (92%) rename examples/v2/cloud-cost-management/{CreateRuleset.rb => CreateTagPipelinesRuleset.rb} (91%) delete mode 100644 examples/v2/cloud-cost-management/DeleteArbitraryCostRule.rb create mode 100644 examples/v2/cloud-cost-management/DeleteCustomAllocationRule.rb delete mode 100644 examples/v2/cloud-cost-management/DeleteRuleset.rb create mode 100644 examples/v2/cloud-cost-management/DeleteTagPipelinesRuleset.rb delete mode 100644 examples/v2/cloud-cost-management/GetArbitraryCostRule.rb create mode 100644 examples/v2/cloud-cost-management/GetCustomAllocationRule.rb rename examples/v2/cloud-cost-management/{GetRuleset.rb => GetTagPipelinesRuleset.rb} (65%) create mode 100644 examples/v2/cloud-cost-management/GetTagPipelinesRuleset_2339377367.rb delete mode 100644 examples/v2/cloud-cost-management/ListArbitraryCostRules.rb create mode 100644 examples/v2/cloud-cost-management/ListCustomAllocationRules.rb delete mode 100644 examples/v2/cloud-cost-management/ListRulesets.rb create mode 100644 examples/v2/cloud-cost-management/ListTagPipelinesRulesets.rb rename examples/v2/cloud-cost-management/{ReorderArbitraryCostRules.rb => ReorderCustomAllocationRules.rb} (83%) delete mode 100644 examples/v2/cloud-cost-management/ReorderRulesets.rb create mode 100644 examples/v2/cloud-cost-management/ReorderTagPipelinesRulesets.rb rename examples/v2/cloud-cost-management/{CreateArbitraryCostRule.rb => UpdateCustomAllocationRule.rb} (94%) rename examples/v2/cloud-cost-management/{UpdateRuleset.rb => UpdateTagPipelinesRuleset.rb} (82%) create mode 100644 lib/datadog_api_client/v2/models/arbitrary_rule_response_array_meta.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 10a5a5875cde..82aecd68139a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4260,7 +4260,7 @@ components: provider: - aws - gcp - rule_name: Example Arbitrary Cost Rule + rule_name: Example custom allocation rule strategy: allocated_by_tag_keys: - team @@ -4289,15 +4289,145 @@ components: type: object ArbitraryRuleResponseArray: description: The definition of `ArbitraryRuleResponseArray` object. + example: + data: + - attributes: + costs_to_allocate: + - condition: like + tag: service + value: orgstore-csm* + values: null + created: '2024-11-20T03:44:37Z' + enabled: true + last_modified_user_uuid: user-example-uuid + order_id: 1 + processing_status: done + provider: + - gcp + rule_name: gcp-orgstore-csm-team-allocation + strategy: + allocated_by: + - allocated_tags: + - key: team + value: csm-activation + percentage: 0.34 + - allocated_tags: + - key: team + value: csm-agentless + percentage: 0.66 + method: percent + type: shared + updated: '2025-09-02T21:28:32Z' + version: 1 + id: '19' + type: arbitrary_rule + - attributes: + costs_to_allocate: + - condition: is + tag: env + value: staging + values: null + created: '2025-05-27T18:48:05Z' + enabled: true + last_modified_user_uuid: user-example-uuid-2 + order_id: 2 + processing_status: done + provider: + - aws + rule_name: test-even-2 + strategy: + allocated_by_tag_keys: + - team + based_on_costs: + - condition: is + tag: aws_product + value: s3 + values: null + granularity: daily + method: even + type: shared + updated: '2025-09-03T21:00:49Z' + version: 1 + id: '311' + type: arbitrary_rule + - attributes: + costs_to_allocate: + - condition: is + tag: servicename + value: s3 + values: null + created: '2025-03-21T20:42:40Z' + enabled: false + last_modified_user_uuid: user-example-uuid-3 + order_id: 3 + processing_status: done + provider: + - aws + rule_name: test-s3-timeseries + strategy: + granularity: daily + method: proportional_timeseries + type: shared + updated: '2025-09-02T21:16:50Z' + version: 1 + id: '289' + type: arbitrary_rule + - attributes: + costs_to_allocate: + - condition: '=' + tag: aws_product + value: msk + values: null + - condition: is + tag: product + value: 'null' + values: null + created: '2025-08-27T14:39:31Z' + enabled: true + last_modified_user_uuid: user-example-uuid-4 + order_id: 4 + processing_status: done + provider: + - aws + rule_name: azure-unallocated-by-product-2 + strategy: + allocated_by_tag_keys: + - aws_product + based_on_costs: + - condition: '=' + tag: aws_product + value: msk + values: null + - condition: is not + tag: product + value: 'null' + values: null + granularity: daily + method: proportional + type: shared + updated: '2025-09-02T21:28:32Z' + version: 1 + id: '523' + type: arbitrary_rule properties: data: description: The `ArbitraryRuleResponseArray` `data`. items: $ref: '#/components/schemas/ArbitraryRuleResponseData' type: array + meta: + $ref: '#/components/schemas/ArbitraryRuleResponseArrayMeta' required: - data type: object + ArbitraryRuleResponseArrayMeta: + description: The `ArbitraryRuleResponseArray` `meta`. + properties: + total_count: + description: The `meta` `total_count`. + format: int64 + type: integer + type: object ArbitraryRuleResponseData: description: The definition of `ArbitraryRuleResponseData` object. properties: @@ -4337,6 +4467,10 @@ components: example: 0 format: int64 type: integer + processing_status: + description: The `attributes` `processing_status`. + example: '' + type: string provider: description: The `attributes` `provider`. example: @@ -38486,6 +38620,14 @@ components: - ARBITRARY_RULE ReorderRulesetResourceArray: description: The definition of `ReorderRulesetResourceArray` object. + example: + data: + - id: 55ef2385-9ae1-4410-90c4-5ac1b60fec10 + type: ruleset + - id: a7b8c9d0-1234-5678-9abc-def012345678 + type: ruleset + - id: f1e2d3c4-b5a6-9780-1234-567890abcdef + type: ruleset properties: data: description: The `ReorderRulesetResourceArray` `data`. @@ -39746,6 +39888,82 @@ components: type: object RulesetRespArray: description: The definition of `RulesetRespArray` object. + example: + data: + - attributes: + created: null + enabled: true + last_modified_user_uuid: '' + modified: null + name: Production Cost Allocation Rules + position: 0 + rules: + - enabled: true + mapping: null + metadata: null + name: AWS Production Account Tagging + query: + addition: + key: environment + value: production + case_insensitivity: false + if_not_exists: true + query: billingcurrency:"USD" AND account_name:"prod-account" + reference_table: null + - enabled: true + mapping: + destination_key: team_owner + if_not_exists: true + source_keys: + - account_name + - service + metadata: null + name: Team Mapping Rule + query: null + reference_table: null + - enabled: true + mapping: null + metadata: null + name: New table rule with new UI + query: null + reference_table: + case_insensitivity: true + field_pairs: + - input_column: status_type + output_key: status + - input_column: status_description + output_key: dess + if_not_exists: false + source_keys: + - http_status + - status_description + table_name: http_status_codes + version: 2 + id: 55ef2385-9ae1-4410-90c4-5ac1b60fec10 + type: ruleset + - attributes: + created: null + enabled: true + last_modified_user_uuid: '' + modified: null + name: Development Environment Rules + position: 0 + rules: + - enabled: true + mapping: null + metadata: null + name: Dev Account Cost Center + query: + addition: + key: cost_center + value: engineering + case_insensitivity: true + if_not_exists: true + query: account_name:"dev-*" + reference_table: null + version: 1 + id: a7b8c9d0-1234-5678-9abc-def012345678 + type: ruleset properties: data: description: The `RulesetRespArray` `data`. @@ -39793,6 +40011,10 @@ components: format: int32 maximum: 2147483647 type: integer + processing_status: + description: The `attributes` `processing_status`. + example: '' + type: string rules: description: The `attributes` `rules`. items: @@ -49984,7 +50206,20 @@ components: attributes: enabled: true last_version: 1 + name: Updated Ruleset rules: + - enabled: true + mapping: null + metadata: null + name: Add Cost Center Tag + query: + addition: + key: cost_center + value: engineering + case_insensitivity: false + if_not_exists: true + query: account_id:"123456789" AND service:"web-api" + reference_table: null - enabled: true mapping: destination_key: team_owner @@ -49996,6 +50231,23 @@ components: name: Account Name Mapping query: null reference_table: null + - enabled: true + mapping: null + metadata: null + name: New table rule with new UI + query: null + reference_table: + case_insensitivity: true + field_pairs: + - input_column: status_type + output_key: status + - input_column: status_description + output_key: dess + if_not_exists: false + source_keys: + - http_status + - status_description + table_name: http_status_codes type: update_ruleset properties: data: @@ -56472,9 +56724,9 @@ paths: permissions: [] /api/v2/cost/arbitrary_rule: get: - description: List all arbitrary cost rules - Retrieve a list of all arbitrary - cost rules for the organization - operationId: ListArbitraryCostRules + description: List all custom allocation rules - Retrieve a list of all custom + allocation rules for the organization + operationId: ListCustomAllocationRules responses: '200': content: @@ -56489,12 +56741,12 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: List arbitrary cost rules + summary: List custom allocation rules tags: - Cloud Cost Management post: - description: 'Create a new arbitrary cost rule with the specified filters and - allocation strategy. + description: 'Create a new custom allocation rule with the specified filters + and allocation strategy. **Strategy Methods:** @@ -56522,7 +56774,7 @@ paths: **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like' - operationId: CreateArbitraryCostRule + operationId: CreateCustomAllocationRule requestBody: content: application/json: @@ -56543,20 +56795,20 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Create arbitrary cost rule + summary: Create custom allocation rule tags: - Cloud Cost Management /api/v2/cost/arbitrary_rule/reorder: post: - description: "Reorder arbitrary cost rules - Change the execution order of arbitrary - cost rules.\n\n**Important**: You must provide the **complete list** of all - rule IDs in the desired execution order. The API will reorder ALL rules according - to the provided sequence.\n\nRules are executed in the order specified, with - lower indices (earlier in the array) having higher priority.\n\n**Example**: + description: "Reorder custom allocation rules - Change the execution order of + custom allocation rules.\n\n**Important**: You must provide the **complete + list** of all rule IDs in the desired execution order. The API will reorder + ALL rules according to the provided sequence.\n\nRules are executed in the + order specified, with lower indices (earlier in the array) having higher priority.\n\n**Example**: If you have rules with IDs [123, 456, 789] and want to change order from 123\u2192456\u2192789 to 456\u2192123\u2192789, send: [{\"id\": \"456\"}, {\"id\": \"123\"}, {\"id\": \"789\"}]" - operationId: ReorderArbitraryCostRules + operationId: ReorderCustomAllocationRules requestBody: content: application/json: @@ -56573,16 +56825,16 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Reorder arbitrary cost rules + summary: Reorder custom allocation rules tags: - Cloud Cost Management /api/v2/cost/arbitrary_rule/{rule_id}: delete: - description: Delete an arbitrary cost rule - Delete an existing arbitrary cost + description: Delete a custom allocation rule - Delete an existing custom allocation rule by its ID - operationId: DeleteArbitraryCostRule + operationId: DeleteCustomAllocationRule parameters: - - description: The unique identifier of the arbitrary cost rule + - description: The unique identifier of the custom allocation rule in: path name: rule_id required: true @@ -56599,15 +56851,15 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Delete arbitrary cost rule + summary: Delete custom allocation rule tags: - Cloud Cost Management get: - description: Get a specific arbitrary cost rule - Retrieve a specific arbitrary - cost rule by its ID - operationId: GetArbitraryCostRule + description: Get a specific custom allocation rule - Retrieve a specific custom + allocation rule by its ID + operationId: GetCustomAllocationRule parameters: - - description: The unique identifier of the arbitrary cost rule + - description: The unique identifier of the custom allocation rule in: path name: rule_id required: true @@ -56628,12 +56880,12 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: Get arbitrary cost rule + summary: Get custom allocation rule tags: - Cloud Cost Management patch: - description: 'Update an existing arbitrary cost rule with new filters and allocation - strategy. + description: 'Update an existing custom allocation rule with new filters and + allocation strategy. **Strategy Methods:** @@ -56663,9 +56915,9 @@ paths: **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like' - operationId: UpdateArbitraryCostRule + operationId: UpdateCustomAllocationRule parameters: - - description: The unique identifier of the arbitrary cost rule + - description: The unique identifier of the custom allocation rule in: path name: rule_id required: true @@ -56692,7 +56944,7 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Update arbitrary cost rule + summary: Update custom allocation rule tags: - Cloud Cost Management /api/v2/cost/aws_cur_config: @@ -74842,7 +75094,7 @@ paths: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization - operationId: ListRulesets + operationId: ListTagPipelinesRulesets responses: '200': content: @@ -74857,13 +75109,13 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: List rulesets + summary: List tag pipeline rulesets tags: - Cloud Cost Management post: description: Create a new tag pipeline ruleset with the specified rules and configuration - operationId: CreateRuleset + operationId: CreateTagPipelinesRuleset requestBody: content: application/json: @@ -74884,14 +75136,14 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Create ruleset + summary: Create tag pipeline ruleset tags: - Cloud Cost Management /api/v2/tags/enrichment/reorder: post: description: Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets - operationId: ReorderRulesets + operationId: ReorderTagPipelinesRulesets requestBody: content: application/json: @@ -74908,7 +75160,7 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Reorder rulesets + summary: Reorder tag pipeline rulesets tags: - Cloud Cost Management /api/v2/tags/enrichment/validate-query: @@ -74943,7 +75195,7 @@ paths: delete: description: Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID - operationId: DeleteRuleset + operationId: DeleteTagPipelinesRuleset parameters: - description: The unique identifier of the ruleset in: path @@ -74961,13 +75213,13 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Delete ruleset + summary: Delete tag pipeline ruleset tags: - Cloud Cost Management get: description: Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID - operationId: GetRuleset + operationId: GetTagPipelinesRuleset parameters: - description: The unique identifier of the ruleset in: path @@ -74995,7 +75247,7 @@ paths: patch: description: Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration - operationId: UpdateRuleset + operationId: UpdateTagPipelinesRuleset parameters: - description: The unique identifier of the ruleset in: path @@ -75023,7 +75275,7 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_write - summary: Update ruleset + summary: Update tag pipeline ruleset tags: - Cloud Cost Management /api/v2/team: diff --git a/cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.frozen deleted file mode 100644 index 694e0deed848..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-15T20:24:10.628Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.frozen new file mode 100644 index 000000000000..d9f8ee1fb96b --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:31:23.072Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.yml similarity index 52% rename from cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.yml rename to cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.yml index 8158bffbad09..a868819d2180 100644 --- a/cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Create-custom-allocation-rule-returns-OK-response.yml @@ -1,22 +1,22 @@ http_interactions: -- recorded_at: Thu, 11 Sep 2025 21:00:21 GMT +- recorded_at: Wed, 08 Oct 2025 19:31:23 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"costs_to_allocate":[{"condition":"is","tag":"account_id","value":"123456789","values":[]},{"condition":"in","tag":"environment","value":"","values":["production","staging"]}],"enabled":true,"order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"allocated_by_tag_keys":["team","environment"],"based_on_costs":[{"condition":"is","tag":"service","value":"web-api","values":[]},{"condition":"not + string: '{"data":{"attributes":{"costs_to_allocate":[{"condition":"is","tag":"account_id","value":"123456789"},{"condition":"in","tag":"environment","value":"","values":["production","staging"]}],"enabled":true,"order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"allocated_by_tag_keys":["team","environment"],"based_on_costs":[{"condition":"is","tag":"service","value":"web-api"},{"condition":"not in","tag":"team","value":"","values":["legacy","deprecated"]}],"granularity":"daily","method":"proportional"},"type":"shared"},"type":"upsert_arbitrary_rule"}}' headers: Accept: - application/json Content-Type: - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/123456 + method: POST + uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule response: body: encoding: UTF-8 - string: '{"data":{"id":"123456","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-09-11T20:59:19.952563Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not - in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-09-11T21:00:21.353162Z","version":1}}}' + string: '{"data":{"id":"683","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-10-08T19:31:23.246204745Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not + in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-10-08T19:31:23.246204745Z","version":1}}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.frozen deleted file mode 100644 index 8be30f84af40..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-16T16:51:02.186Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.frozen new file mode 100644 index 000000000000..335cd5995fc1 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T18:26:06.563Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.yml similarity index 75% rename from cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.yml rename to cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.yml index 32acbefb4212..8eed2b7a3399 100644 --- a/cassettes/features/v2/cloud_cost_management/Create-ruleset-returns-OK-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-returns-OK-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Tue, 16 Sep 2025 16:51:02 GMT +- recorded_at: Wed, 08 Oct 2025 18:26:06 GMT request: body: encoding: UTF-8 @@ -16,9 +16,9 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"1b680ec0-8e29-4b79-bb01-45f0c645a789","type":"ruleset","attributes":{"created":{"seconds":1758041403,"nanos":117388000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1758041403,"nanos":117388000},"name":"New + string: '{"data":{"id":"ee10c3ff-312f-464c-b4f6-46adaa6d00a1","type":"ruleset","attributes":{"created":{"seconds":1759947966,"nanos":679638000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1759947966,"nanos":679638000},"name":"New Ruleset","position":1,"rules":[{"name":"Add Cost Center Tag","enabled":true,"query":{"query":"account_id:\"123456789\" - AND service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3603412}}}' + AND service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3611102}}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.frozen b/cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.frozen deleted file mode 100644 index 5bba6c73e72b..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T21:01:36.419Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.frozen b/cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.frozen new file mode 100644 index 000000000000..3f009521ff8d --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:35:19.003Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.yml b/cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.yml similarity index 69% rename from cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.yml rename to cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.yml index 081f0590b87b..aa9857ef6136 100644 --- a/cassettes/features/v2/cloud_cost_management/Delete-arbitrary-cost-rule-returns-No-Content-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Delete-custom-allocation-rule-returns-No-Content-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 11 Sep 2025 21:01:36 GMT +- recorded_at: Wed, 08 Oct 2025 19:35:19 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/123456 + uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/683 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.frozen b/cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.frozen deleted file mode 100644 index 9ddc2f58a49b..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T20:43:38.898Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.frozen b/cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.frozen new file mode 100644 index 000000000000..9d25abe53b8f --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:17:11.635Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.yml b/cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.yml similarity index 65% rename from cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.yml rename to cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.yml index b7aa0993fe9b..a9708f0eba10 100644 --- a/cassettes/features/v2/cloud_cost_management/Delete-ruleset-returns-No-Content-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Delete-tag-pipeline-ruleset-returns-No-Content-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 11 Sep 2025 20:43:38 GMT +- recorded_at: Wed, 08 Oct 2025 19:17:11 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/tags/enrichment/1c5dae14-237d-4b9a-a515-aa55b3939142 + uri: https://api.datadoghq.com/api/v2/tags/enrichment/ee10c3ff-312f-464c-b4f6-46adaa6d00a1 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.frozen deleted file mode 100644 index 19ddeadc1428..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T18:25:21.818Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.yml deleted file mode 100644 index 74f013d0fa51..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Get-arbitrary-cost-rule-returns-OK-response.yml +++ /dev/null @@ -1,21 +0,0 @@ -http_interactions: -- recorded_at: Thu, 11 Sep 2025 18:25:21 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/123456 - response: - body: - encoding: UTF-8 - string: '{"data":{"id":"123456","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-09-11T18:23:20.518112Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not - in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-09-11T18:23:20.518112Z","version":1}}}' - headers: - Content-Type: - - application/vnd.api+json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.frozen new file mode 100644 index 000000000000..b1615e446934 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:33:08.375Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.yml new file mode 100644 index 000000000000..de6d05fa541e --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Get-custom-allocation-rule-returns-OK-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 08 Oct 2025 19:33:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/683 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"683","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-10-08T19:31:23.246204Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"processing_status":"error","provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not + in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-10-08T19:31:23.246204Z","version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.frozen deleted file mode 100644 index bd05b8d6aa12..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T18:54:36.821Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.yml deleted file mode 100644 index 70cf765a3e70..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Get-ruleset-returns-OK-response.yml +++ /dev/null @@ -1,22 +0,0 @@ -http_interactions: -- recorded_at: Thu, 11 Sep 2025 18:54:36 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/tags/enrichment/da0e30e2-615d-4dae-9a22-38cf86a87dde - response: - body: - encoding: UTF-8 - string: '{"data":{"id":"da0e30e2-615d-4dae-9a22-38cf86a87dde","type":"ruleset","attributes":{"created":{"seconds":1757616255,"nanos":64603000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1757616255,"nanos":64603000},"name":"New - Ruleset","position":1,"rules":[{"name":"Add Cost Center Tag","enabled":true,"query":{"query":"account_id:\"123456789\" - AND service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3601897}}}' - headers: - Content-Type: - - application/vnd.api+json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.frozen new file mode 100644 index 000000000000..4ef65e062fe9 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T18:38:56.657Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.yml new file mode 100644 index 000000000000..570c8dd7377f --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Get-tag-pipeline-ruleset-returns-OK-response.yml @@ -0,0 +1,23 @@ +http_interactions: +- recorded_at: Wed, 08 Oct 2025 18:38:56 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/tags/enrichment/ee10c3ff-312f-464c-b4f6-46adaa6d00a1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ee10c3ff-312f-464c-b4f6-46adaa6d00a1","type":"ruleset","attributes":{"created":{"seconds":1759947966,"nanos":679638000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1759947966,"nanos":679638000},"name":"New + Ruleset","position":1,"processing_status":"error","rules":[{"name":"Add Cost + Center Tag","enabled":true,"query":{"query":"account_id:\"123456789\" AND + service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3611102}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.frozen deleted file mode 100644 index ee4c66fe2ff0..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T18:24:00.228Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.yml deleted file mode 100644 index 3e90dd7ff257..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-arbitrary-cost-rules-returns-OK-response.yml +++ /dev/null @@ -1,21 +0,0 @@ -http_interactions: -- recorded_at: Thu, 11 Sep 2025 18:24:00 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule - response: - body: - encoding: UTF-8 - string: '{"data":[{"id":"123456","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-09-11T18:23:20.518112Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not - in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-09-11T18:23:20.518112Z","version":1}}]}' - headers: - Content-Type: - - application/vnd.api+json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.frozen new file mode 100644 index 000000000000..fd84464618d3 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:33:51.784Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.yml new file mode 100644 index 000000000000..58d56fc0cc07 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/List-custom-allocation-rules-returns-OK-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 08 Oct 2025 19:33:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"683","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-10-08T19:31:23.246204Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"processing_status":"error","provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not + in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-10-08T19:31:23.246204Z","version":1}}],"meta":{"total_count":1}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.frozen deleted file mode 100644 index 8bf4b1854aa6..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T20:35:14.784Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.yml deleted file mode 100644 index e7a92931d74a..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-rulesets-returns-OK-response.yml +++ /dev/null @@ -1,22 +0,0 @@ -http_interactions: -- recorded_at: Thu, 11 Sep 2025 20:35:14 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/tags/enrichment - response: - body: - encoding: UTF-8 - string: '{"data":[{"id":"1c5dae14-237d-4b9a-a515-aa55b3939142","type":"ruleset","attributes":{"created":{"seconds":1757622359,"nanos":552132000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1757622359,"nanos":552132000},"name":"New - Ruleset","position":1,"rules":[{"name":"Add Cost Center Tag","enabled":true,"query":{"query":"account_id:\"123456789\" - AND service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3601919}}]}' - headers: - Content-Type: - - application/vnd.api+json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.frozen new file mode 100644 index 000000000000..273f890ec7c9 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T18:35:31.385Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.yml new file mode 100644 index 000000000000..f0459d526d06 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/List-tag-pipeline-rulesets-returns-OK-response.yml @@ -0,0 +1,23 @@ +http_interactions: +- recorded_at: Wed, 08 Oct 2025 18:35:31 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/tags/enrichment + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"ee10c3ff-312f-464c-b4f6-46adaa6d00a1","type":"ruleset","attributes":{"created":{"seconds":1759947966,"nanos":679638000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1759947966,"nanos":679638000},"name":"New + Ruleset","position":1,"processing_status":"error","rules":[{"name":"Add Cost + Center Tag","enabled":true,"query":{"query":"account_id:\"123456789\" AND + service:\"web-api\"","addition":{"key":"cost_center","value":"engineering"},"if_not_exists":true,"case_insensitivity":false},"mapping":null,"reference_table":null,"metadata":null}],"version":3611102}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.frozen deleted file mode 100644 index ecb5b7648d82..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Update-arbitrary-cost-rule-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T21:00:21.176Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.frozen new file mode 100644 index 000000000000..3c37372ce8df --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:34:38.940Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.yml similarity index 67% rename from cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.yml rename to cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.yml index f8d4f48aad7f..431e33c7369e 100644 --- a/cassettes/features/v2/cloud_cost_management/Create-arbitrary-cost-rule-returns-OK-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Update-custom-allocation-rule-returns-OK-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Mon, 15 Sep 2025 20:24:10 GMT +- recorded_at: Wed, 08 Oct 2025 19:34:38 GMT request: body: encoding: UTF-8 @@ -10,13 +10,13 @@ http_interactions: - application/json Content-Type: - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule + method: PATCH + uri: https://api.datadoghq.com/api/v2/cost/arbitrary_rule/683 response: body: encoding: UTF-8 - string: '{"data":{"id":"435","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-09-15T20:23:11.705977625Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not - in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-09-15T20:23:11.705977625Z","version":1}}}' + string: '{"data":{"id":"683","type":"arbitrary_rule","attributes":{"costs_to_allocate":[{"tag":"account_id","condition":"is","value":"123456789","values":null},{"tag":"environment","condition":"in","value":"","values":["production","staging"]}],"created":"2025-10-08T19:31:23.246204Z","enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","order_id":1,"provider":["aws","gcp"],"rule_name":"example-arbitrary-cost-rule","strategy":{"method":"proportional","granularity":"daily","based_on_costs":[{"tag":"service","condition":"is","value":"web-api","values":null},{"tag":"team","condition":"not + in","value":"","values":["legacy","deprecated"]}],"allocated_by_tag_keys":["team","environment"]},"type":"shared","updated":"2025-10-08T19:34:39.054605Z","version":1}}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.frozen deleted file mode 100644 index 1d97407de7a8..000000000000 --- a/cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-09-11T20:42:36.765Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.frozen new file mode 100644 index 000000000000..3de83d426811 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:15:10.916Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.yml similarity index 55% rename from cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.yml rename to cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.yml index ebf528de15de..23b2cfab1b61 100644 --- a/cassettes/features/v2/cloud_cost_management/Update-ruleset-returns-OK-response.yml +++ b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-returns-OK-response.yml @@ -1,22 +1,22 @@ http_interactions: -- recorded_at: Thu, 11 Sep 2025 20:42:36 GMT +- recorded_at: Wed, 08 Oct 2025 19:15:10 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"enabled":true,"last_version":3601919,"rules":[{"enabled":true,"mapping":{"destination_key":"team_owner","if_not_exists":true,"source_keys":["account_name","account_id"]},"name":"Account - Name Mapping","query":null,"reference_table":null}]},"type":"update_ruleset"}}' + string: '{"data":{"attributes":{"enabled":true,"last_version":3611102,"rules":[{"enabled":true,"mapping":{"destination_key":"team_owner","if_not_exists":true,"source_keys":["account_name","account_id"]},"name":"Account + Name Mapping","query":null,"reference_table":null}]},"id":"New Ruleset","type":"update_ruleset"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/tags/enrichment/1c5dae14-237d-4b9a-a515-aa55b3939142 + uri: https://api.datadoghq.com/api/v2/tags/enrichment/ee10c3ff-312f-464c-b4f6-46adaa6d00a1 response: body: encoding: UTF-8 - string: '{"data":{"id":"1c5dae14-237d-4b9a-a515-aa55b3939142","type":"ruleset","attributes":{"created":{"seconds":1757623356,"nanos":940863000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1757623356,"nanos":940863000},"name":"New - Ruleset","position":1,"rules":[{"name":"Account Name Mapping","enabled":true,"query":null,"mapping":{"source_keys":["account_name","account_id"],"destination_key":"team_owner","if_not_exists":true},"reference_table":null,"metadata":null}],"version":3601923}}}' + string: '{"data":{"id":"ee10c3ff-312f-464c-b4f6-46adaa6d00a1","type":"ruleset","attributes":{"created":{"seconds":1759950911,"nanos":31873000},"enabled":true,"last_modified_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":{"seconds":1759950911,"nanos":31873000},"name":"New + Ruleset","position":1,"rules":[{"name":"Account Name Mapping","enabled":true,"query":null,"mapping":{"source_keys":["account_name","account_id"],"destination_key":"team_owner","if_not_exists":true},"reference_table":null,"metadata":null}],"version":3611113}}}' headers: Content-Type: - application/vnd.api+json diff --git a/examples/v2/cloud-cost-management/UpdateArbitraryCostRule.rb b/examples/v2/cloud-cost-management/CreateCustomAllocationRule.rb similarity index 92% rename from examples/v2/cloud-cost-management/UpdateArbitraryCostRule.rb rename to examples/v2/cloud-cost-management/CreateCustomAllocationRule.rb index 83cb109d4beb..ee6f5e383ba5 100644 --- a/examples/v2/cloud-cost-management/UpdateArbitraryCostRule.rb +++ b/examples/v2/cloud-cost-management/CreateCustomAllocationRule.rb @@ -1,4 +1,4 @@ -# Update arbitrary cost rule returns "OK" response +# Create custom allocation rule returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new @@ -11,7 +11,6 @@ condition: "is", tag: "account_id", value: "123456789", - values: [], }), DatadogAPIClient::V2::ArbitraryCostUpsertRequestDataAttributesCostsToAllocateItems.new({ condition: "in", @@ -40,7 +39,6 @@ condition: "is", tag: "service", value: "web-api", - values: [], }), DatadogAPIClient::V2::ArbitraryCostUpsertRequestDataAttributesStrategyBasedOnCostsItems.new({ condition: "not in", @@ -60,4 +58,4 @@ type: DatadogAPIClient::V2::ArbitraryCostUpsertRequestDataType::UPSERT_ARBITRARY_RULE, }), }) -p api_instance.update_arbitrary_cost_rule(123456, body) +p api_instance.create_custom_allocation_rule(body) diff --git a/examples/v2/cloud-cost-management/CreateRuleset.rb b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset.rb similarity index 91% rename from examples/v2/cloud-cost-management/CreateRuleset.rb rename to examples/v2/cloud-cost-management/CreateTagPipelinesRuleset.rb index e484a52ac11f..147ccf17b16b 100644 --- a/examples/v2/cloud-cost-management/CreateRuleset.rb +++ b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset.rb @@ -1,4 +1,4 @@ -# Create ruleset returns "OK" response +# Create tag pipeline ruleset returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new @@ -29,4 +29,4 @@ type: DatadogAPIClient::V2::CreateRulesetRequestDataType::CREATE_RULESET, }), }) -p api_instance.create_ruleset(body) +p api_instance.create_tag_pipelines_ruleset(body) diff --git a/examples/v2/cloud-cost-management/DeleteArbitraryCostRule.rb b/examples/v2/cloud-cost-management/DeleteArbitraryCostRule.rb deleted file mode 100644 index 9a448f9256de..000000000000 --- a/examples/v2/cloud-cost-management/DeleteArbitraryCostRule.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Delete arbitrary cost rule returns "No Content" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -api_instance.delete_arbitrary_cost_rule(123456) diff --git a/examples/v2/cloud-cost-management/DeleteCustomAllocationRule.rb b/examples/v2/cloud-cost-management/DeleteCustomAllocationRule.rb new file mode 100644 index 000000000000..6ac3f173a58d --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCustomAllocationRule.rb @@ -0,0 +1,5 @@ +# Delete custom allocation rule returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +api_instance.delete_custom_allocation_rule(683) diff --git a/examples/v2/cloud-cost-management/DeleteRuleset.rb b/examples/v2/cloud-cost-management/DeleteRuleset.rb deleted file mode 100644 index b5495ea0ff41..000000000000 --- a/examples/v2/cloud-cost-management/DeleteRuleset.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Delete ruleset returns "No Content" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -api_instance.delete_ruleset("1c5dae14-237d-4b9a-a515-aa55b3939142") diff --git a/examples/v2/cloud-cost-management/DeleteTagPipelinesRuleset.rb b/examples/v2/cloud-cost-management/DeleteTagPipelinesRuleset.rb new file mode 100644 index 000000000000..e888f0b9a7bb --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteTagPipelinesRuleset.rb @@ -0,0 +1,5 @@ +# Delete tag pipeline ruleset returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +api_instance.delete_tag_pipelines_ruleset("ee10c3ff-312f-464c-b4f6-46adaa6d00a1") diff --git a/examples/v2/cloud-cost-management/GetArbitraryCostRule.rb b/examples/v2/cloud-cost-management/GetArbitraryCostRule.rb deleted file mode 100644 index b4990ee817bb..000000000000 --- a/examples/v2/cloud-cost-management/GetArbitraryCostRule.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Get arbitrary cost rule returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -p api_instance.get_arbitrary_cost_rule(123456) diff --git a/examples/v2/cloud-cost-management/GetCustomAllocationRule.rb b/examples/v2/cloud-cost-management/GetCustomAllocationRule.rb new file mode 100644 index 000000000000..32ffb703b8e8 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCustomAllocationRule.rb @@ -0,0 +1,5 @@ +# Get custom allocation rule returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_custom_allocation_rule(683) diff --git a/examples/v2/cloud-cost-management/GetRuleset.rb b/examples/v2/cloud-cost-management/GetTagPipelinesRuleset.rb similarity index 65% rename from examples/v2/cloud-cost-management/GetRuleset.rb rename to examples/v2/cloud-cost-management/GetTagPipelinesRuleset.rb index 65cee15181a1..e76027068e64 100644 --- a/examples/v2/cloud-cost-management/GetRuleset.rb +++ b/examples/v2/cloud-cost-management/GetTagPipelinesRuleset.rb @@ -2,4 +2,4 @@ require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -p api_instance.get_ruleset("da0e30e2-615d-4dae-9a22-38cf86a87dde") +p api_instance.get_tag_pipelines_ruleset("ruleset_id") diff --git a/examples/v2/cloud-cost-management/GetTagPipelinesRuleset_2339377367.rb b/examples/v2/cloud-cost-management/GetTagPipelinesRuleset_2339377367.rb new file mode 100644 index 000000000000..59090678a865 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetTagPipelinesRuleset_2339377367.rb @@ -0,0 +1,5 @@ +# Get tag pipeline ruleset returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_tag_pipelines_ruleset("ee10c3ff-312f-464c-b4f6-46adaa6d00a1") diff --git a/examples/v2/cloud-cost-management/ListArbitraryCostRules.rb b/examples/v2/cloud-cost-management/ListArbitraryCostRules.rb deleted file mode 100644 index 5392d73d0ea3..000000000000 --- a/examples/v2/cloud-cost-management/ListArbitraryCostRules.rb +++ /dev/null @@ -1,5 +0,0 @@ -# List arbitrary cost rules returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -p api_instance.list_arbitrary_cost_rules() diff --git a/examples/v2/cloud-cost-management/ListCustomAllocationRules.rb b/examples/v2/cloud-cost-management/ListCustomAllocationRules.rb new file mode 100644 index 000000000000..e14b5c5662a6 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCustomAllocationRules.rb @@ -0,0 +1,5 @@ +# List custom allocation rules returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_custom_allocation_rules() diff --git a/examples/v2/cloud-cost-management/ListRulesets.rb b/examples/v2/cloud-cost-management/ListRulesets.rb deleted file mode 100644 index 61e0a0aaa2da..000000000000 --- a/examples/v2/cloud-cost-management/ListRulesets.rb +++ /dev/null @@ -1,5 +0,0 @@ -# List rulesets returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -p api_instance.list_rulesets() diff --git a/examples/v2/cloud-cost-management/ListTagPipelinesRulesets.rb b/examples/v2/cloud-cost-management/ListTagPipelinesRulesets.rb new file mode 100644 index 000000000000..832c3d03e8c7 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListTagPipelinesRulesets.rb @@ -0,0 +1,5 @@ +# List tag pipeline rulesets returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_tag_pipelines_rulesets() diff --git a/examples/v2/cloud-cost-management/ReorderArbitraryCostRules.rb b/examples/v2/cloud-cost-management/ReorderCustomAllocationRules.rb similarity index 83% rename from examples/v2/cloud-cost-management/ReorderArbitraryCostRules.rb rename to examples/v2/cloud-cost-management/ReorderCustomAllocationRules.rb index 2bc45dd25b69..940af94024a5 100644 --- a/examples/v2/cloud-cost-management/ReorderArbitraryCostRules.rb +++ b/examples/v2/cloud-cost-management/ReorderCustomAllocationRules.rb @@ -1,4 +1,4 @@ -# Reorder arbitrary cost rules returns "Successfully reordered rules" response +# Reorder custom allocation rules returns "Successfully reordered rules" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new @@ -19,4 +19,4 @@ }), ], }) -api_instance.reorder_arbitrary_cost_rules(body) +api_instance.reorder_custom_allocation_rules(body) diff --git a/examples/v2/cloud-cost-management/ReorderRulesets.rb b/examples/v2/cloud-cost-management/ReorderRulesets.rb deleted file mode 100644 index 84fa8908f77d..000000000000 --- a/examples/v2/cloud-cost-management/ReorderRulesets.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Reorder rulesets returns "Successfully reordered rulesets" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new - -body = DatadogAPIClient::V2::ReorderRulesetResourceArray.new({ - data: [ - DatadogAPIClient::V2::ReorderRulesetResourceData.new({ - type: DatadogAPIClient::V2::ReorderRulesetResourceDataType::RULESET, - }), - ], -}) -api_instance.reorder_rulesets(body) diff --git a/examples/v2/cloud-cost-management/ReorderTagPipelinesRulesets.rb b/examples/v2/cloud-cost-management/ReorderTagPipelinesRulesets.rb new file mode 100644 index 000000000000..16b9a68e6adb --- /dev/null +++ b/examples/v2/cloud-cost-management/ReorderTagPipelinesRulesets.rb @@ -0,0 +1,22 @@ +# Reorder tag pipeline rulesets returns "Successfully reordered rulesets" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::ReorderRulesetResourceArray.new({ + data: [ + DatadogAPIClient::V2::ReorderRulesetResourceData.new({ + id: "55ef2385-9ae1-4410-90c4-5ac1b60fec10", + type: DatadogAPIClient::V2::ReorderRulesetResourceDataType::RULESET, + }), + DatadogAPIClient::V2::ReorderRulesetResourceData.new({ + id: "a7b8c9d0-1234-5678-9abc-def012345678", + type: DatadogAPIClient::V2::ReorderRulesetResourceDataType::RULESET, + }), + DatadogAPIClient::V2::ReorderRulesetResourceData.new({ + id: "f1e2d3c4-b5a6-9780-1234-567890abcdef", + type: DatadogAPIClient::V2::ReorderRulesetResourceDataType::RULESET, + }), + ], +}) +api_instance.reorder_tag_pipelines_rulesets(body) diff --git a/examples/v2/cloud-cost-management/CreateArbitraryCostRule.rb b/examples/v2/cloud-cost-management/UpdateCustomAllocationRule.rb similarity index 94% rename from examples/v2/cloud-cost-management/CreateArbitraryCostRule.rb rename to examples/v2/cloud-cost-management/UpdateCustomAllocationRule.rb index ee6009f8c155..8b971af5de3b 100644 --- a/examples/v2/cloud-cost-management/CreateArbitraryCostRule.rb +++ b/examples/v2/cloud-cost-management/UpdateCustomAllocationRule.rb @@ -1,4 +1,4 @@ -# Create arbitrary cost rule returns "OK" response +# Update custom allocation rule returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new @@ -60,4 +60,4 @@ type: DatadogAPIClient::V2::ArbitraryCostUpsertRequestDataType::UPSERT_ARBITRARY_RULE, }), }) -p api_instance.create_arbitrary_cost_rule(body) +p api_instance.update_custom_allocation_rule(683, body) diff --git a/examples/v2/cloud-cost-management/UpdateRuleset.rb b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb similarity index 82% rename from examples/v2/cloud-cost-management/UpdateRuleset.rb rename to examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb index 16e0f7a7d506..f3e4c36f07a3 100644 --- a/examples/v2/cloud-cost-management/UpdateRuleset.rb +++ b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb @@ -1,4 +1,4 @@ -# Update ruleset returns "OK" response +# Update tag pipeline ruleset returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new @@ -7,7 +7,7 @@ data: DatadogAPIClient::V2::UpdateRulesetRequestData.new({ attributes: DatadogAPIClient::V2::UpdateRulesetRequestDataAttributes.new({ enabled: true, - last_version: 3601919, + last_version: 3611102, rules: [ DatadogAPIClient::V2::UpdateRulesetRequestDataAttributesRulesItems.new({ enabled: true, @@ -25,7 +25,8 @@ }), ], }), + id: "New Ruleset", type: DatadogAPIClient::V2::UpdateRulesetRequestDataType::UPDATE_RULESET, }), }) -p api_instance.update_ruleset("1c5dae14-237d-4b9a-a515-aa55b3939142", body) +p api_instance.update_tag_pipelines_ruleset("ee10c3ff-312f-464c-b4f6-46adaa6d00a1", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 8d2a2a9c2011..d151437aa255 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1544,19 +1544,19 @@ "page_size" => "Integer", "page_cursor" => "String", }, - "v2.CreateArbitraryCostRule" => { + "v2.CreateCustomAllocationRule" => { "body" => "ArbitraryCostUpsertRequest", }, - "v2.ReorderArbitraryCostRules" => { + "v2.ReorderCustomAllocationRules" => { "body" => "ReorderRuleResourceArray", }, - "v2.DeleteArbitraryCostRule" => { + "v2.DeleteCustomAllocationRule" => { "rule_id" => "Integer", }, - "v2.GetArbitraryCostRule" => { + "v2.GetCustomAllocationRule" => { "rule_id" => "Integer", }, - "v2.UpdateArbitraryCostRule" => { + "v2.UpdateCustomAllocationRule" => { "rule_id" => "Integer", "body" => "ArbitraryCostUpsertRequest", }, @@ -1623,22 +1623,22 @@ "cloud_account_id" => "Integer", "body" => "GCPUsageCostConfigPatchRequest", }, - "v2.CreateRuleset" => { + "v2.CreateTagPipelinesRuleset" => { "body" => "CreateRulesetRequest", }, - "v2.ReorderRulesets" => { + "v2.ReorderTagPipelinesRulesets" => { "body" => "ReorderRulesetResourceArray", }, "v2.ValidateQuery" => { "body" => "RulesValidateQueryRequest", }, - "v2.DeleteRuleset" => { + "v2.DeleteTagPipelinesRuleset" => { "ruleset_id" => "String", }, - "v2.GetRuleset" => { + "v2.GetTagPipelinesRuleset" => { "ruleset_id" => "String", }, - "v2.UpdateRuleset" => { + "v2.UpdateTagPipelinesRuleset" => { "ruleset_id" => "String", "body" => "UpdateRulesetRequest", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 78309ae90bc4..ba6cdda25c33 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -13,14 +13,14 @@ Feature: Cloud Cost Management And a valid "appKeyAuth" key in the system And an instance of "CloudCostManagement" API - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create Cloud Cost Management AWS CUR config returns "Bad Request" response Given new "CreateCostAWSCURConfig" request And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}, "account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}} When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Create Cloud Cost Management AWS CUR config returns "OK" response Given new "CreateCostAWSCURConfig" request And body with value {"data": {"attributes": {"account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}} @@ -28,14 +28,14 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456789123" - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Create Cloud Cost Management Azure configs returns "Bad Request" response Given new "CreateCostAzureUCConfigs" request And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "scope": "this_is_an_invalid_scope"}, "type": "azure_uc_config_post_request"}} When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Create Cloud Cost Management Azure configs returns "OK" response Given new "CreateCostAzureUCConfigs" request And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "type": "azure_uc_config_post_request"}} @@ -43,14 +43,14 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.configs[0].account_id" is equal to "1234abcd-1234-abcd-1234-1234abcd1234" - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Create Google Cloud Usage Cost config returns "Bad Request" response Given new "CreateCostGCPUsageCostConfig" request And body with value {"data": {"attributes": {"billing_account_id": "123456_A123BC_12AB34", "bucket_name": "dd-cost-bucket", "export_dataset_name": "billing", "export_prefix": "datadog_cloud_cost_usage_export", "export_project_name": "dd-cloud-cost-report", "service_account": "InvalidServiceAccount"}, "type": "gcp_uc_config_post_request"}} When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Create Google Cloud Usage Cost config returns "OK" response Given new "CreateCostGCPUsageCostConfig" request And body with value {"data": {"attributes": {"billing_account_id": "123456_A123BC_12AB34", "bucket_name": "dd-cost-bucket", "export_dataset_name": "billing", "export_prefix": "datadog_cloud_cost_usage_export", "export_project_name": "dd-cloud-cost-report", "service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com"}, "type": "gcp_uc_config_post_request"}} @@ -58,158 +58,158 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34" - @replay-only @team:Datadog/cloud-cost-management - Scenario: Create arbitrary cost rule returns "OK" response - Given new "CreateArbitraryCostRule" request - And body with value {"data": {"attributes": {"costs_to_allocate": [{"condition": "is", "tag": "account_id", "value": "123456789", "values":[]}, {"condition": "in", "tag": "environment", "value": "", "values": ["production", "staging"]}], "enabled": true, "order_id": 1, "provider": ["aws", "gcp"], "rule_name": "example-arbitrary-cost-rule", "strategy": {"allocated_by_tag_keys": ["team", "environment"], "based_on_costs": [{"condition": "is", "tag": "service", "value": "web-api", "values":[]}, {"condition": "not in", "tag": "team", "value": "", "values": ["legacy", "deprecated"]}], "granularity": "daily", "method": "proportional"}, "type": "shared"}, "type": "upsert_arbitrary_rule"}} + @replay-only @team:DataDog/cloud-cost-management + Scenario: Create custom allocation rule returns "OK" response + Given new "CreateCustomAllocationRule" request + And body with value {"data": {"attributes": {"costs_to_allocate": [{"condition": "is", "tag": "account_id", "value": "123456789"}, {"condition": "in", "tag": "environment", "value": "", "values": ["production", "staging"]}], "enabled": true, "order_id": 1, "provider": ["aws", "gcp"], "rule_name": "example-arbitrary-cost-rule", "strategy": {"allocated_by_tag_keys": ["team", "environment"], "based_on_costs": [{"condition": "is", "tag": "service", "value": "web-api"}, {"condition": "not in", "tag": "team", "value": "", "values": ["legacy", "deprecated"]}], "granularity": "daily", "method": "proportional"}, "type": "shared"}, "type": "upsert_arbitrary_rule"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "arbitrary_rule" And the response "data.attributes.rule_name" is equal to "example-arbitrary-cost-rule" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Not Found" response Given new "UpsertBudget" request And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} When the request is sent Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "OK" response Given new "UpsertBudget" request And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management - Scenario: Create ruleset returns "OK" response - Given new "CreateRuleset" request + @replay-only @team:DataDog/cloud-cost-management + Scenario: Create tag pipeline ruleset returns "OK" response + Given new "CreateTagPipelinesRuleset" request And body with value {"data": {"attributes": {"enabled": true, "rules": [{"enabled": true, "mapping": null, "name": "Add Cost Center Tag", "query": {"addition": {"key": "cost_center", "value": "engineering"}, "case_insensitivity": false, "if_not_exists": true, "query": "account_id:\"123456789\" AND service:\"web-api\""}, "reference_table": null}]}, "id": "New Ruleset", "type": "create_ruleset"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "New Ruleset" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "Bad Request" response Given new "DeleteCostAWSCURConfig" request And request contains "cloud_account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "No Content" response Given new "DeleteCostAWSCURConfig" request And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "Not Found" response Given new "DeleteCostAWSCURConfig" request And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management Azure config returns "Bad Request" response Given new "DeleteCostAzureUCConfig" request And request contains "cloud_account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management Azure config returns "No Content" response Given new "DeleteCostAzureUCConfig" request And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management Azure config returns "Not Found" response Given new "DeleteCostAzureUCConfig" request And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Delete Custom Costs File returns "No Content" response Given new "DeleteCustomCostsFile" request And request contains "file_id" parameter with value "9d055d22-a838-4e9f-bc34-a4f9ab66280c" When the request is sent Then the response status is 204 No Content - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete Custom Costs file returns "No Content" response Given new "DeleteCustomCostsFile" request And request contains "file_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 No Content - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Delete Custom Costs file returns "Not Found" response Given new "DeleteCustomCostsFile" request And request contains "file_id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete Google Cloud Usage Cost config returns "Bad Request" response Given new "DeleteCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Delete Google Cloud Usage Cost config returns "No Content" response Given new "DeleteCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Delete Google Cloud Usage Cost config returns "Not Found" response Given new "DeleteCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response Given new "DeleteBudget" request And request contains "budget_id" parameter with value "1" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "No Content" response Given new "DeleteBudget" request And request contains "budget_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 No Content - @replay-only @team:Datadog/cloud-cost-management - Scenario: Delete arbitrary cost rule returns "No Content" response - Given new "DeleteArbitraryCostRule" request - And request contains "rule_id" parameter with value 123456 + @replay-only @team:DataDog/cloud-cost-management + Scenario: Delete custom allocation rule returns "No Content" response + Given new "DeleteCustomAllocationRule" request + And request contains "rule_id" parameter with value 683 When the request is sent Then the response status is 204 No Content - @replay-only @team:Datadog/cloud-cost-management - Scenario: Delete ruleset returns "No Content" response - Given new "DeleteRuleset" request - And request contains "ruleset_id" parameter with value "1c5dae14-237d-4b9a-a515-aa55b3939142" + @replay-only @team:DataDog/cloud-cost-management + Scenario: Delete tag pipeline ruleset returns "No Content" response + Given new "DeleteTagPipelinesRuleset" request + And request contains "ruleset_id" parameter with value "ee10c3ff-312f-464c-b4f6-46adaa6d00a1" When the request is sent Then the response status is 204 No Content - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Custom Costs File returns "OK" response Given new "GetCustomCostsFile" request And request contains "file_id" parameter with value "9d055d22-a838-4e9f-bc34-a4f9ab66280c" @@ -218,21 +218,21 @@ Feature: Cloud Cost Management And the response "data.attributes.name" is equal to "data.json" And the response "data.attributes.content[0].ChargeDescription" is equal to "my_description" - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Get Custom Costs file returns "Not Found" response Given new "GetCustomCostsFile" request And request contains "file_id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get Custom Costs file returns "OK" response Given new "GetCustomCostsFile" request And request contains "file_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Google Cloud Usage Cost config returns "OK" response Given new "GetCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter with value 123456 @@ -241,35 +241,28 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a budget returns "Bad Request" response Given new "GetBudget" request And request contains "budget_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Get a budget returns "Not Found" response Given new "GetBudget" request And request contains "budget_id" parameter with value "9d055d22-0a0a-0a0a-aaa0-00000000000a" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a budget returns "OK" response Given new "GetBudget" request And request contains "budget_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management - Scenario: Get arbitrary cost rule returns "OK" response - Given new "GetArbitraryCostRule" request - And request contains "rule_id" parameter with value 123456 - When the request is sent - Then the response status is 200 OK - - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request And request contains "cloud_account_id" parameter with value 123456 @@ -278,7 +271,7 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "aws_cur_config" And the response "data.attributes.account_id" is equal to "123456123456" - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost Azure UC config returns "OK" response Given new "GetCostAzureUCConfig" request And request contains "cloud_account_id" parameter with value 123456 @@ -288,90 +281,104 @@ Feature: Cloud Cost Management And the response "data.attributes.configs[0].dataset_type" is equal to "amortized" And the response "data.attributes.configs[1].dataset_type" is equal to "actual" - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management + Scenario: Get custom allocation rule returns "OK" response + Given new "GetCustomAllocationRule" request + And request contains "rule_id" parameter with value 683 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get ruleset returns "OK" response - Given new "GetRuleset" request - And request contains "ruleset_id" parameter with value "da0e30e2-615d-4dae-9a22-38cf86a87dde" + Given new "GetTagPipelinesRuleset" request + And request contains "ruleset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @replay-only @team:DataDog/cloud-cost-management + Scenario: Get tag pipeline ruleset returns "OK" response + Given new "GetTagPipelinesRuleset" request + And request contains "ruleset_id" parameter with value "ee10c3ff-312f-464c-b4f6-46adaa6d00a1" When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "New Ruleset" - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management AWS CUR configs returns "OK" response Given new "ListCostAWSCURConfigs" request When the request is sent Then the response status is 200 OK And the response "data[0].attributes.bucket_name" is equal to "test_bucket_name" - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management Azure configs returns "OK" response Given new "ListCostAzureUCConfigs" request When the request is sent Then the response status is 200 OK And the response "data[0].attributes.configs[0].export_name" is equal to "test_export_name" - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" request When the request is sent Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "data.json" - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: List Custom Costs files returns "Bad Request" response Given new "ListCustomCostsFiles" request And request contains "filter[status]" parameter with value "invalid_file_status" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Custom Costs files returns "OK" response Given new "ListCustomCostsFiles" request When the request is sent Then the response status is 200 OK - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: List Google Cloud Usage Cost configs returns "OK" response Given new "ListCostGCPUsageCostConfigs" request When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management - Scenario: List arbitrary cost rules returns "OK" response - Given new "ListArbitraryCostRules" request + @team:DataDog/cloud-cost-management + Scenario: List budgets returns "OK" response + Given new "ListBudgets" request When the request is sent Then the response status is 200 OK - And the response "data[0].attributes.rule_name" is equal to "example-arbitrary-cost-rule" - @team:Datadog/cloud-cost-management - Scenario: List budgets returns "OK" response - Given new "ListBudgets" request + @replay-only @team:DataDog/cloud-cost-management + Scenario: List custom allocation rules returns "OK" response + Given new "ListCustomAllocationRules" request When the request is sent Then the response status is 200 OK + And the response "data[0].attributes.rule_name" is equal to "example-arbitrary-cost-rule" - @replay-only @team:Datadog/cloud-cost-management - Scenario: List rulesets returns "OK" response - Given new "ListRulesets" request + @replay-only @team:DataDog/cloud-cost-management + Scenario: List tag pipeline rulesets returns "OK" response + Given new "ListTagPipelinesRulesets" request When the request is sent Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "New Ruleset" - @generated @skip @team:Datadog/cloud-cost-management - Scenario: Reorder arbitrary cost rules returns "Successfully reordered rules" response - Given new "ReorderArbitraryCostRules" request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Reorder custom allocation rules returns "Successfully reordered rules" response + Given new "ReorderCustomAllocationRules" request And body with value {"data": [{"id": "456", "type": "arbitrary_rule"}, {"id": "123", "type": "arbitrary_rule"}, {"id": "789", "type": "arbitrary_rule"}]} When the request is sent Then the response status is 204 Successfully reordered rules - @generated @skip @team:Datadog/cloud-cost-management - Scenario: Reorder rulesets returns "Successfully reordered rulesets" response - Given new "ReorderRulesets" request - And body with value {"data": [{"type": "ruleset"}]} + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Reorder tag pipeline rulesets returns "Successfully reordered rulesets" response + Given new "ReorderTagPipelinesRulesets" request + And body with value {"data": [{"id": "55ef2385-9ae1-4410-90c4-5ac1b60fec10", "type": "ruleset"}, {"id": "a7b8c9d0-1234-5678-9abc-def012345678", "type": "ruleset"}, {"id": "f1e2d3c4-b5a6-9780-1234-567890abcdef", "type": "ruleset"}]} When the request is sent Then the response status is 204 Successfully reordered rulesets - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "Not Found" response Given new "UpdateCostAWSCURConfig" request And request contains "cloud_account_id" parameter with value 123456 @@ -379,7 +386,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "OK" response Given new "UpdateCostAWSCURConfig" request And request contains "cloud_account_id" parameter with value 100 @@ -388,7 +395,7 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data[0].attributes.account_id" is equal to "000000000000" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management Azure config returns "Bad Request" response Given new "UpdateCostAzureUCConfigs" request And request contains "cloud_account_id" parameter from "REPLACE.ME" @@ -396,7 +403,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management Azure config returns "Not Found" response Given new "UpdateCostAzureUCConfigs" request And request contains "cloud_account_id" parameter with value 123456 @@ -404,7 +411,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management Azure config returns "OK" response Given new "UpdateCostAzureUCConfigs" request And request contains "cloud_account_id" parameter with value 100 @@ -413,7 +420,7 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.type" is equal to "azure_uc_configs" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Update Google Cloud Usage Cost config returns "Bad Request" response Given new "UpdateCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter from "REPLACE.ME" @@ -421,7 +428,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Update Google Cloud Usage Cost config returns "Not Found" response Given new "UpdateCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter with value 123456 @@ -429,7 +436,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Update Google Cloud Usage Cost config returns "OK" response Given new "UpdateCostGCPUsageCostConfig" request And request contains "cloud_account_id" parameter with value 100 @@ -438,23 +445,23 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34" - @replay-only @team:Datadog/cloud-cost-management - Scenario: Update arbitrary cost rule returns "OK" response - Given new "UpdateArbitraryCostRule" request - And request contains "rule_id" parameter with value 123456 + @replay-only @team:DataDog/cloud-cost-management + Scenario: Update custom allocation rule returns "OK" response + Given new "UpdateCustomAllocationRule" request + And request contains "rule_id" parameter with value 683 And body with value {"data": {"attributes": {"costs_to_allocate": [{"condition": "is", "tag": "account_id", "value": "123456789", "values":[]}, {"condition": "in", "tag": "environment", "value": "", "values": ["production", "staging"]}], "enabled": true, "order_id": 1, "provider": ["aws", "gcp"], "rule_name": "example-arbitrary-cost-rule", "strategy": {"allocated_by_tag_keys": ["team", "environment"], "based_on_costs": [{"condition": "is", "tag": "service", "value": "web-api", "values":[]}, {"condition": "not in", "tag": "team", "value": "", "values": ["legacy", "deprecated"]}], "granularity": "daily", "method": "proportional"}, "type": "shared"}, "type": "upsert_arbitrary_rule"}} When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management - Scenario: Update ruleset returns "OK" response - Given new "UpdateRuleset" request - And request contains "ruleset_id" parameter with value "1c5dae14-237d-4b9a-a515-aa55b3939142" - And body with value {"data": {"attributes": {"enabled": true, "last_version": 3601919, "rules": [{"enabled": true, "mapping": {"destination_key": "team_owner", "if_not_exists": true, "source_keys": ["account_name", "account_id"]}, "name": "Account Name Mapping", "query": null, "reference_table": null}]}, "type": "update_ruleset"}} + @replay-only @team:DataDog/cloud-cost-management + Scenario: Update tag pipeline ruleset returns "OK" response + Given new "UpdateTagPipelinesRuleset" request + And request contains "ruleset_id" parameter with value "ee10c3ff-312f-464c-b4f6-46adaa6d00a1" + And body with value {"data": {"attributes": {"enabled": true, "last_version": 3611102, "rules": [{"enabled": true, "mapping": {"destination_key": "team_owner", "if_not_exists": true, "source_keys": ["account_name", "account_id"]}, "name": "Account Name Mapping", "query": null, "reference_table": null}]}, "id": "New Ruleset", "type": "update_ruleset"}} When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Upload Custom Costs File returns "Accepted" response Given new "UploadCustomCostsFile" request And body with value [{ "ProviderName": "my_provider", "ChargePeriodStart": "2023-05-06", "ChargePeriodEnd": "2023-06-06","ChargeDescription": "my_description","BilledCost": 250,"BillingCurrency": "USD","Tags": {"key": "value"}}] @@ -462,21 +469,21 @@ Feature: Cloud Cost Management Then the response status is 202 Accepted And the response "data.attributes.name" is equal to "data.json" - @generated @skip @team:Datadog/cloud-cost-management + @generated @skip @team:DataDog/cloud-cost-management Scenario: Upload Custom Costs file returns "Accepted" response Given new "UploadCustomCostsFile" request And body with value [{"BilledCost": 100.5, "BillingCurrency": "USD", "ChargeDescription": "Monthly usage charge for my service", "ChargePeriodEnd": "2023-02-28", "ChargePeriodStart": "2023-02-01"}] When the request is sent Then the response status is 202 Accepted - @team:Datadog/cloud-cost-management + @team:DataDog/cloud-cost-management Scenario: Upload Custom Costs file returns "Bad Request" response Given new "UploadCustomCostsFile" request And body with value [{"BilledCost": 100.5, "BillingCurrency": "USD", "ChargeDescription": "Monthly usage charge for my service", "ChargePeriodEnd": "2023-02-28", "ChargePeriodStart": "2023-02-01"}] When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @replay-only @team:DataDog/cloud-cost-management Scenario: Validate query returns "OK" response Given new "ValidateQuery" request And body with value {"data": {"attributes": {"Query": "example:query AND test:true"}, "type": "validate_query"}} diff --git a/features/v2/undo.json b/features/v2/undo.json index f57ef9065135..931b7e63794e 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -737,37 +737,37 @@ "type": "safe" } }, - "ListArbitraryCostRules": { + "ListCustomAllocationRules": { "tag": "Cloud Cost Management", "undo": { "type": "safe" } }, - "CreateArbitraryCostRule": { + "CreateCustomAllocationRule": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" } }, - "ReorderArbitraryCostRules": { + "ReorderCustomAllocationRules": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" } }, - "DeleteArbitraryCostRule": { + "DeleteCustomAllocationRule": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" } }, - "GetArbitraryCostRule": { + "GetCustomAllocationRule": { "tag": "Cloud Cost Management", "undo": { "type": "safe" } }, - "UpdateArbitraryCostRule": { + "UpdateCustomAllocationRule": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" @@ -3841,19 +3841,19 @@ "type": "safe" } }, - "ListRulesets": { + "ListTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": { "type": "safe" } }, - "CreateRuleset": { + "CreateTagPipelinesRuleset": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" } }, - "ReorderRulesets": { + "ReorderTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" @@ -3865,19 +3865,19 @@ "type": "safe" } }, - "DeleteRuleset": { + "DeleteTagPipelinesRuleset": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" } }, - "GetRuleset": { + "GetTagPipelinesRuleset": { "tag": "Cloud Cost Management", "undo": { "type": "safe" } }, - "UpdateRuleset": { + "UpdateTagPipelinesRuleset": { "tag": "Cloud Cost Management", "undo": { "type": "idempotent" diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6ba4dd7a1328..c52769e3632c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1091,6 +1091,7 @@ def overrides "v2.arbitrary_cost_upsert_request_data_type" => "ArbitraryCostUpsertRequestDataType", "v2.arbitrary_rule_response" => "ArbitraryRuleResponse", "v2.arbitrary_rule_response_array" => "ArbitraryRuleResponseArray", + "v2.arbitrary_rule_response_array_meta" => "ArbitraryRuleResponseArrayMeta", "v2.arbitrary_rule_response_data" => "ArbitraryRuleResponseData", "v2.arbitrary_rule_response_data_attributes" => "ArbitraryRuleResponseDataAttributes", "v2.arbitrary_rule_response_data_attributes_costs_to_allocate_items" => "ArbitraryRuleResponseDataAttributesCostsToAllocateItems", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 2e920a042b76..ce881d5542a7 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -23,85 +23,6 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end - # Create arbitrary cost rule. - # - # @see #create_arbitrary_cost_rule_with_http_info - def create_arbitrary_cost_rule(body, opts = {}) - data, _status_code, _headers = create_arbitrary_cost_rule_with_http_info(body, opts) - data - end - - # Create arbitrary cost rule. - # - # Create a new arbitrary cost rule with the specified filters and allocation strategy. - # - # **Strategy Methods:** - # - **PROPORTIONAL/EVEN**: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters. - # - **PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES**: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys. - # - **PERCENT**: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations). - # - # **Filter Conditions:** - # - Use **value** for single-value conditions: "is", "is not", "contains", "does not contain", "=", "!=", "like", "not like", "is all values", "is untagged" - # - Use **values** for multi-value conditions: "in", "not in" - # - Cannot use both value and values simultaneously. - # - # **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like - # - # @param body [ArbitraryCostUpsertRequest] - # @param opts [Hash] the optional parameters - # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers - def create_arbitrary_cost_rule_with_http_info(body, opts = {}) - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_arbitrary_cost_rule ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_arbitrary_cost_rule" - end - # resource path - local_var_path = '/api/v2/cost/arbitrary_rule' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :create_arbitrary_cost_rule, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_arbitrary_cost_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Create Cloud Cost Management AWS CUR config. # # @see #create_cost_awscur_config_with_http_info @@ -303,32 +224,44 @@ def create_cost_gcp_usage_cost_config_with_http_info(body, opts = {}) return data, status_code, headers end - # Create ruleset. + # Create custom allocation rule. # - # @see #create_ruleset_with_http_info - def create_ruleset(body, opts = {}) - data, _status_code, _headers = create_ruleset_with_http_info(body, opts) + # @see #create_custom_allocation_rule_with_http_info + def create_custom_allocation_rule(body, opts = {}) + data, _status_code, _headers = create_custom_allocation_rule_with_http_info(body, opts) data end - # Create ruleset. + # Create custom allocation rule. # - # Create a new tag pipeline ruleset with the specified rules and configuration + # Create a new custom allocation rule with the specified filters and allocation strategy. # - # @param body [CreateRulesetRequest] + # **Strategy Methods:** + # - **PROPORTIONAL/EVEN**: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters. + # - **PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES**: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys. + # - **PERCENT**: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations). + # + # **Filter Conditions:** + # - Use **value** for single-value conditions: "is", "is not", "contains", "does not contain", "=", "!=", "like", "not like", "is all values", "is untagged" + # - Use **values** for multi-value conditions: "in", "not in" + # - Cannot use both value and values simultaneously. + # + # **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like + # + # @param body [ArbitraryCostUpsertRequest] # @param opts [Hash] the optional parameters - # @return [Array<(RulesetResp, Integer, Hash)>] RulesetResp data, response status code and response headers - def create_ruleset_with_http_info(body, opts = {}) + # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers + def create_custom_allocation_rule_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_ruleset ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_custom_allocation_rule ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_ruleset" + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_custom_allocation_rule" end # resource path - local_var_path = '/api/v2/tags/enrichment' + local_var_path = '/api/v2/cost/arbitrary_rule' # query parameters query_params = opts[:query_params] || {} @@ -347,13 +280,13 @@ def create_ruleset_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'RulesetResp' + return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :create_ruleset, + :operation => :create_custom_allocation_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -365,37 +298,37 @@ def create_ruleset_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_custom_allocation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete arbitrary cost rule. + # Create tag pipeline ruleset. # - # @see #delete_arbitrary_cost_rule_with_http_info - def delete_arbitrary_cost_rule(rule_id, opts = {}) - delete_arbitrary_cost_rule_with_http_info(rule_id, opts) - nil + # @see #create_tag_pipelines_ruleset_with_http_info + def create_tag_pipelines_ruleset(body, opts = {}) + data, _status_code, _headers = create_tag_pipelines_ruleset_with_http_info(body, opts) + data end - # Delete arbitrary cost rule. + # Create tag pipeline ruleset. # - # Delete an arbitrary cost rule - Delete an existing arbitrary cost rule by its ID + # Create a new tag pipeline ruleset with the specified rules and configuration # - # @param rule_id [Integer] The unique identifier of the arbitrary cost rule + # @param body [CreateRulesetRequest] # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) + # @return [Array<(RulesetResp, Integer, Hash)>] RulesetResp data, response status code and response headers + def create_tag_pipelines_ruleset_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_arbitrary_cost_rule ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_tag_pipelines_ruleset ...' end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.delete_arbitrary_cost_rule" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_tag_pipelines_ruleset" end # resource path - local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/tags/enrichment' # query parameters query_params = opts[:query_params] || {} @@ -403,22 +336,24 @@ def delete_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'RulesetResp' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_arbitrary_cost_rule, + :operation => :create_tag_pipelines_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -428,9 +363,9 @@ def delete_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_arbitrary_cost_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_tag_pipelines_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -695,32 +630,32 @@ def delete_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {} return data, status_code, headers end - # Delete Custom Costs file. + # Delete custom allocation rule. # - # @see #delete_custom_costs_file_with_http_info - def delete_custom_costs_file(file_id, opts = {}) - delete_custom_costs_file_with_http_info(file_id, opts) + # @see #delete_custom_allocation_rule_with_http_info + def delete_custom_allocation_rule(rule_id, opts = {}) + delete_custom_allocation_rule_with_http_info(rule_id, opts) nil end - # Delete Custom Costs file. + # Delete custom allocation rule. # - # Delete the specified Custom Costs file. + # Delete a custom allocation rule - Delete an existing custom allocation rule by its ID # - # @param file_id [String] File ID. + # @param rule_id [Integer] The unique identifier of the custom allocation rule # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_custom_costs_file_with_http_info(file_id, opts = {}) + def delete_custom_allocation_rule_with_http_info(rule_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_custom_costs_file ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_custom_allocation_rule ...' end - # verify the required parameter 'file_id' is set - if @api_client.config.client_side_validation && file_id.nil? - fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.delete_custom_costs_file" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.delete_custom_allocation_rule" end # resource path - local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -743,7 +678,7 @@ def delete_custom_costs_file_with_http_info(file_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_custom_costs_file, + :operation => :delete_custom_allocation_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -755,37 +690,37 @@ def delete_custom_costs_file_with_http_info(file_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_custom_allocation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete ruleset. + # Delete Custom Costs file. # - # @see #delete_ruleset_with_http_info - def delete_ruleset(ruleset_id, opts = {}) - delete_ruleset_with_http_info(ruleset_id, opts) + # @see #delete_custom_costs_file_with_http_info + def delete_custom_costs_file(file_id, opts = {}) + delete_custom_costs_file_with_http_info(file_id, opts) nil end - # Delete ruleset. + # Delete Custom Costs file. # - # Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID + # Delete the specified Custom Costs file. # - # @param ruleset_id [String] The unique identifier of the ruleset + # @param file_id [String] File ID. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_ruleset_with_http_info(ruleset_id, opts = {}) + def delete_custom_costs_file_with_http_info(file_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_ruleset ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_custom_costs_file ...' end - # verify the required parameter 'ruleset_id' is set - if @api_client.config.client_side_validation && ruleset_id.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.delete_ruleset" + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.delete_custom_costs_file" end # resource path - local_var_path = '/api/v2/tags/enrichment/{ruleset_id}'.sub('{ruleset_id}', CGI.escape(ruleset_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -808,7 +743,7 @@ def delete_ruleset_with_http_info(ruleset_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_ruleset, + :operation => :delete_custom_costs_file, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -820,37 +755,37 @@ def delete_ruleset_with_http_info(ruleset_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get arbitrary cost rule. + # Delete tag pipeline ruleset. # - # @see #get_arbitrary_cost_rule_with_http_info - def get_arbitrary_cost_rule(rule_id, opts = {}) - data, _status_code, _headers = get_arbitrary_cost_rule_with_http_info(rule_id, opts) - data + # @see #delete_tag_pipelines_ruleset_with_http_info + def delete_tag_pipelines_ruleset(ruleset_id, opts = {}) + delete_tag_pipelines_ruleset_with_http_info(ruleset_id, opts) + nil end - # Get arbitrary cost rule. + # Delete tag pipeline ruleset. # - # Get a specific arbitrary cost rule - Retrieve a specific arbitrary cost rule by its ID + # Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID # - # @param rule_id [Integer] The unique identifier of the arbitrary cost rule + # @param ruleset_id [String] The unique identifier of the ruleset # @param opts [Hash] the optional parameters - # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers - def get_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_tag_pipelines_ruleset_with_http_info(ruleset_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_arbitrary_cost_rule ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_tag_pipelines_ruleset ...' end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.get_arbitrary_cost_rule" + # verify the required parameter 'ruleset_id' is set + if @api_client.config.client_side_validation && ruleset_id.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.delete_tag_pipelines_ruleset" end # resource path - local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/tags/enrichment/{ruleset_id}'.sub('{ruleset_id}', CGI.escape(ruleset_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -858,7 +793,7 @@ def get_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -867,13 +802,13 @@ def get_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_arbitrary_cost_rule, + :operation => :delete_tag_pipelines_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -883,9 +818,9 @@ def get_arbitrary_cost_rule_with_http_info(rule_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_arbitrary_cost_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_tag_pipelines_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -1150,32 +1085,32 @@ def get_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {}) return data, status_code, headers end - # Get Custom Costs file. + # Get custom allocation rule. # - # @see #get_custom_costs_file_with_http_info - def get_custom_costs_file(file_id, opts = {}) - data, _status_code, _headers = get_custom_costs_file_with_http_info(file_id, opts) + # @see #get_custom_allocation_rule_with_http_info + def get_custom_allocation_rule(rule_id, opts = {}) + data, _status_code, _headers = get_custom_allocation_rule_with_http_info(rule_id, opts) data end - # Get Custom Costs file. + # Get custom allocation rule. # - # Fetch the specified Custom Costs file. + # Get a specific custom allocation rule - Retrieve a specific custom allocation rule by its ID # - # @param file_id [String] File ID. + # @param rule_id [Integer] The unique identifier of the custom allocation rule # @param opts [Hash] the optional parameters - # @return [Array<(CustomCostsFileGetResponse, Integer, Hash)>] CustomCostsFileGetResponse data, response status code and response headers - def get_custom_costs_file_with_http_info(file_id, opts = {}) + # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers + def get_custom_allocation_rule_with_http_info(rule_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_custom_costs_file ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_custom_allocation_rule ...' end - # verify the required parameter 'file_id' is set - if @api_client.config.client_side_validation && file_id.nil? - fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.get_custom_costs_file" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.get_custom_allocation_rule" end # resource path - local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1192,13 +1127,13 @@ def get_custom_costs_file_with_http_info(file_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'CustomCostsFileGetResponse' + return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_custom_costs_file, + :operation => :get_custom_allocation_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1210,37 +1145,37 @@ def get_custom_costs_file_with_http_info(file_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_custom_allocation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get ruleset. + # Get Custom Costs file. # - # @see #get_ruleset_with_http_info - def get_ruleset(ruleset_id, opts = {}) - data, _status_code, _headers = get_ruleset_with_http_info(ruleset_id, opts) + # @see #get_custom_costs_file_with_http_info + def get_custom_costs_file(file_id, opts = {}) + data, _status_code, _headers = get_custom_costs_file_with_http_info(file_id, opts) data end - # Get ruleset. + # Get Custom Costs file. # - # Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID + # Fetch the specified Custom Costs file. # - # @param ruleset_id [String] The unique identifier of the ruleset + # @param file_id [String] File ID. # @param opts [Hash] the optional parameters - # @return [Array<(RulesetResp, Integer, Hash)>] RulesetResp data, response status code and response headers - def get_ruleset_with_http_info(ruleset_id, opts = {}) + # @return [Array<(CustomCostsFileGetResponse, Integer, Hash)>] CustomCostsFileGetResponse data, response status code and response headers + def get_custom_costs_file_with_http_info(file_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_ruleset ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_custom_costs_file ...' end - # verify the required parameter 'ruleset_id' is set - if @api_client.config.client_side_validation && ruleset_id.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.get_ruleset" + # verify the required parameter 'file_id' is set + if @api_client.config.client_side_validation && file_id.nil? + fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.get_custom_costs_file" end # resource path - local_var_path = '/api/v2/tags/enrichment/{ruleset_id}'.sub('{ruleset_id}', CGI.escape(ruleset_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1257,13 +1192,13 @@ def get_ruleset_with_http_info(ruleset_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'RulesetResp' + return_type = opts[:debug_return_type] || 'CustomCostsFileGetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_ruleset, + :operation => :get_custom_costs_file, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1275,32 +1210,37 @@ def get_ruleset_with_http_info(ruleset_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List arbitrary cost rules. + # Get ruleset. # - # @see #list_arbitrary_cost_rules_with_http_info - def list_arbitrary_cost_rules(opts = {}) - data, _status_code, _headers = list_arbitrary_cost_rules_with_http_info(opts) + # @see #get_tag_pipelines_ruleset_with_http_info + def get_tag_pipelines_ruleset(ruleset_id, opts = {}) + data, _status_code, _headers = get_tag_pipelines_ruleset_with_http_info(ruleset_id, opts) data end - # List arbitrary cost rules. + # Get ruleset. # - # List all arbitrary cost rules - Retrieve a list of all arbitrary cost rules for the organization + # Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID # + # @param ruleset_id [String] The unique identifier of the ruleset # @param opts [Hash] the optional parameters - # @return [Array<(ArbitraryRuleResponseArray, Integer, Hash)>] ArbitraryRuleResponseArray data, response status code and response headers - def list_arbitrary_cost_rules_with_http_info(opts = {}) + # @return [Array<(RulesetResp, Integer, Hash)>] RulesetResp data, response status code and response headers + def get_tag_pipelines_ruleset_with_http_info(ruleset_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_arbitrary_cost_rules ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_tag_pipelines_ruleset ...' + end + # verify the required parameter 'ruleset_id' is set + if @api_client.config.client_side_validation && ruleset_id.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.get_tag_pipelines_ruleset" end # resource path - local_var_path = '/api/v2/cost/arbitrary_rule' + local_var_path = '/api/v2/tags/enrichment/{ruleset_id}'.sub('{ruleset_id}', CGI.escape(ruleset_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1317,13 +1257,13 @@ def list_arbitrary_cost_rules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ArbitraryRuleResponseArray' + return_type = opts[:debug_return_type] || 'RulesetResp' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_arbitrary_cost_rules, + :operation => :get_tag_pipelines_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1335,7 +1275,7 @@ def list_arbitrary_cost_rules_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_arbitrary_cost_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_tag_pipelines_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -1580,38 +1520,30 @@ def list_cost_gcp_usage_cost_configs_with_http_info(opts = {}) return data, status_code, headers end - # List Custom Costs files. + # List custom allocation rules. # - # @see #list_custom_costs_files_with_http_info - def list_custom_costs_files(opts = {}) - data, _status_code, _headers = list_custom_costs_files_with_http_info(opts) + # @see #list_custom_allocation_rules_with_http_info + def list_custom_allocation_rules(opts = {}) + data, _status_code, _headers = list_custom_allocation_rules_with_http_info(opts) data end - # List Custom Costs files. + # List custom allocation rules. # - # List the Custom Costs files. + # List all custom allocation rules - Retrieve a list of all custom allocation rules for the organization # # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_number Page number for pagination - # @option opts [Integer] :page_size Page size for pagination - # @option opts [String] :filter_status Filter by file status - # @option opts [String] :sort Sort key with optional descending prefix - # @return [Array<(CustomCostsFileListResponse, Integer, Hash)>] CustomCostsFileListResponse data, response status code and response headers - def list_custom_costs_files_with_http_info(opts = {}) + # @return [Array<(ArbitraryRuleResponseArray, Integer, Hash)>] ArbitraryRuleResponseArray data, response status code and response headers + def list_custom_allocation_rules_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_custom_costs_files ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_custom_allocation_rules ...' end # resource path - local_var_path = '/api/v2/cost/custom_costs' + local_var_path = '/api/v2/cost/arbitrary_rule' # query parameters query_params = opts[:query_params] || {} - query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1625,13 +1557,13 @@ def list_custom_costs_files_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'CustomCostsFileListResponse' + return_type = opts[:debug_return_type] || 'ArbitraryRuleResponseArray' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_custom_costs_files, + :operation => :list_custom_allocation_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1643,35 +1575,43 @@ def list_custom_costs_files_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_custom_costs_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_custom_allocation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List rulesets. + # List Custom Costs files. # - # @see #list_rulesets_with_http_info - def list_rulesets(opts = {}) - data, _status_code, _headers = list_rulesets_with_http_info(opts) + # @see #list_custom_costs_files_with_http_info + def list_custom_costs_files(opts = {}) + data, _status_code, _headers = list_custom_costs_files_with_http_info(opts) data end - # List rulesets. + # List Custom Costs files. # - # List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization + # List the Custom Costs files. # # @param opts [Hash] the optional parameters - # @return [Array<(RulesetRespArray, Integer, Hash)>] RulesetRespArray data, response status code and response headers - def list_rulesets_with_http_info(opts = {}) + # @option opts [Integer] :page_number Page number for pagination + # @option opts [Integer] :page_size Page size for pagination + # @option opts [String] :filter_status Filter by file status + # @option opts [String] :sort Sort key with optional descending prefix + # @return [Array<(CustomCostsFileListResponse, Integer, Hash)>] CustomCostsFileListResponse data, response status code and response headers + def list_custom_costs_files_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_rulesets ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_custom_costs_files ...' end # resource path - local_var_path = '/api/v2/tags/enrichment' + local_var_path = '/api/v2/cost/custom_costs' # query parameters query_params = opts[:query_params] || {} + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1685,13 +1625,13 @@ def list_rulesets_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'RulesetRespArray' + return_type = opts[:debug_return_type] || 'CustomCostsFileListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_rulesets, + :operation => :list_custom_costs_files, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1703,43 +1643,32 @@ def list_rulesets_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_custom_costs_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Reorder arbitrary cost rules. + # List tag pipeline rulesets. # - # @see #reorder_arbitrary_cost_rules_with_http_info - def reorder_arbitrary_cost_rules(body, opts = {}) - reorder_arbitrary_cost_rules_with_http_info(body, opts) - nil + # @see #list_tag_pipelines_rulesets_with_http_info + def list_tag_pipelines_rulesets(opts = {}) + data, _status_code, _headers = list_tag_pipelines_rulesets_with_http_info(opts) + data end - # Reorder arbitrary cost rules. - # - # Reorder arbitrary cost rules - Change the execution order of arbitrary cost rules. - # - # **Important**: You must provide the **complete list** of all rule IDs in the desired execution order. The API will reorder ALL rules according to the provided sequence. + # List tag pipeline rulesets. # - # Rules are executed in the order specified, with lower indices (earlier in the array) having higher priority. - # - # **Example**: If you have rules with IDs [123, 456, 789] and want to change order from 123→456→789 to 456→123→789, send: [{"id": "456"}, {"id": "123"}, {"id": "789"}] + # List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization # - # @param body [ReorderRuleResourceArray] # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def reorder_arbitrary_cost_rules_with_http_info(body, opts = {}) + # @return [Array<(RulesetRespArray, Integer, Hash)>] RulesetRespArray data, response status code and response headers + def list_tag_pipelines_rulesets_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.reorder_arbitrary_cost_rules ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.reorder_arbitrary_cost_rules" + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_tag_pipelines_rulesets ...' end # resource path - local_var_path = '/api/v2/cost/arbitrary_rule/reorder' + local_var_path = '/api/v2/tags/enrichment' # query parameters query_params = opts[:query_params] || {} @@ -1747,24 +1676,22 @@ def reorder_arbitrary_cost_rules_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'RulesetRespArray' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :reorder_arbitrary_cost_rules, + :operation => :list_tag_pipelines_rulesets, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1774,39 +1701,45 @@ def reorder_arbitrary_cost_rules_with_http_info(body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#reorder_arbitrary_cost_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_tag_pipelines_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Reorder rulesets. + # Reorder custom allocation rules. # - # @see #reorder_rulesets_with_http_info - def reorder_rulesets(body, opts = {}) - reorder_rulesets_with_http_info(body, opts) + # @see #reorder_custom_allocation_rules_with_http_info + def reorder_custom_allocation_rules(body, opts = {}) + reorder_custom_allocation_rules_with_http_info(body, opts) nil end - # Reorder rulesets. + # Reorder custom allocation rules. # - # Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets + # Reorder custom allocation rules - Change the execution order of custom allocation rules. # - # @param body [ReorderRulesetResourceArray] + # **Important**: You must provide the **complete list** of all rule IDs in the desired execution order. The API will reorder ALL rules according to the provided sequence. + # + # Rules are executed in the order specified, with lower indices (earlier in the array) having higher priority. + # + # **Example**: If you have rules with IDs [123, 456, 789] and want to change order from 123→456→789 to 456→123→789, send: [{"id": "456"}, {"id": "123"}, {"id": "789"}] + # + # @param body [ReorderRuleResourceArray] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def reorder_rulesets_with_http_info(body, opts = {}) + def reorder_custom_allocation_rules_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.reorder_rulesets ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.reorder_custom_allocation_rules ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.reorder_rulesets" + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.reorder_custom_allocation_rules" end # resource path - local_var_path = '/api/v2/tags/enrichment/reorder' + local_var_path = '/api/v2/cost/arbitrary_rule/reorder' # query parameters query_params = opts[:query_params] || {} @@ -1831,7 +1764,7 @@ def reorder_rulesets_with_http_info(body, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :reorder_rulesets, + :operation => :reorder_custom_allocation_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1843,55 +1776,37 @@ def reorder_rulesets_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#reorder_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#reorder_custom_allocation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update arbitrary cost rule. + # Reorder tag pipeline rulesets. # - # @see #update_arbitrary_cost_rule_with_http_info - def update_arbitrary_cost_rule(rule_id, body, opts = {}) - data, _status_code, _headers = update_arbitrary_cost_rule_with_http_info(rule_id, body, opts) - data + # @see #reorder_tag_pipelines_rulesets_with_http_info + def reorder_tag_pipelines_rulesets(body, opts = {}) + reorder_tag_pipelines_rulesets_with_http_info(body, opts) + nil end - # Update arbitrary cost rule. - # - # Update an existing arbitrary cost rule with new filters and allocation strategy. - # - # **Strategy Methods:** - # - **PROPORTIONAL/EVEN**: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters. - # - **PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES**: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys. - # - **PERCENT**: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations). - # - **USAGE_METRIC**: Allocates based on usage metrics (implementation varies). - # - # **Filter Conditions:** - # - Use **value** for single-value conditions: "is", "is not", "contains", "does not contain", "=", "!=", "like", "not like", "is all values", "is untagged" - # - Use **values** for multi-value conditions: "in", "not in" - # - Cannot use both value and values simultaneously. + # Reorder tag pipeline rulesets. # - # **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like + # Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets # - # @param rule_id [Integer] The unique identifier of the arbitrary cost rule - # @param body [ArbitraryCostUpsertRequest] + # @param body [ReorderRulesetResourceArray] # @param opts [Hash] the optional parameters - # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers - def update_arbitrary_cost_rule_with_http_info(rule_id, body, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def reorder_tag_pipelines_rulesets_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_arbitrary_cost_rule ...' - end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.update_arbitrary_cost_rule" + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.reorder_tag_pipelines_rulesets ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_arbitrary_cost_rule" + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.reorder_tag_pipelines_rulesets" end # resource path - local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/tags/enrichment/reorder' # query parameters query_params = opts[:query_params] || {} @@ -1899,7 +1814,7 @@ def update_arbitrary_cost_rule_with_http_info(rule_id, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) @@ -1910,13 +1825,13 @@ def update_arbitrary_cost_rule_with_http_info(rule_id, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_arbitrary_cost_rule, + :operation => :reorder_tag_pipelines_rulesets, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1926,9 +1841,9 @@ def update_arbitrary_cost_rule_with_http_info(rule_id, body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_arbitrary_cost_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#reorder_tag_pipelines_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -2149,15 +2064,100 @@ def update_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, body, opt return data, status_code, headers end - # Update ruleset. + # Update custom allocation rule. + # + # @see #update_custom_allocation_rule_with_http_info + def update_custom_allocation_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_custom_allocation_rule_with_http_info(rule_id, body, opts) + data + end + + # Update custom allocation rule. + # + # Update an existing custom allocation rule with new filters and allocation strategy. + # + # **Strategy Methods:** + # - **PROPORTIONAL/EVEN**: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters. + # - **PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES**: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys. + # - **PERCENT**: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations). + # - **USAGE_METRIC**: Allocates based on usage metrics (implementation varies). + # + # **Filter Conditions:** + # - Use **value** for single-value conditions: "is", "is not", "contains", "does not contain", "=", "!=", "like", "not like", "is all values", "is untagged" + # - Use **values** for multi-value conditions: "in", "not in" + # - Cannot use both value and values simultaneously. + # + # **Supported operators**: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like + # + # @param rule_id [Integer] The unique identifier of the custom allocation rule + # @param body [ArbitraryCostUpsertRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ArbitraryRuleResponse, Integer, Hash)>] ArbitraryRuleResponse data, response status code and response headers + def update_custom_allocation_rule_with_http_info(rule_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_custom_allocation_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling CloudCostManagementAPI.update_custom_allocation_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_custom_allocation_rule" + end + # resource path + local_var_path = '/api/v2/cost/arbitrary_rule/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ArbitraryRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_custom_allocation_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_custom_allocation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update tag pipeline ruleset. # - # @see #update_ruleset_with_http_info - def update_ruleset(ruleset_id, body, opts = {}) - data, _status_code, _headers = update_ruleset_with_http_info(ruleset_id, body, opts) + # @see #update_tag_pipelines_ruleset_with_http_info + def update_tag_pipelines_ruleset(ruleset_id, body, opts = {}) + data, _status_code, _headers = update_tag_pipelines_ruleset_with_http_info(ruleset_id, body, opts) data end - # Update ruleset. + # Update tag pipeline ruleset. # # Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration # @@ -2165,18 +2165,18 @@ def update_ruleset(ruleset_id, body, opts = {}) # @param body [UpdateRulesetRequest] # @param opts [Hash] the optional parameters # @return [Array<(RulesetResp, Integer, Hash)>] RulesetResp data, response status code and response headers - def update_ruleset_with_http_info(ruleset_id, body, opts = {}) + def update_tag_pipelines_ruleset_with_http_info(ruleset_id, body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_ruleset ...' + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_tag_pipelines_ruleset ...' end # verify the required parameter 'ruleset_id' is set if @api_client.config.client_side_validation && ruleset_id.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.update_ruleset" + fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling CloudCostManagementAPI.update_tag_pipelines_ruleset" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_ruleset" + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_tag_pipelines_ruleset" end # resource path local_var_path = '/api/v2/tags/enrichment/{ruleset_id}'.sub('{ruleset_id}', CGI.escape(ruleset_id.to_s).gsub('%2F', '/')) @@ -2204,7 +2204,7 @@ def update_ruleset_with_http_info(ruleset_id, body, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_ruleset, + :operation => :update_tag_pipelines_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2216,7 +2216,7 @@ def update_ruleset_with_http_info(ruleset_id, body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_tag_pipelines_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/datadog_api_client/v2/models/arbitrary_rule_response_array.rb b/lib/datadog_api_client/v2/models/arbitrary_rule_response_array.rb index 3ce1ec329d16..17c7dd11b480 100644 --- a/lib/datadog_api_client/v2/models/arbitrary_rule_response_array.rb +++ b/lib/datadog_api_client/v2/models/arbitrary_rule_response_array.rb @@ -24,13 +24,17 @@ class ArbitraryRuleResponseArray # The `ArbitraryRuleResponseArray` `data`. attr_reader :data + # The `ArbitraryRuleResponseArray` `meta`. + attr_accessor :meta + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { - :'data' => :'data' + :'data' => :'data', + :'meta' => :'meta' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array' + :'data' => :'Array', + :'meta' => :'ArbitraryRuleResponseArrayMeta' } end @@ -65,6 +70,10 @@ def initialize(attributes = {}) self.data = value end end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end end # Check to see if the all the properties in the model are valid @@ -112,6 +121,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && + meta == o.meta && additional_properties == o.additional_properties end @@ -119,7 +129,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, additional_properties].hash + [data, meta, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/arbitrary_rule_response_array_meta.rb b/lib/datadog_api_client/v2/models/arbitrary_rule_response_array_meta.rb new file mode 100644 index 000000000000..0904808eda45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/arbitrary_rule_response_array_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The `ArbitraryRuleResponseArray` `meta`. + class ArbitraryRuleResponseArrayMeta + include BaseGenericModel + + # The `meta` `total_count`. + attr_accessor :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'total_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ArbitraryRuleResponseArrayMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/arbitrary_rule_response_data_attributes.rb b/lib/datadog_api_client/v2/models/arbitrary_rule_response_data_attributes.rb index a761d47165ac..dea39853d496 100644 --- a/lib/datadog_api_client/v2/models/arbitrary_rule_response_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/arbitrary_rule_response_data_attributes.rb @@ -36,6 +36,9 @@ class ArbitraryRuleResponseDataAttributes # The `attributes` `order_id`. attr_reader :order_id + # The `attributes` `processing_status`. + attr_accessor :processing_status + # The `attributes` `provider`. attr_reader :provider @@ -68,6 +71,7 @@ def self.attribute_map :'enabled' => :'enabled', :'last_modified_user_uuid' => :'last_modified_user_uuid', :'order_id' => :'order_id', + :'processing_status' => :'processing_status', :'provider' => :'provider', :'rejected' => :'rejected', :'rule_name' => :'rule_name', @@ -87,6 +91,7 @@ def self.openapi_types :'enabled' => :'Boolean', :'last_modified_user_uuid' => :'String', :'order_id' => :'Integer', + :'processing_status' => :'String', :'provider' => :'Array', :'rejected' => :'Boolean', :'rule_name' => :'String', @@ -137,6 +142,10 @@ def initialize(attributes = {}) self.order_id = attributes[:'order_id'] end + if attributes.key?(:'processing_status') + self.processing_status = attributes[:'processing_status'] + end + if attributes.key?(:'provider') if (value = attributes[:'provider']).is_a?(Array) self.provider = value @@ -331,6 +340,7 @@ def ==(o) enabled == o.enabled && last_modified_user_uuid == o.last_modified_user_uuid && order_id == o.order_id && + processing_status == o.processing_status && provider == o.provider && rejected == o.rejected && rule_name == o.rule_name && @@ -345,7 +355,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [costs_to_allocate, created, enabled, last_modified_user_uuid, order_id, provider, rejected, rule_name, strategy, type, updated, version, additional_properties].hash + [costs_to_allocate, created, enabled, last_modified_user_uuid, order_id, processing_status, provider, rejected, rule_name, strategy, type, updated, version, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes.rb b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes.rb index ec3ebf3095ae..14403a65bf19 100644 --- a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes.rb @@ -39,6 +39,9 @@ class RulesetRespDataAttributes # The `attributes` `position`. attr_reader :position + # The `attributes` `processing_status`. + attr_accessor :processing_status + # The `attributes` `rules`. attr_reader :rules @@ -57,6 +60,7 @@ def self.attribute_map :'modified' => :'modified', :'name' => :'name', :'position' => :'position', + :'processing_status' => :'processing_status', :'rules' => :'rules', :'version' => :'version' } @@ -72,6 +76,7 @@ def self.openapi_types :'modified' => :'RulesetRespDataAttributesModified', :'name' => :'String', :'position' => :'Integer', + :'processing_status' => :'String', :'rules' => :'Array', :'version' => :'Integer' } @@ -119,6 +124,10 @@ def initialize(attributes = {}) self.position = attributes[:'position'] end + if attributes.key?(:'processing_status') + self.processing_status = attributes[:'processing_status'] + end + if attributes.key?(:'rules') if (value = attributes[:'rules']).is_a?(Array) self.rules = value @@ -261,6 +270,7 @@ def ==(o) modified == o.modified && name == o.name && position == o.position && + processing_status == o.processing_status && rules == o.rules && version == o.version && additional_properties == o.additional_properties @@ -270,7 +280,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created, enabled, last_modified_user_uuid, modified, name, position, rules, version, additional_properties].hash + [created, enabled, last_modified_user_uuid, modified, name, position, processing_status, rules, version, additional_properties].hash end end end