diff --git a/.apigentools-info b/.apigentools-info index 19988b12fd..c8c6e873e6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-18 13:46:53.516392", - "spec_repo_commit": "f363f7b4" + "regenerated": "2023-12-20 09:49:08.661691", + "spec_repo_commit": "5fa7ed36" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-18 13:46:53.531307", - "spec_repo_commit": "f363f7b4" + "regenerated": "2023-12-20 09:49:08.676001", + "spec_repo_commit": "5fa7ed36" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fba681546e..408a52a3a9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -151,6 +151,13 @@ components: required: true schema: type: string + CloudAccountID: + description: Cloud Account id. + in: path + name: cloud_account_id + required: true + schema: + type: string CloudWorkloadSecurityAgentRuleID: description: The ID of the Agent rule. example: 3b5-v82-ns6 @@ -741,6 +748,49 @@ components: type: string x-enum-varnames: - API_KEYS + AWSRelatedAccount: + description: AWS related account. + properties: + attributes: + $ref: '#/components/schemas/AWSRelatedAccountAttributes' + id: + description: The AWS account ID. + example: '123456789123' + type: string + type: + $ref: '#/components/schemas/AWSRelatedAccountType' + required: + - id + - type + type: object + AWSRelatedAccountAttributes: + description: Attributes for an AWS related account. + properties: + has_datadog_integration: + description: Whether or not the AWS account has a Datadog integration. + type: boolean + name: + description: The name of the AWS account. + type: string + type: object + AWSRelatedAccountType: + default: aws_account + description: Type of AWS related account. + enum: + - aws_account + example: aws_account + type: string + x-enum-varnames: + - AWS_ACCOUNT + AWSRelatedAccountsResponse: + description: List of AWS related accounts. + properties: + data: + description: An AWS related account. + items: + $ref: '#/components/schemas/AWSRelatedAccount' + type: array + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -1369,6 +1419,457 @@ components: type: string x-enum-varnames: - AUTHN_MAPPINGS + AwsCURConfig: + description: AWS CUR config. + properties: + attributes: + $ref: '#/components/schemas/AwsCURConfigAttributes' + id: + description: The ID of the AWS CUR config. + format: int64 + type: integer + type: + $ref: '#/components/schemas/AwsCURConfigType' + required: + - attributes + - type + type: object + AwsCURConfigAttributes: + description: Attributes for An AWS CUR config. + properties: + account_id: + description: The AWS account ID. + example: '123456789123' + type: string + bucket_name: + description: The AWS bucket name used to store the Cost and Usage Report. + example: dd-cost-bucket + type: string + bucket_region: + description: The region the bucket is located in. + example: us-east-1 + type: string + created_at: + description: The timestamp when the AWS CUR config was created. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + error_messages: + description: The error messages for the AWS CUR config. + items: + type: string + type: array + months: + description: (deprecated) The number of months the report has been backfilled. + format: int32 + maximum: 36 + type: integer + report_name: + description: The name of the Cost and Usage Report. + example: dd-report-name + type: string + report_prefix: + description: The report prefix used for the Cost and Usage Report. + example: dd-report-prefix + type: string + status: + description: The status of the AWS CUR. + example: active + type: string + status_updated_at: + description: The timestamp when the AWS CUR config status was updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + updated_at: + description: The timestamp when the AWS CUR config status was updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + required: + - account_id + - bucket_name + - bucket_region + - report_name + - report_prefix + - status + type: object + AwsCURConfigPatchData: + description: AWS CUR config Patch data. + properties: + attributes: + $ref: '#/components/schemas/AwsCURConfigPatchRequestAttributes' + type: + $ref: '#/components/schemas/AwsCURConfigPatchRequestType' + required: + - attributes + - type + type: object + AwsCURConfigPatchRequest: + description: AWS CUR config Patch Request. + properties: + data: + $ref: '#/components/schemas/AwsCURConfigPatchData' + required: + - data + type: object + AwsCURConfigPatchRequestAttributes: + description: Attributes for AWS CUR config Patch Request. + properties: + is_enabled: + description: Whether or not the Cloud Cost Management account is enabled. + example: true + type: boolean + required: + - is_enabled + type: object + AwsCURConfigPatchRequestType: + default: aws_cur_config_patch_request + description: Type of AWS CUR config Patch Request. + enum: + - aws_cur_config_patch_request + example: aws_cur_config_patch_request + type: string + x-enum-varnames: + - AWS_CUR_CONFIG_PATCH_REQUEST + AwsCURConfigPostData: + description: AWS CUR config Post data. + properties: + attributes: + $ref: '#/components/schemas/AwsCURConfigPostRequestAttributes' + type: + $ref: '#/components/schemas/AwsCURConfigPostRequestType' + required: + - attributes + - type + type: object + AwsCURConfigPostRequest: + description: AWS CUR config Post Request. + properties: + data: + $ref: '#/components/schemas/AwsCURConfigPostData' + required: + - data + type: object + AwsCURConfigPostRequestAttributes: + description: Attributes for AWS CUR config Post Request. + properties: + account_id: + description: The AWS account ID. + example: '123456789123' + type: string + bucket_name: + description: The AWS bucket name used to store the Cost and Usage Report. + example: dd-cost-bucket + type: string + bucket_region: + description: The region the bucket is located in. + example: us-east-1 + type: string + is_enabled: + description: Whether or not the Cloud Cost Management account is enabled. + type: boolean + months: + description: The month of the report. + format: int32 + maximum: 36 + type: integer + report_name: + description: The name of the Cost and Usage Report. + example: dd-report-name + type: string + report_prefix: + description: The report prefix used for the Cost and Usage Report. + example: dd-report-prefix + type: string + required: + - account_id + - bucket_name + - report_name + - report_prefix + type: object + AwsCURConfigPostRequestType: + default: aws_cur_config_post_request + description: Type of AWS CUR config Post Request. + enum: + - aws_cur_config_post_request + example: aws_cur_config_post_request + type: string + x-enum-varnames: + - AWS_CUR_CONFIG_POST_REQUEST + AwsCURConfigResponse: + description: Response of AWS CUR config. + properties: + data: + $ref: '#/components/schemas/AwsCURConfig' + type: object + AwsCURConfigType: + default: aws_cur_config + description: Type of AWS CUR config. + enum: + - aws_cur_config + example: aws_cur_config + type: string + x-enum-varnames: + - AWS_CUR_CONFIG + AwsCURConfigsResponse: + description: List of AWS CUR configs. + properties: + data: + description: An AWS CUR config. + items: + $ref: '#/components/schemas/AwsCURConfig' + type: array + type: object + AzureUCConfig: + description: Azure config. + properties: + account_id: + description: The tenant ID of the azure account. + example: 1234abcd-1234-abcd-1234-1234abcd1234 + type: string + client_id: + description: The client ID of the Azure account. + example: 1234abcd-1234-abcd-1234-1234abcd1234 + type: string + created_at: + description: The timestamp when the Azure config was created. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + dataset_type: + description: The dataset type of the Azure config. + example: actual + type: string + error_messages: + description: The error messages for the Azure config. + items: + type: string + type: array + export_name: + description: The name of the configured Azure Export. + example: dd-actual-export + type: string + export_path: + description: The path where the Azure Export is saved. + example: dd-export-path + type: string + id: + description: The ID of the Azure config. + format: int64 + type: integer + months: + description: (deprecated) The number of months the report has been backfilled. + format: int32 + maximum: 36 + type: integer + scope: + description: The scope of your observed subscription. + example: subscriptions/1234abcd-1234-abcd-1234-1234abcd1234 + type: string + status: + description: The status of the Azure config. + example: active + type: string + status_updated_at: + description: The timestamp when the Azure config status was last updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + storage_account: + description: The name of the storage account where the Azure Export is saved. + example: dd-storage-account + type: string + storage_container: + description: The name of the storage container where the Azure Export is + saved. + example: dd-storage-container + type: string + updated_at: + description: The timestamp when the Azure config was last updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + required: + - account_id + - client_id + - dataset_type + - export_name + - export_path + - scope + - status + - storage_account + - storage_container + type: object + AzureUCConfigPair: + description: Azure config pair. + properties: + attributes: + $ref: '#/components/schemas/AzureUCConfigPairAttributes' + id: + description: The ID of Cloud Cost Management account. + format: int64 + type: integer + type: + $ref: '#/components/schemas/AzureUCConfigPairType' + required: + - attributes + - type + type: object + AzureUCConfigPairAttributes: + description: Attributes for Azure config pair. + properties: + configs: + description: An Azure config. + items: + $ref: '#/components/schemas/AzureUCConfig' + type: array + id: + description: The ID of the Azure config pair. + format: int64 + type: integer + required: + - configs + type: object + AzureUCConfigPairType: + default: azure_uc_configs + description: Type of Azure config pair. + enum: + - azure_uc_configs + example: azure_uc_configs + type: string + x-enum-varnames: + - AZURE_UC_CONFIGS + AzureUCConfigPairsResponse: + description: Response of Azure config pair. + properties: + data: + $ref: '#/components/schemas/AzureUCConfigPair' + type: object + AzureUCConfigPatchData: + description: Azure config Patch data. + properties: + attributes: + $ref: '#/components/schemas/AzureUCConfigPatchRequestAttributes' + type: + $ref: '#/components/schemas/AzureUCConfigPatchRequestType' + required: + - attributes + - type + type: object + AzureUCConfigPatchRequest: + description: Azure config Patch Request. + properties: + data: + $ref: '#/components/schemas/AzureUCConfigPatchData' + required: + - data + type: object + AzureUCConfigPatchRequestAttributes: + description: Attributes for Azure config Patch Request. + properties: + is_enabled: + description: Whether or not the Cloud Cost Management account is enabled. + example: true + type: boolean + required: + - is_enabled + type: object + AzureUCConfigPatchRequestType: + default: azure_uc_config_patch_request + description: Type of Azure config Patch Request. + enum: + - azure_uc_config_patch_request + example: azure_uc_config_patch_request + type: string + x-enum-varnames: + - AZURE_UC_CONFIG_PATCH_REQUEST + AzureUCConfigPostData: + description: Azure config Post data. + properties: + attributes: + $ref: '#/components/schemas/AzureUCConfigPostRequestAttributes' + type: + $ref: '#/components/schemas/AzureUCConfigPostRequestType' + required: + - attributes + - type + type: object + AzureUCConfigPostRequest: + description: Azure config Post Request. + properties: + data: + $ref: '#/components/schemas/AzureUCConfigPostData' + required: + - data + type: object + AzureUCConfigPostRequestAttributes: + description: Attributes for Azure config Post Request. + properties: + account_id: + description: The tenant ID of the azure account. + example: 1234abcd-1234-abcd-1234-1234abcd1234 + type: string + actual_bill_config: + $ref: '#/components/schemas/BillConfig' + amortized_bill_config: + $ref: '#/components/schemas/BillConfig' + client_id: + description: The client ID of the azure account. + example: 1234abcd-1234-abcd-1234-1234abcd1234 + type: string + is_enabled: + description: Whether or not the Cloud Cost Management account is enabled. + type: boolean + scope: + description: The scope of your observed subscription. + example: subscriptions/1234abcd-1234-abcd-1234-1234abcd1234 + type: string + required: + - account_id + - actual_bill_config + - amortized_bill_config + - client_id + - scope + type: object + AzureUCConfigPostRequestType: + default: azure_uc_config_post_request + description: Type of Azure config Post Request. + enum: + - azure_uc_config_post_request + example: azure_uc_config_post_request + type: string + x-enum-varnames: + - AZURE_UC_CONFIG_POST_REQUEST + AzureUCConfigsResponse: + description: List of Azure accounts with configs. + properties: + data: + description: An Azure config pair. + items: + $ref: '#/components/schemas/AzureUCConfigPair' + type: array + type: object + BillConfig: + description: Bill config. + properties: + export_name: + description: The name of the configured Azure Export. + example: dd-actual-export + type: string + export_path: + description: The path where the Azure Export is saved. + example: dd-export-path + type: string + storage_account: + description: The name of the storage account where the Azure Export is saved. + example: dd-storage-account + type: string + storage_container: + description: The name of the storage container where the Azure Export is + saved. + example: dd-storage-container + type: string + required: + - export_name + - export_path + - storage_account + - storage_container + type: object BulkMuteFindingsRequest: description: The new bulk mute finding request. properties: @@ -3005,18 +3506,54 @@ components: type: string x-enum-varnames: - CLOUD_CONFIGURATION - CloudWorkloadSecurityAgentRuleAttributes: - description: A Cloud Workload Security Agent rule returned by the API. + CloudCostActivity: + description: Cloud Cost Activity. properties: - agentConstraint: - description: The version of the agent. - type: string - category: - description: The category of the Agent rule. - example: Process Activity - type: string - creationAuthorUuId: - description: The ID of the user who created the rule. + attributes: + $ref: '#/components/schemas/CloudCostActivityAttributes' + type: + $ref: '#/components/schemas/CloudCostActivityType' + required: + - attributes + - type + type: object + CloudCostActivityAttributes: + description: Attributes for Cloud Cost activity. + properties: + is_enabled: + description: Whether or not the cloud account is enabled. + example: true + type: boolean + required: + - is_enabled + type: object + CloudCostActivityResponse: + description: Response for Cloud Cost activity. + properties: + data: + $ref: '#/components/schemas/CloudCostActivity' + type: object + CloudCostActivityType: + default: cloud_cost_activity + description: Type of Cloud Cost Activity. + enum: + - cloud_cost_activity + example: cloud_cost_activity + type: string + x-enum-varnames: + - CLOUD_COST_ACTIVITY + CloudWorkloadSecurityAgentRuleAttributes: + description: A Cloud Workload Security Agent rule returned by the API. + properties: + agentConstraint: + description: The version of the agent. + type: string + category: + description: The category of the Agent rule. + example: Process Activity + type: string + creationAuthorUuId: + description: The ID of the user who created the rule. example: e51c9744-d158-11ec-ad23-da7ad0900002 type: string creationDate: @@ -21401,6 +21938,361 @@ paths: cursorPath: meta.pagination.next_cursor limitParam: page[size] resultsPath: data + /api/v2/cost/aws_cur_config: + get: + description: List the AWS CUR configs. + operationId: ListCostAWSCURConfigs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AwsCURConfigsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List Cloud Cost Management AWS CUR configs + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_READ + post: + description: Create a Cloud Cost Management account for an AWS CUR config. + operationId: CreateCostAWSCURConfig + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AwsCURConfigPostRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AwsCURConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create Cloud Cost Management AWS CUR config + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + /api/v2/cost/aws_cur_config/{cloud_account_id}: + delete: + description: Archive a Cloud Cost Management Account. + operationId: DeleteCostAWSCURConfig + parameters: + - $ref: '#/components/parameters/CloudAccountID' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete Cloud Cost Management AWS CUR config + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + patch: + description: Update the status of an AWS CUR config (active/archived). + operationId: UpdateCostAWSCURConfig + parameters: + - $ref: '#/components/parameters/CloudAccountID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AwsCURConfigPatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AwsCURConfigsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update Cloud Cost Management AWS CUR config + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + /api/v2/cost/aws_related_accounts: + get: + description: List the AWS accounts in an organization by calling 'organizations:ListAccounts' + from the specified management account. + operationId: ListAWSRelatedAccounts + parameters: + - description: The ID of the management account to filter by. + example: '123456789123' + in: query + name: filter[management_account_id] + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRelatedAccountsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List related AWS accounts + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_READ + /api/v2/cost/azure_uc_config: + get: + description: List the Azure configs. + operationId: ListCostAzureUCConfigs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureUCConfigsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List Cloud Cost Management Azure configs + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_READ + post: + description: Create a Cloud Cost Management account for an Azure config. + operationId: CreateCostAzureUCConfigs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AzureUCConfigPostRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureUCConfigPairsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create Cloud Cost Management Azure configs + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + /api/v2/cost/azure_uc_config/{cloud_account_id}: + delete: + description: Archive a Cloud Cost Management Account. + operationId: DeleteCostAzureUCConfig + parameters: + - $ref: '#/components/parameters/CloudAccountID' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete Cloud Cost Management Azure config + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + patch: + description: Update the status of an Azure config (active/archived). + operationId: UpdateCostAzureUCConfigs + parameters: + - $ref: '#/components/parameters/CloudAccountID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AzureUCConfigPatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureUCConfigPairsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update Cloud Cost Management Azure config + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_WRITE + /api/v2/cost/enabled: + get: + description: Get the Cloud Cost Management activity. + operationId: GetCloudCostActivity + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CloudCostActivityResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Cloud Cost Enabled + tags: + - Cloud Cost Management + x-permission: + operator: OR + permissions: + - CLOUD_COST_MANAGEMENT_READ /api/v2/cost_by_tag/active_billing_dimensions: get: description: Get active billing dimensions for cost attribution. Cost data for @@ -31707,6 +32599,9 @@ tags: name: CI Visibility Pipelines - description: Search or aggregate your CI Visibility test events over HTTP. name: CI Visibility Tests +- description: The Cloud Cost Management API allows you to setup, edit and delete + cloud cost management accounts for AWS & Azure. + name: Cloud Cost Management - description: Workload activity security rules for generating events using the Datadog security Agent. name: Cloud Workload Security diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index c229e6e70b..71c58f6eae 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -36,6 +36,13 @@ ci\_visibility\_tests\_api :members: :show-inheritance: +cloud\_cost\_management\_api +---------------------------- + +.. automodule:: datadog_api_client.v2.api.cloud_cost_management_api + :members: + :show-inheritance: + cloud\_workload\_security\_api ------------------------------ diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 2884d1252d..f8892b616f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -442,6 +442,230 @@ authn\_mappings\_type :members: :show-inheritance: +aws\_cur\_config +---------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config + :members: + :show-inheritance: + +aws\_cur\_config\_attributes +---------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_attributes + :members: + :show-inheritance: + +aws\_cur\_config\_patch\_data +----------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_patch_data + :members: + :show-inheritance: + +aws\_cur\_config\_patch\_request +-------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_patch_request + :members: + :show-inheritance: + +aws\_cur\_config\_patch\_request\_attributes +-------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_patch_request_attributes + :members: + :show-inheritance: + +aws\_cur\_config\_patch\_request\_type +-------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_patch_request_type + :members: + :show-inheritance: + +aws\_cur\_config\_post\_data +---------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_post_data + :members: + :show-inheritance: + +aws\_cur\_config\_post\_request +------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_post_request + :members: + :show-inheritance: + +aws\_cur\_config\_post\_request\_attributes +------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_post_request_attributes + :members: + :show-inheritance: + +aws\_cur\_config\_post\_request\_type +------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_post_request_type + :members: + :show-inheritance: + +aws\_cur\_config\_response +-------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_response + :members: + :show-inheritance: + +aws\_cur\_config\_type +---------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_config_type + :members: + :show-inheritance: + +aws\_cur\_configs\_response +--------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cur_configs_response + :members: + :show-inheritance: + +aws\_related\_account +--------------------- + +.. automodule:: datadog_api_client.v2.model.aws_related_account + :members: + :show-inheritance: + +aws\_related\_account\_attributes +--------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_related_account_attributes + :members: + :show-inheritance: + +aws\_related\_account\_type +--------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_related_account_type + :members: + :show-inheritance: + +aws\_related\_accounts\_response +-------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_related_accounts_response + :members: + :show-inheritance: + +azure\_uc\_config +----------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config + :members: + :show-inheritance: + +azure\_uc\_config\_pair +----------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_pair + :members: + :show-inheritance: + +azure\_uc\_config\_pair\_attributes +----------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_pair_attributes + :members: + :show-inheritance: + +azure\_uc\_config\_pair\_type +----------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_pair_type + :members: + :show-inheritance: + +azure\_uc\_config\_pairs\_response +---------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_pairs_response + :members: + :show-inheritance: + +azure\_uc\_config\_patch\_data +------------------------------ + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_patch_data + :members: + :show-inheritance: + +azure\_uc\_config\_patch\_request +--------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_patch_request + :members: + :show-inheritance: + +azure\_uc\_config\_patch\_request\_attributes +--------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_patch_request_attributes + :members: + :show-inheritance: + +azure\_uc\_config\_patch\_request\_type +--------------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_patch_request_type + :members: + :show-inheritance: + +azure\_uc\_config\_post\_data +----------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_post_data + :members: + :show-inheritance: + +azure\_uc\_config\_post\_request +-------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_post_request + :members: + :show-inheritance: + +azure\_uc\_config\_post\_request\_attributes +-------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_post_request_attributes + :members: + :show-inheritance: + +azure\_uc\_config\_post\_request\_type +-------------------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_config_post_request_type + :members: + :show-inheritance: + +azure\_uc\_configs\_response +---------------------------- + +.. automodule:: datadog_api_client.v2.model.azure_uc_configs_response + :members: + :show-inheritance: + +bill\_config +------------ + +.. automodule:: datadog_api_client.v2.model.bill_config + :members: + :show-inheritance: + bulk\_mute\_findings\_request ----------------------------- @@ -1044,6 +1268,34 @@ cloud\_configuration\_rule\_type :members: :show-inheritance: +cloud\_cost\_activity +--------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_cost_activity + :members: + :show-inheritance: + +cloud\_cost\_activity\_attributes +--------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_cost_activity_attributes + :members: + :show-inheritance: + +cloud\_cost\_activity\_response +------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_cost_activity_response + :members: + :show-inheritance: + +cloud\_cost\_activity\_type +--------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_cost_activity_type + :members: + :show-inheritance: + cloud\_workload\_security\_agent\_rule\_attributes -------------------------------------------------- diff --git a/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.py b/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.py new file mode 100644 index 0000000000..d3783be994 --- /dev/null +++ b/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.py @@ -0,0 +1,30 @@ +""" +Create Cloud Cost Management AWS CUR config returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.aws_cur_config_post_data import AwsCURConfigPostData +from datadog_api_client.v2.model.aws_cur_config_post_request import AwsCURConfigPostRequest +from datadog_api_client.v2.model.aws_cur_config_post_request_attributes import AwsCURConfigPostRequestAttributes +from datadog_api_client.v2.model.aws_cur_config_post_request_type import AwsCURConfigPostRequestType + +body = AwsCURConfigPostRequest( + data=AwsCURConfigPostData( + attributes=AwsCURConfigPostRequestAttributes( + account_id="123456789123", + bucket_name="dd-cost-bucket", + bucket_region="us-east-1", + report_name="dd-report-name", + report_prefix="dd-report-prefix", + ), + type=AwsCURConfigPostRequestType.AWS_CUR_CONFIG_POST_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.create_cost_awscur_config(body=body) + + print(response) diff --git a/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.py b/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.py new file mode 100644 index 0000000000..cea54a023d --- /dev/null +++ b/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.py @@ -0,0 +1,42 @@ +""" +Create Cloud Cost Management Azure configs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.azure_uc_config_post_data import AzureUCConfigPostData +from datadog_api_client.v2.model.azure_uc_config_post_request import AzureUCConfigPostRequest +from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import AzureUCConfigPostRequestAttributes +from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType +from datadog_api_client.v2.model.bill_config import BillConfig + +body = AzureUCConfigPostRequest( + data=AzureUCConfigPostData( + attributes=AzureUCConfigPostRequestAttributes( + account_id="1234abcd-1234-abcd-1234-1234abcd1234", + actual_bill_config=BillConfig( + export_name="dd-actual-export", + export_path="dd-export-path", + storage_account="dd-storage-account", + storage_container="dd-storage-container", + ), + amortized_bill_config=BillConfig( + 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", + is_enabled=True, + scope="subscriptions/1234abcd-1234-abcd-1234-1234abcd1234", + ), + type=AzureUCConfigPostRequestType.AZURE_UC_CONFIG_POST_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.create_cost_azure_uc_configs(body=body) + + print(response) diff --git a/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py b/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py new file mode 100644 index 0000000000..dfa3347504 --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py @@ -0,0 +1,13 @@ +""" +Delete Cloud Cost Management AWS CUR config returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + api_instance.delete_cost_awscur_config( + cloud_account_id="100", + ) diff --git a/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py b/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py new file mode 100644 index 0000000000..3e2932197c --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py @@ -0,0 +1,13 @@ +""" +Delete Cloud Cost Management Azure config returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + api_instance.delete_cost_azure_uc_config( + cloud_account_id="100", + ) diff --git a/examples/v2/cloud-cost-management/GetCloudCostActivity.py b/examples/v2/cloud-cost-management/GetCloudCostActivity.py new file mode 100644 index 0000000000..22b293b1ce --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCloudCostActivity.py @@ -0,0 +1,13 @@ +""" +Cloud Cost Enabled returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_cloud_cost_activity() + + print(response) diff --git a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.py b/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.py new file mode 100644 index 0000000000..c21d4b8b78 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.py @@ -0,0 +1,15 @@ +""" +List related AWS accounts returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.list_aws_related_accounts( + filter_management_account_id="123456789123", + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.py b/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.py new file mode 100644 index 0000000000..2e06c73d5a --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.py @@ -0,0 +1,13 @@ +""" +List Cloud Cost Management AWS CUR configs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.list_cost_awscur_configs() + + print(response) diff --git a/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.py b/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.py new file mode 100644 index 0000000000..749bd6a3a4 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.py @@ -0,0 +1,13 @@ +""" +List Cloud Cost Management Azure configs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.list_cost_azure_uc_configs() + + print(response) diff --git a/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py b/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py new file mode 100644 index 0000000000..b84af2bf49 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py @@ -0,0 +1,26 @@ +""" +Update Cloud Cost Management AWS CUR config returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData +from datadog_api_client.v2.model.aws_cur_config_patch_request import AwsCURConfigPatchRequest +from datadog_api_client.v2.model.aws_cur_config_patch_request_attributes import AwsCURConfigPatchRequestAttributes +from datadog_api_client.v2.model.aws_cur_config_patch_request_type import AwsCURConfigPatchRequestType + +body = AwsCURConfigPatchRequest( + data=AwsCURConfigPatchData( + attributes=AwsCURConfigPatchRequestAttributes( + is_enabled=True, + ), + type=AwsCURConfigPatchRequestType.AWS_CUR_CONFIG_PATCH_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.update_cost_awscur_config(cloud_account_id="100", body=body) + + print(response) diff --git a/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py b/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py new file mode 100644 index 0000000000..78257b9c5f --- /dev/null +++ b/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py @@ -0,0 +1,26 @@ +""" +Update Cloud Cost Management Azure config returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.azure_uc_config_patch_data import AzureUCConfigPatchData +from datadog_api_client.v2.model.azure_uc_config_patch_request import AzureUCConfigPatchRequest +from datadog_api_client.v2.model.azure_uc_config_patch_request_attributes import AzureUCConfigPatchRequestAttributes +from datadog_api_client.v2.model.azure_uc_config_patch_request_type import AzureUCConfigPatchRequestType + +body = AzureUCConfigPatchRequest( + data=AzureUCConfigPatchData( + attributes=AzureUCConfigPatchRequestAttributes( + is_enabled=True, + ), + type=AzureUCConfigPatchRequestType.AZURE_UC_CONFIG_PATCH_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.update_cost_azure_uc_configs(cloud_account_id="100", body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py new file mode 100644 index 0000000000..2a7565743a --- /dev/null +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -0,0 +1,400 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.aws_cur_configs_response import AwsCURConfigsResponse +from datadog_api_client.v2.model.aws_cur_config_response import AwsCURConfigResponse +from datadog_api_client.v2.model.aws_cur_config_post_request import AwsCURConfigPostRequest +from datadog_api_client.v2.model.aws_cur_config_patch_request import AwsCURConfigPatchRequest +from datadog_api_client.v2.model.aws_related_accounts_response import AWSRelatedAccountsResponse +from datadog_api_client.v2.model.azure_uc_configs_response import AzureUCConfigsResponse +from datadog_api_client.v2.model.azure_uc_config_pairs_response import AzureUCConfigPairsResponse +from datadog_api_client.v2.model.azure_uc_config_post_request import AzureUCConfigPostRequest +from datadog_api_client.v2.model.azure_uc_config_patch_request import AzureUCConfigPatchRequest +from datadog_api_client.v2.model.cloud_cost_activity_response import CloudCostActivityResponse + + +class CloudCostManagementApi: + """ + The Cloud Cost Management API allows you to setup, edit and delete cloud cost management accounts for AWS & Azure. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_cost_awscur_config_endpoint = _Endpoint( + settings={ + "response_type": (AwsCURConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/aws_cur_config", + "operation_id": "create_cost_awscur_config", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AwsCURConfigPostRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_cost_azure_uc_configs_endpoint = _Endpoint( + settings={ + "response_type": (AzureUCConfigPairsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/azure_uc_config", + "operation_id": "create_cost_azure_uc_configs", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AzureUCConfigPostRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_cost_awscur_config_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/aws_cur_config/{cloud_account_id}", + "operation_id": "delete_cost_awscur_config", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "cloud_account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "cloud_account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_cost_azure_uc_config_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/azure_uc_config/{cloud_account_id}", + "operation_id": "delete_cost_azure_uc_config", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "cloud_account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "cloud_account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_cloud_cost_activity_endpoint = _Endpoint( + settings={ + "response_type": (CloudCostActivityResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/enabled", + "operation_id": "get_cloud_cost_activity", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_aws_related_accounts_endpoint = _Endpoint( + settings={ + "response_type": (AWSRelatedAccountsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/aws_related_accounts", + "operation_id": "list_aws_related_accounts", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_management_account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "filter[management_account_id]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_cost_awscur_configs_endpoint = _Endpoint( + settings={ + "response_type": (AwsCURConfigsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/aws_cur_config", + "operation_id": "list_cost_awscur_configs", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_cost_azure_uc_configs_endpoint = _Endpoint( + settings={ + "response_type": (AzureUCConfigsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/azure_uc_config", + "operation_id": "list_cost_azure_uc_configs", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_cost_awscur_config_endpoint = _Endpoint( + settings={ + "response_type": (AwsCURConfigsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/aws_cur_config/{cloud_account_id}", + "operation_id": "update_cost_awscur_config", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "cloud_account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "cloud_account_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AwsCURConfigPatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_cost_azure_uc_configs_endpoint = _Endpoint( + settings={ + "response_type": (AzureUCConfigPairsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cost/azure_uc_config/{cloud_account_id}", + "operation_id": "update_cost_azure_uc_configs", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "cloud_account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "cloud_account_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AzureUCConfigPatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_cost_awscur_config( + self, + body: AwsCURConfigPostRequest, + ) -> AwsCURConfigResponse: + """Create Cloud Cost Management AWS CUR config. + + Create a Cloud Cost Management account for an AWS CUR config. + + :type body: AwsCURConfigPostRequest + :rtype: AwsCURConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_cost_awscur_config_endpoint.call_with_http_info(**kwargs) + + def create_cost_azure_uc_configs( + self, + body: AzureUCConfigPostRequest, + ) -> AzureUCConfigPairsResponse: + """Create Cloud Cost Management Azure configs. + + Create a Cloud Cost Management account for an Azure config. + + :type body: AzureUCConfigPostRequest + :rtype: AzureUCConfigPairsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_cost_azure_uc_configs_endpoint.call_with_http_info(**kwargs) + + def delete_cost_awscur_config( + self, + cloud_account_id: str, + ) -> None: + """Delete Cloud Cost Management AWS CUR config. + + Archive a Cloud Cost Management Account. + + :param cloud_account_id: Cloud Account id. + :type cloud_account_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["cloud_account_id"] = cloud_account_id + + return self._delete_cost_awscur_config_endpoint.call_with_http_info(**kwargs) + + def delete_cost_azure_uc_config( + self, + cloud_account_id: str, + ) -> None: + """Delete Cloud Cost Management Azure config. + + Archive a Cloud Cost Management Account. + + :param cloud_account_id: Cloud Account id. + :type cloud_account_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["cloud_account_id"] = cloud_account_id + + return self._delete_cost_azure_uc_config_endpoint.call_with_http_info(**kwargs) + + def get_cloud_cost_activity( + self, + ) -> CloudCostActivityResponse: + """Cloud Cost Enabled. + + Get the Cloud Cost Management activity. + + :rtype: CloudCostActivityResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_cloud_cost_activity_endpoint.call_with_http_info(**kwargs) + + def list_aws_related_accounts( + self, + filter_management_account_id: str, + ) -> AWSRelatedAccountsResponse: + """List related AWS accounts. + + List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account. + + :param filter_management_account_id: The ID of the management account to filter by. + :type filter_management_account_id: str + :rtype: AWSRelatedAccountsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["filter_management_account_id"] = filter_management_account_id + + return self._list_aws_related_accounts_endpoint.call_with_http_info(**kwargs) + + def list_cost_awscur_configs( + self, + ) -> AwsCURConfigsResponse: + """List Cloud Cost Management AWS CUR configs. + + List the AWS CUR configs. + + :rtype: AwsCURConfigsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_cost_awscur_configs_endpoint.call_with_http_info(**kwargs) + + def list_cost_azure_uc_configs( + self, + ) -> AzureUCConfigsResponse: + """List Cloud Cost Management Azure configs. + + List the Azure configs. + + :rtype: AzureUCConfigsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_cost_azure_uc_configs_endpoint.call_with_http_info(**kwargs) + + def update_cost_awscur_config( + self, + cloud_account_id: str, + body: AwsCURConfigPatchRequest, + ) -> AwsCURConfigsResponse: + """Update Cloud Cost Management AWS CUR config. + + Update the status of an AWS CUR config (active/archived). + + :param cloud_account_id: Cloud Account id. + :type cloud_account_id: str + :type body: AwsCURConfigPatchRequest + :rtype: AwsCURConfigsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["cloud_account_id"] = cloud_account_id + + kwargs["body"] = body + + return self._update_cost_awscur_config_endpoint.call_with_http_info(**kwargs) + + def update_cost_azure_uc_configs( + self, + cloud_account_id: str, + body: AzureUCConfigPatchRequest, + ) -> AzureUCConfigPairsResponse: + """Update Cloud Cost Management Azure config. + + Update the status of an Azure config (active/archived). + + :param cloud_account_id: Cloud Account id. + :type cloud_account_id: str + :type body: AzureUCConfigPatchRequest + :rtype: AzureUCConfigPairsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["cloud_account_id"] = cloud_account_id + + kwargs["body"] = body + + return self._update_cost_azure_uc_configs_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 8069ec3b32..f2af6260d7 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -3,6 +3,7 @@ from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi from datadog_api_client.v2.api.ci_visibility_pipelines_api import CIVisibilityPipelinesApi from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi from datadog_api_client.v2.api.cloudflare_integration_api import CloudflareIntegrationApi from datadog_api_client.v2.api.confluent_cloud_api import ConfluentCloudApi @@ -51,6 +52,7 @@ "AuthNMappingsApi", "CIVisibilityPipelinesApi", "CIVisibilityTestsApi", + "CloudCostManagementApi", "CloudWorkloadSecurityApi", "CloudflareIntegrationApi", "ConfluentCloudApi", diff --git a/src/datadog_api_client/v2/model/aws_cur_config.py b/src/datadog_api_client/v2/model/aws_cur_config.py new file mode 100644 index 0000000000..9c93da4b95 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config.py @@ -0,0 +1,59 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config_attributes import AwsCURConfigAttributes + from datadog_api_client.v2.model.aws_cur_config_type import AwsCURConfigType + + +class AwsCURConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config_attributes import AwsCURConfigAttributes + from datadog_api_client.v2.model.aws_cur_config_type import AwsCURConfigType + + return { + "attributes": (AwsCURConfigAttributes,), + "id": (int,), + "type": (AwsCURConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: AwsCURConfigAttributes, type: AwsCURConfigType, id: Union[int, UnsetType] = unset, **kwargs + ): + """ + AWS CUR config. + + :param attributes: Attributes for An AWS CUR config. + :type attributes: AwsCURConfigAttributes + + :param id: The ID of the AWS CUR config. + :type id: int, optional + + :param type: Type of AWS CUR config. + :type type: AwsCURConfigType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_cur_config_attributes.py b/src/datadog_api_client/v2/model/aws_cur_config_attributes.py new file mode 100644 index 0000000000..1724609ef7 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_attributes.py @@ -0,0 +1,124 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AwsCURConfigAttributes(ModelNormal): + validations = { + "created_at": {}, + "months": { + "inclusive_maximum": 36, + }, + "status_updated_at": {}, + "updated_at": {}, + } + + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "bucket_name": (str,), + "bucket_region": (str,), + "created_at": (str,), + "error_messages": ([str],), + "months": (int,), + "report_name": (str,), + "report_prefix": (str,), + "status": (str,), + "status_updated_at": (str,), + "updated_at": (str,), + } + + attribute_map = { + "account_id": "account_id", + "bucket_name": "bucket_name", + "bucket_region": "bucket_region", + "created_at": "created_at", + "error_messages": "error_messages", + "months": "months", + "report_name": "report_name", + "report_prefix": "report_prefix", + "status": "status", + "status_updated_at": "status_updated_at", + "updated_at": "updated_at", + } + + def __init__( + self_, + account_id: str, + bucket_name: str, + bucket_region: str, + report_name: str, + report_prefix: str, + status: str, + created_at: Union[str, UnsetType] = unset, + error_messages: Union[List[str], UnsetType] = unset, + months: Union[int, UnsetType] = unset, + status_updated_at: Union[str, UnsetType] = unset, + updated_at: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for An AWS CUR config. + + :param account_id: The AWS account ID. + :type account_id: str + + :param bucket_name: The AWS bucket name used to store the Cost and Usage Report. + :type bucket_name: str + + :param bucket_region: The region the bucket is located in. + :type bucket_region: str + + :param created_at: The timestamp when the AWS CUR config was created. + :type created_at: str, optional + + :param error_messages: The error messages for the AWS CUR config. + :type error_messages: [str], optional + + :param months: (deprecated) The number of months the report has been backfilled. + :type months: int, optional + + :param report_name: The name of the Cost and Usage Report. + :type report_name: str + + :param report_prefix: The report prefix used for the Cost and Usage Report. + :type report_prefix: str + + :param status: The status of the AWS CUR. + :type status: str + + :param status_updated_at: The timestamp when the AWS CUR config status was updated. + :type status_updated_at: str, optional + + :param updated_at: The timestamp when the AWS CUR config status was updated. + :type updated_at: str, optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if error_messages is not unset: + kwargs["error_messages"] = error_messages + if months is not unset: + kwargs["months"] = months + if status_updated_at is not unset: + kwargs["status_updated_at"] = status_updated_at + if updated_at is not unset: + kwargs["updated_at"] = updated_at + super().__init__(kwargs) + + self_.account_id = account_id + self_.bucket_name = bucket_name + self_.bucket_region = bucket_region + self_.report_name = report_name + self_.report_prefix = report_prefix + self_.status = status diff --git a/src/datadog_api_client/v2/model/aws_cur_config_patch_data.py b/src/datadog_api_client/v2/model/aws_cur_config_patch_data.py new file mode 100644 index 0000000000..dd7e0e96ff --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_patch_data.py @@ -0,0 +1,50 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config_patch_request_attributes import AwsCURConfigPatchRequestAttributes + from datadog_api_client.v2.model.aws_cur_config_patch_request_type import AwsCURConfigPatchRequestType + + +class AwsCURConfigPatchData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config_patch_request_attributes import ( + AwsCURConfigPatchRequestAttributes, + ) + from datadog_api_client.v2.model.aws_cur_config_patch_request_type import AwsCURConfigPatchRequestType + + return { + "attributes": (AwsCURConfigPatchRequestAttributes,), + "type": (AwsCURConfigPatchRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AwsCURConfigPatchRequestAttributes, type: AwsCURConfigPatchRequestType, **kwargs): + """ + AWS CUR config Patch data. + + :param attributes: Attributes for AWS CUR config Patch Request. + :type attributes: AwsCURConfigPatchRequestAttributes + + :param type: Type of AWS CUR config Patch Request. + :type type: AwsCURConfigPatchRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_cur_config_patch_request.py b/src/datadog_api_client/v2/model/aws_cur_config_patch_request.py new file mode 100644 index 0000000000..b4ccb0870a --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_patch_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData + + +class AwsCURConfigPatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData + + return { + "data": (AwsCURConfigPatchData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AwsCURConfigPatchData, **kwargs): + """ + AWS CUR config Patch Request. + + :param data: AWS CUR config Patch data. + :type data: AwsCURConfigPatchData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/aws_cur_config_patch_request_attributes.py b/src/datadog_api_client/v2/model/aws_cur_config_patch_request_attributes.py new file mode 100644 index 0000000000..86d32c9509 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_patch_request_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AwsCURConfigPatchRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "is_enabled": (bool,), + } + + attribute_map = { + "is_enabled": "is_enabled", + } + + def __init__(self_, is_enabled: bool, **kwargs): + """ + Attributes for AWS CUR config Patch Request. + + :param is_enabled: Whether or not the Cloud Cost Management account is enabled. + :type is_enabled: bool + """ + super().__init__(kwargs) + + self_.is_enabled = is_enabled diff --git a/src/datadog_api_client/v2/model/aws_cur_config_patch_request_type.py b/src/datadog_api_client/v2/model/aws_cur_config_patch_request_type.py new file mode 100644 index 0000000000..7d7578b1ea --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_patch_request_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AwsCURConfigPatchRequestType(ModelSimple): + """ + Type of AWS CUR config Patch Request. + + :param value: If omitted defaults to "aws_cur_config_patch_request". Must be one of ["aws_cur_config_patch_request"]. + :type value: str + """ + + allowed_values = { + "aws_cur_config_patch_request", + } + AWS_CUR_CONFIG_PATCH_REQUEST: ClassVar["AwsCURConfigPatchRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AwsCURConfigPatchRequestType.AWS_CUR_CONFIG_PATCH_REQUEST = AwsCURConfigPatchRequestType("aws_cur_config_patch_request") diff --git a/src/datadog_api_client/v2/model/aws_cur_config_post_data.py b/src/datadog_api_client/v2/model/aws_cur_config_post_data.py new file mode 100644 index 0000000000..ce3d69dedd --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_post_data.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config_post_request_attributes import AwsCURConfigPostRequestAttributes + from datadog_api_client.v2.model.aws_cur_config_post_request_type import AwsCURConfigPostRequestType + + +class AwsCURConfigPostData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config_post_request_attributes import AwsCURConfigPostRequestAttributes + from datadog_api_client.v2.model.aws_cur_config_post_request_type import AwsCURConfigPostRequestType + + return { + "attributes": (AwsCURConfigPostRequestAttributes,), + "type": (AwsCURConfigPostRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AwsCURConfigPostRequestAttributes, type: AwsCURConfigPostRequestType, **kwargs): + """ + AWS CUR config Post data. + + :param attributes: Attributes for AWS CUR config Post Request. + :type attributes: AwsCURConfigPostRequestAttributes + + :param type: Type of AWS CUR config Post Request. + :type type: AwsCURConfigPostRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_cur_config_post_request.py b/src/datadog_api_client/v2/model/aws_cur_config_post_request.py new file mode 100644 index 0000000000..18b5a1543b --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_post_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config_post_data import AwsCURConfigPostData + + +class AwsCURConfigPostRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config_post_data import AwsCURConfigPostData + + return { + "data": (AwsCURConfigPostData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AwsCURConfigPostData, **kwargs): + """ + AWS CUR config Post Request. + + :param data: AWS CUR config Post data. + :type data: AwsCURConfigPostData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py b/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py new file mode 100644 index 0000000000..eee38ccde5 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py @@ -0,0 +1,91 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AwsCURConfigPostRequestAttributes(ModelNormal): + validations = { + "months": { + "inclusive_maximum": 36, + }, + } + + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "bucket_name": (str,), + "bucket_region": (str,), + "is_enabled": (bool,), + "months": (int,), + "report_name": (str,), + "report_prefix": (str,), + } + + attribute_map = { + "account_id": "account_id", + "bucket_name": "bucket_name", + "bucket_region": "bucket_region", + "is_enabled": "is_enabled", + "months": "months", + "report_name": "report_name", + "report_prefix": "report_prefix", + } + + def __init__( + self_, + account_id: str, + bucket_name: str, + report_name: str, + report_prefix: str, + bucket_region: Union[str, UnsetType] = unset, + is_enabled: Union[bool, UnsetType] = unset, + months: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for AWS CUR config Post Request. + + :param account_id: The AWS account ID. + :type account_id: str + + :param bucket_name: The AWS bucket name used to store the Cost and Usage Report. + :type bucket_name: str + + :param bucket_region: The region the bucket is located in. + :type bucket_region: str, optional + + :param is_enabled: Whether or not the Cloud Cost Management account is enabled. + :type is_enabled: bool, optional + + :param months: The month of the report. + :type months: int, optional + + :param report_name: The name of the Cost and Usage Report. + :type report_name: str + + :param report_prefix: The report prefix used for the Cost and Usage Report. + :type report_prefix: str + """ + if bucket_region is not unset: + kwargs["bucket_region"] = bucket_region + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if months is not unset: + kwargs["months"] = months + super().__init__(kwargs) + + self_.account_id = account_id + self_.bucket_name = bucket_name + self_.report_name = report_name + self_.report_prefix = report_prefix diff --git a/src/datadog_api_client/v2/model/aws_cur_config_post_request_type.py b/src/datadog_api_client/v2/model/aws_cur_config_post_request_type.py new file mode 100644 index 0000000000..46c21070c7 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_post_request_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AwsCURConfigPostRequestType(ModelSimple): + """ + Type of AWS CUR config Post Request. + + :param value: If omitted defaults to "aws_cur_config_post_request". Must be one of ["aws_cur_config_post_request"]. + :type value: str + """ + + allowed_values = { + "aws_cur_config_post_request", + } + AWS_CUR_CONFIG_POST_REQUEST: ClassVar["AwsCURConfigPostRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AwsCURConfigPostRequestType.AWS_CUR_CONFIG_POST_REQUEST = AwsCURConfigPostRequestType("aws_cur_config_post_request") diff --git a/src/datadog_api_client/v2/model/aws_cur_config_response.py b/src/datadog_api_client/v2/model/aws_cur_config_response.py new file mode 100644 index 0000000000..083b8253a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig + + +class AwsCURConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig + + return { + "data": (AwsCURConfig,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AwsCURConfig, UnsetType] = unset, **kwargs): + """ + Response of AWS CUR config. + + :param data: AWS CUR config. + :type data: AwsCURConfig, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/aws_cur_config_type.py b/src/datadog_api_client/v2/model/aws_cur_config_type.py new file mode 100644 index 0000000000..e8bf970359 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_config_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AwsCURConfigType(ModelSimple): + """ + Type of AWS CUR config. + + :param value: If omitted defaults to "aws_cur_config". Must be one of ["aws_cur_config"]. + :type value: str + """ + + allowed_values = { + "aws_cur_config", + } + AWS_CUR_CONFIG: ClassVar["AwsCURConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AwsCURConfigType.AWS_CUR_CONFIG = AwsCURConfigType("aws_cur_config") diff --git a/src/datadog_api_client/v2/model/aws_cur_configs_response.py b/src/datadog_api_client/v2/model/aws_cur_configs_response.py new file mode 100644 index 0000000000..e598c9c1c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cur_configs_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig + + +class AwsCURConfigsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig + + return { + "data": ([AwsCURConfig],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[AwsCURConfig], UnsetType] = unset, **kwargs): + """ + List of AWS CUR configs. + + :param data: An AWS CUR config. + :type data: [AwsCURConfig], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/aws_related_account.py b/src/datadog_api_client/v2/model/aws_related_account.py new file mode 100644 index 0000000000..b9f8976b2e --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_related_account.py @@ -0,0 +1,63 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_related_account_attributes import AWSRelatedAccountAttributes + from datadog_api_client.v2.model.aws_related_account_type import AWSRelatedAccountType + + +class AWSRelatedAccount(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_related_account_attributes import AWSRelatedAccountAttributes + from datadog_api_client.v2.model.aws_related_account_type import AWSRelatedAccountType + + return { + "attributes": (AWSRelatedAccountAttributes,), + "id": (str,), + "type": (AWSRelatedAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: AWSRelatedAccountType, + attributes: Union[AWSRelatedAccountAttributes, UnsetType] = unset, + **kwargs, + ): + """ + AWS related account. + + :param attributes: Attributes for an AWS related account. + :type attributes: AWSRelatedAccountAttributes, optional + + :param id: The AWS account ID. + :type id: str + + :param type: Type of AWS related account. + :type type: AWSRelatedAccountType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_related_account_attributes.py b/src/datadog_api_client/v2/model/aws_related_account_attributes.py new file mode 100644 index 0000000000..ee4b9fda71 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_related_account_attributes.py @@ -0,0 +1,45 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AWSRelatedAccountAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "has_datadog_integration": (bool,), + "name": (str,), + } + + attribute_map = { + "has_datadog_integration": "has_datadog_integration", + "name": "name", + } + + def __init__( + self_, has_datadog_integration: Union[bool, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs + ): + """ + Attributes for an AWS related account. + + :param has_datadog_integration: Whether or not the AWS account has a Datadog integration. + :type has_datadog_integration: bool, optional + + :param name: The name of the AWS account. + :type name: str, optional + """ + if has_datadog_integration is not unset: + kwargs["has_datadog_integration"] = has_datadog_integration + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/aws_related_account_type.py b/src/datadog_api_client/v2/model/aws_related_account_type.py new file mode 100644 index 0000000000..aebbba4cdb --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_related_account_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AWSRelatedAccountType(ModelSimple): + """ + Type of AWS related account. + + :param value: If omitted defaults to "aws_account". Must be one of ["aws_account"]. + :type value: str + """ + + allowed_values = { + "aws_account", + } + AWS_ACCOUNT: ClassVar["AWSRelatedAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSRelatedAccountType.AWS_ACCOUNT = AWSRelatedAccountType("aws_account") diff --git a/src/datadog_api_client/v2/model/aws_related_accounts_response.py b/src/datadog_api_client/v2/model/aws_related_accounts_response.py new file mode 100644 index 0000000000..f4168e976d --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_related_accounts_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_related_account import AWSRelatedAccount + + +class AWSRelatedAccountsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_related_account import AWSRelatedAccount + + return { + "data": ([AWSRelatedAccount],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[AWSRelatedAccount], UnsetType] = unset, **kwargs): + """ + List of AWS related accounts. + + :param data: An AWS related account. + :type data: [AWSRelatedAccount], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/azure_uc_config.py b/src/datadog_api_client/v2/model/azure_uc_config.py new file mode 100644 index 0000000000..7bcdd03c6c --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config.py @@ -0,0 +1,153 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AzureUCConfig(ModelNormal): + validations = { + "created_at": {}, + "months": { + "inclusive_maximum": 36, + }, + "status_updated_at": {}, + "updated_at": {}, + } + + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "client_id": (str,), + "created_at": (str,), + "dataset_type": (str,), + "error_messages": ([str],), + "export_name": (str,), + "export_path": (str,), + "id": (int,), + "months": (int,), + "scope": (str,), + "status": (str,), + "status_updated_at": (str,), + "storage_account": (str,), + "storage_container": (str,), + "updated_at": (str,), + } + + attribute_map = { + "account_id": "account_id", + "client_id": "client_id", + "created_at": "created_at", + "dataset_type": "dataset_type", + "error_messages": "error_messages", + "export_name": "export_name", + "export_path": "export_path", + "id": "id", + "months": "months", + "scope": "scope", + "status": "status", + "status_updated_at": "status_updated_at", + "storage_account": "storage_account", + "storage_container": "storage_container", + "updated_at": "updated_at", + } + + def __init__( + self_, + account_id: str, + client_id: str, + dataset_type: str, + export_name: str, + export_path: str, + scope: str, + status: str, + storage_account: str, + storage_container: str, + created_at: Union[str, UnsetType] = unset, + error_messages: Union[List[str], UnsetType] = unset, + id: Union[int, UnsetType] = unset, + months: Union[int, UnsetType] = unset, + status_updated_at: Union[str, UnsetType] = unset, + updated_at: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Azure config. + + :param account_id: The tenant ID of the azure account. + :type account_id: str + + :param client_id: The client ID of the Azure account. + :type client_id: str + + :param created_at: The timestamp when the Azure config was created. + :type created_at: str, optional + + :param dataset_type: The dataset type of the Azure config. + :type dataset_type: str + + :param error_messages: The error messages for the Azure config. + :type error_messages: [str], optional + + :param export_name: The name of the configured Azure Export. + :type export_name: str + + :param export_path: The path where the Azure Export is saved. + :type export_path: str + + :param id: The ID of the Azure config. + :type id: int, optional + + :param months: (deprecated) The number of months the report has been backfilled. + :type months: int, optional + + :param scope: The scope of your observed subscription. + :type scope: str + + :param status: The status of the Azure config. + :type status: str + + :param status_updated_at: The timestamp when the Azure config status was last updated. + :type status_updated_at: str, optional + + :param storage_account: The name of the storage account where the Azure Export is saved. + :type storage_account: str + + :param storage_container: The name of the storage container where the Azure Export is saved. + :type storage_container: str + + :param updated_at: The timestamp when the Azure config was last updated. + :type updated_at: str, optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if error_messages is not unset: + kwargs["error_messages"] = error_messages + if id is not unset: + kwargs["id"] = id + if months is not unset: + kwargs["months"] = months + if status_updated_at is not unset: + kwargs["status_updated_at"] = status_updated_at + if updated_at is not unset: + kwargs["updated_at"] = updated_at + super().__init__(kwargs) + + self_.account_id = account_id + self_.client_id = client_id + self_.dataset_type = dataset_type + self_.export_name = export_name + self_.export_path = export_path + self_.scope = scope + self_.status = status + self_.storage_account = storage_account + self_.storage_container = storage_container diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pair.py b/src/datadog_api_client/v2/model/azure_uc_config_pair.py new file mode 100644 index 0000000000..f17681c1f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_pair.py @@ -0,0 +1,63 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_pair_attributes import AzureUCConfigPairAttributes + from datadog_api_client.v2.model.azure_uc_config_pair_type import AzureUCConfigPairType + + +class AzureUCConfigPair(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_pair_attributes import AzureUCConfigPairAttributes + from datadog_api_client.v2.model.azure_uc_config_pair_type import AzureUCConfigPairType + + return { + "attributes": (AzureUCConfigPairAttributes,), + "id": (int,), + "type": (AzureUCConfigPairType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: AzureUCConfigPairAttributes, + type: AzureUCConfigPairType, + id: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Azure config pair. + + :param attributes: Attributes for Azure config pair. + :type attributes: AzureUCConfigPairAttributes + + :param id: The ID of Cloud Cost Management account. + :type id: int, optional + + :param type: Type of Azure config pair. + :type type: AzureUCConfigPairType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py b/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py new file mode 100644 index 0000000000..e3819f9107 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py @@ -0,0 +1,49 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config import AzureUCConfig + + +class AzureUCConfigPairAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config import AzureUCConfig + + return { + "configs": ([AzureUCConfig],), + "id": (int,), + } + + attribute_map = { + "configs": "configs", + "id": "id", + } + + def __init__(self_, configs: List[AzureUCConfig], id: Union[int, UnsetType] = unset, **kwargs): + """ + Attributes for Azure config pair. + + :param configs: An Azure config. + :type configs: [AzureUCConfig] + + :param id: The ID of the Azure config pair. + :type id: int, optional + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.configs = configs diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pair_type.py b/src/datadog_api_client/v2/model/azure_uc_config_pair_type.py new file mode 100644 index 0000000000..b9f4ca8edb --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_pair_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AzureUCConfigPairType(ModelSimple): + """ + Type of Azure config pair. + + :param value: If omitted defaults to "azure_uc_configs". Must be one of ["azure_uc_configs"]. + :type value: str + """ + + allowed_values = { + "azure_uc_configs", + } + AZURE_UC_CONFIGS: ClassVar["AzureUCConfigPairType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AzureUCConfigPairType.AZURE_UC_CONFIGS = AzureUCConfigPairType("azure_uc_configs") diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pairs_response.py b/src/datadog_api_client/v2/model/azure_uc_config_pairs_response.py new file mode 100644 index 0000000000..ed407bb6d6 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_pairs_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_pair import AzureUCConfigPair + + +class AzureUCConfigPairsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_pair import AzureUCConfigPair + + return { + "data": (AzureUCConfigPair,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AzureUCConfigPair, UnsetType] = unset, **kwargs): + """ + Response of Azure config pair. + + :param data: Azure config pair. + :type data: AzureUCConfigPair, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/azure_uc_config_patch_data.py b/src/datadog_api_client/v2/model/azure_uc_config_patch_data.py new file mode 100644 index 0000000000..ce25ae5564 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_patch_data.py @@ -0,0 +1,50 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_patch_request_attributes import AzureUCConfigPatchRequestAttributes + from datadog_api_client.v2.model.azure_uc_config_patch_request_type import AzureUCConfigPatchRequestType + + +class AzureUCConfigPatchData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_patch_request_attributes import ( + AzureUCConfigPatchRequestAttributes, + ) + from datadog_api_client.v2.model.azure_uc_config_patch_request_type import AzureUCConfigPatchRequestType + + return { + "attributes": (AzureUCConfigPatchRequestAttributes,), + "type": (AzureUCConfigPatchRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AzureUCConfigPatchRequestAttributes, type: AzureUCConfigPatchRequestType, **kwargs): + """ + Azure config Patch data. + + :param attributes: Attributes for Azure config Patch Request. + :type attributes: AzureUCConfigPatchRequestAttributes + + :param type: Type of Azure config Patch Request. + :type type: AzureUCConfigPatchRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/azure_uc_config_patch_request.py b/src/datadog_api_client/v2/model/azure_uc_config_patch_request.py new file mode 100644 index 0000000000..f0536a93fa --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_patch_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_patch_data import AzureUCConfigPatchData + + +class AzureUCConfigPatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_patch_data import AzureUCConfigPatchData + + return { + "data": (AzureUCConfigPatchData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AzureUCConfigPatchData, **kwargs): + """ + Azure config Patch Request. + + :param data: Azure config Patch data. + :type data: AzureUCConfigPatchData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/azure_uc_config_patch_request_attributes.py b/src/datadog_api_client/v2/model/azure_uc_config_patch_request_attributes.py new file mode 100644 index 0000000000..aeddbc0fc5 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_patch_request_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AzureUCConfigPatchRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "is_enabled": (bool,), + } + + attribute_map = { + "is_enabled": "is_enabled", + } + + def __init__(self_, is_enabled: bool, **kwargs): + """ + Attributes for Azure config Patch Request. + + :param is_enabled: Whether or not the Cloud Cost Management account is enabled. + :type is_enabled: bool + """ + super().__init__(kwargs) + + self_.is_enabled = is_enabled diff --git a/src/datadog_api_client/v2/model/azure_uc_config_patch_request_type.py b/src/datadog_api_client/v2/model/azure_uc_config_patch_request_type.py new file mode 100644 index 0000000000..7f31a26306 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_patch_request_type.py @@ -0,0 +1,37 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AzureUCConfigPatchRequestType(ModelSimple): + """ + Type of Azure config Patch Request. + + :param value: If omitted defaults to "azure_uc_config_patch_request". Must be one of ["azure_uc_config_patch_request"]. + :type value: str + """ + + allowed_values = { + "azure_uc_config_patch_request", + } + AZURE_UC_CONFIG_PATCH_REQUEST: ClassVar["AzureUCConfigPatchRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AzureUCConfigPatchRequestType.AZURE_UC_CONFIG_PATCH_REQUEST = AzureUCConfigPatchRequestType( + "azure_uc_config_patch_request" +) diff --git a/src/datadog_api_client/v2/model/azure_uc_config_post_data.py b/src/datadog_api_client/v2/model/azure_uc_config_post_data.py new file mode 100644 index 0000000000..a29656701c --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_post_data.py @@ -0,0 +1,50 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import AzureUCConfigPostRequestAttributes + from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType + + +class AzureUCConfigPostData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import ( + AzureUCConfigPostRequestAttributes, + ) + from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType + + return { + "attributes": (AzureUCConfigPostRequestAttributes,), + "type": (AzureUCConfigPostRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AzureUCConfigPostRequestAttributes, type: AzureUCConfigPostRequestType, **kwargs): + """ + Azure config Post data. + + :param attributes: Attributes for Azure config Post Request. + :type attributes: AzureUCConfigPostRequestAttributes + + :param type: Type of Azure config Post Request. + :type type: AzureUCConfigPostRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/azure_uc_config_post_request.py b/src/datadog_api_client/v2/model/azure_uc_config_post_request.py new file mode 100644 index 0000000000..ef08c06850 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_post_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_post_data import AzureUCConfigPostData + + +class AzureUCConfigPostRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_post_data import AzureUCConfigPostData + + return { + "data": (AzureUCConfigPostData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AzureUCConfigPostData, **kwargs): + """ + Azure config Post Request. + + :param data: Azure config Post data. + :type data: AzureUCConfigPostData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/azure_uc_config_post_request_attributes.py b/src/datadog_api_client/v2/model/azure_uc_config_post_request_attributes.py new file mode 100644 index 0000000000..6dc474b3a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_post_request_attributes.py @@ -0,0 +1,82 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.bill_config import BillConfig + + +class AzureUCConfigPostRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.bill_config import BillConfig + + return { + "account_id": (str,), + "actual_bill_config": (BillConfig,), + "amortized_bill_config": (BillConfig,), + "client_id": (str,), + "is_enabled": (bool,), + "scope": (str,), + } + + attribute_map = { + "account_id": "account_id", + "actual_bill_config": "actual_bill_config", + "amortized_bill_config": "amortized_bill_config", + "client_id": "client_id", + "is_enabled": "is_enabled", + "scope": "scope", + } + + def __init__( + self_, + account_id: str, + actual_bill_config: BillConfig, + amortized_bill_config: BillConfig, + client_id: str, + scope: str, + is_enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for Azure config Post Request. + + :param account_id: The tenant ID of the azure account. + :type account_id: str + + :param actual_bill_config: Bill config. + :type actual_bill_config: BillConfig + + :param amortized_bill_config: Bill config. + :type amortized_bill_config: BillConfig + + :param client_id: The client ID of the azure account. + :type client_id: str + + :param is_enabled: Whether or not the Cloud Cost Management account is enabled. + :type is_enabled: bool, optional + + :param scope: The scope of your observed subscription. + :type scope: str + """ + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + super().__init__(kwargs) + + self_.account_id = account_id + self_.actual_bill_config = actual_bill_config + self_.amortized_bill_config = amortized_bill_config + self_.client_id = client_id + self_.scope = scope diff --git a/src/datadog_api_client/v2/model/azure_uc_config_post_request_type.py b/src/datadog_api_client/v2/model/azure_uc_config_post_request_type.py new file mode 100644 index 0000000000..e9a3eb7d03 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_config_post_request_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AzureUCConfigPostRequestType(ModelSimple): + """ + Type of Azure config Post Request. + + :param value: If omitted defaults to "azure_uc_config_post_request". Must be one of ["azure_uc_config_post_request"]. + :type value: str + """ + + allowed_values = { + "azure_uc_config_post_request", + } + AZURE_UC_CONFIG_POST_REQUEST: ClassVar["AzureUCConfigPostRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AzureUCConfigPostRequestType.AZURE_UC_CONFIG_POST_REQUEST = AzureUCConfigPostRequestType("azure_uc_config_post_request") diff --git a/src/datadog_api_client/v2/model/azure_uc_configs_response.py b/src/datadog_api_client/v2/model/azure_uc_configs_response.py new file mode 100644 index 0000000000..067d740485 --- /dev/null +++ b/src/datadog_api_client/v2/model/azure_uc_configs_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.azure_uc_config_pair import AzureUCConfigPair + + +class AzureUCConfigsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.azure_uc_config_pair import AzureUCConfigPair + + return { + "data": ([AzureUCConfigPair],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[AzureUCConfigPair], UnsetType] = unset, **kwargs): + """ + List of Azure accounts with configs. + + :param data: An Azure config pair. + :type data: [AzureUCConfigPair], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/bill_config.py b/src/datadog_api_client/v2/model/bill_config.py new file mode 100644 index 0000000000..e2c8db5e25 --- /dev/null +++ b/src/datadog_api_client/v2/model/bill_config.py @@ -0,0 +1,51 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class BillConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "export_name": (str,), + "export_path": (str,), + "storage_account": (str,), + "storage_container": (str,), + } + + attribute_map = { + "export_name": "export_name", + "export_path": "export_path", + "storage_account": "storage_account", + "storage_container": "storage_container", + } + + def __init__(self_, export_name: str, export_path: str, storage_account: str, storage_container: str, **kwargs): + """ + Bill config. + + :param export_name: The name of the configured Azure Export. + :type export_name: str + + :param export_path: The path where the Azure Export is saved. + :type export_path: str + + :param storage_account: The name of the storage account where the Azure Export is saved. + :type storage_account: str + + :param storage_container: The name of the storage container where the Azure Export is saved. + :type storage_container: str + """ + super().__init__(kwargs) + + self_.export_name = export_name + self_.export_path = export_path + self_.storage_account = storage_account + self_.storage_container = storage_container diff --git a/src/datadog_api_client/v2/model/cloud_cost_activity.py b/src/datadog_api_client/v2/model/cloud_cost_activity.py new file mode 100644 index 0000000000..dce6d1a4ed --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_cost_activity.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cloud_cost_activity_attributes import CloudCostActivityAttributes + from datadog_api_client.v2.model.cloud_cost_activity_type import CloudCostActivityType + + +class CloudCostActivity(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_cost_activity_attributes import CloudCostActivityAttributes + from datadog_api_client.v2.model.cloud_cost_activity_type import CloudCostActivityType + + return { + "attributes": (CloudCostActivityAttributes,), + "type": (CloudCostActivityType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CloudCostActivityAttributes, type: CloudCostActivityType, **kwargs): + """ + Cloud Cost Activity. + + :param attributes: Attributes for Cloud Cost activity. + :type attributes: CloudCostActivityAttributes + + :param type: Type of Cloud Cost Activity. + :type type: CloudCostActivityType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/cloud_cost_activity_attributes.py b/src/datadog_api_client/v2/model/cloud_cost_activity_attributes.py new file mode 100644 index 0000000000..070532d9be --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_cost_activity_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CloudCostActivityAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "is_enabled": (bool,), + } + + attribute_map = { + "is_enabled": "is_enabled", + } + + def __init__(self_, is_enabled: bool, **kwargs): + """ + Attributes for Cloud Cost activity. + + :param is_enabled: Whether or not the cloud account is enabled. + :type is_enabled: bool + """ + super().__init__(kwargs) + + self_.is_enabled = is_enabled diff --git a/src/datadog_api_client/v2/model/cloud_cost_activity_response.py b/src/datadog_api_client/v2/model/cloud_cost_activity_response.py new file mode 100644 index 0000000000..b96dffa07b --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_cost_activity_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cloud_cost_activity import CloudCostActivity + + +class CloudCostActivityResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_cost_activity import CloudCostActivity + + return { + "data": (CloudCostActivity,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CloudCostActivity, UnsetType] = unset, **kwargs): + """ + Response for Cloud Cost activity. + + :param data: Cloud Cost Activity. + :type data: CloudCostActivity, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/cloud_cost_activity_type.py b/src/datadog_api_client/v2/model/cloud_cost_activity_type.py new file mode 100644 index 0000000000..7fc0bd3ebf --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_cost_activity_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CloudCostActivityType(ModelSimple): + """ + Type of Cloud Cost Activity. + + :param value: If omitted defaults to "cloud_cost_activity". Must be one of ["cloud_cost_activity"]. + :type value: str + """ + + allowed_values = { + "cloud_cost_activity", + } + CLOUD_COST_ACTIVITY: ClassVar["CloudCostActivityType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CloudCostActivityType.CLOUD_COST_ACTIVITY = CloudCostActivityType("cloud_cost_activity") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0e1125fff1..487313b5ab 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -13,6 +13,10 @@ from datadog_api_client.v2.model.api_keys_response_meta_page import APIKeysResponseMetaPage from datadog_api_client.v2.model.api_keys_sort import APIKeysSort from datadog_api_client.v2.model.api_keys_type import APIKeysType +from datadog_api_client.v2.model.aws_related_account import AWSRelatedAccount +from datadog_api_client.v2.model.aws_related_account_attributes import AWSRelatedAccountAttributes +from datadog_api_client.v2.model.aws_related_account_type import AWSRelatedAccountType +from datadog_api_client.v2.model.aws_related_accounts_response import AWSRelatedAccountsResponse from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes from datadog_api_client.v2.model.active_billing_dimensions_body import ActiveBillingDimensionsBody from datadog_api_client.v2.model.active_billing_dimensions_response import ActiveBillingDimensionsResponse @@ -61,6 +65,34 @@ from datadog_api_client.v2.model.authn_mappings_response import AuthNMappingsResponse from datadog_api_client.v2.model.authn_mappings_sort import AuthNMappingsSort from datadog_api_client.v2.model.authn_mappings_type import AuthNMappingsType +from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig +from datadog_api_client.v2.model.aws_cur_config_attributes import AwsCURConfigAttributes +from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData +from datadog_api_client.v2.model.aws_cur_config_patch_request import AwsCURConfigPatchRequest +from datadog_api_client.v2.model.aws_cur_config_patch_request_attributes import AwsCURConfigPatchRequestAttributes +from datadog_api_client.v2.model.aws_cur_config_patch_request_type import AwsCURConfigPatchRequestType +from datadog_api_client.v2.model.aws_cur_config_post_data import AwsCURConfigPostData +from datadog_api_client.v2.model.aws_cur_config_post_request import AwsCURConfigPostRequest +from datadog_api_client.v2.model.aws_cur_config_post_request_attributes import AwsCURConfigPostRequestAttributes +from datadog_api_client.v2.model.aws_cur_config_post_request_type import AwsCURConfigPostRequestType +from datadog_api_client.v2.model.aws_cur_config_response import AwsCURConfigResponse +from datadog_api_client.v2.model.aws_cur_config_type import AwsCURConfigType +from datadog_api_client.v2.model.aws_cur_configs_response import AwsCURConfigsResponse +from datadog_api_client.v2.model.azure_uc_config import AzureUCConfig +from datadog_api_client.v2.model.azure_uc_config_pair import AzureUCConfigPair +from datadog_api_client.v2.model.azure_uc_config_pair_attributes import AzureUCConfigPairAttributes +from datadog_api_client.v2.model.azure_uc_config_pair_type import AzureUCConfigPairType +from datadog_api_client.v2.model.azure_uc_config_pairs_response import AzureUCConfigPairsResponse +from datadog_api_client.v2.model.azure_uc_config_patch_data import AzureUCConfigPatchData +from datadog_api_client.v2.model.azure_uc_config_patch_request import AzureUCConfigPatchRequest +from datadog_api_client.v2.model.azure_uc_config_patch_request_attributes import AzureUCConfigPatchRequestAttributes +from datadog_api_client.v2.model.azure_uc_config_patch_request_type import AzureUCConfigPatchRequestType +from datadog_api_client.v2.model.azure_uc_config_post_data import AzureUCConfigPostData +from datadog_api_client.v2.model.azure_uc_config_post_request import AzureUCConfigPostRequest +from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import AzureUCConfigPostRequestAttributes +from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType +from datadog_api_client.v2.model.azure_uc_configs_response import AzureUCConfigsResponse +from datadog_api_client.v2.model.bill_config import BillConfig from datadog_api_client.v2.model.bulk_mute_findings_request import BulkMuteFindingsRequest from datadog_api_client.v2.model.bulk_mute_findings_request_attributes import BulkMuteFindingsRequestAttributes from datadog_api_client.v2.model.bulk_mute_findings_request_data import BulkMuteFindingsRequestData @@ -163,6 +195,10 @@ from datadog_api_client.v2.model.cloud_configuration_rule_create_payload import CloudConfigurationRuleCreatePayload from datadog_api_client.v2.model.cloud_configuration_rule_options import CloudConfigurationRuleOptions from datadog_api_client.v2.model.cloud_configuration_rule_type import CloudConfigurationRuleType +from datadog_api_client.v2.model.cloud_cost_activity import CloudCostActivity +from datadog_api_client.v2.model.cloud_cost_activity_attributes import CloudCostActivityAttributes +from datadog_api_client.v2.model.cloud_cost_activity_response import CloudCostActivityResponse +from datadog_api_client.v2.model.cloud_cost_activity_type import CloudCostActivityType from datadog_api_client.v2.model.cloud_workload_security_agent_rule_attributes import ( CloudWorkloadSecurityAgentRuleAttributes, ) @@ -1538,6 +1574,10 @@ "APIKeysResponseMetaPage", "APIKeysSort", "APIKeysType", + "AWSRelatedAccount", + "AWSRelatedAccountAttributes", + "AWSRelatedAccountType", + "AWSRelatedAccountsResponse", "ActiveBillingDimensionsAttributes", "ActiveBillingDimensionsBody", "ActiveBillingDimensionsResponse", @@ -1586,6 +1626,34 @@ "AuthNMappingsResponse", "AuthNMappingsSort", "AuthNMappingsType", + "AwsCURConfig", + "AwsCURConfigAttributes", + "AwsCURConfigPatchData", + "AwsCURConfigPatchRequest", + "AwsCURConfigPatchRequestAttributes", + "AwsCURConfigPatchRequestType", + "AwsCURConfigPostData", + "AwsCURConfigPostRequest", + "AwsCURConfigPostRequestAttributes", + "AwsCURConfigPostRequestType", + "AwsCURConfigResponse", + "AwsCURConfigType", + "AwsCURConfigsResponse", + "AzureUCConfig", + "AzureUCConfigPair", + "AzureUCConfigPairAttributes", + "AzureUCConfigPairType", + "AzureUCConfigPairsResponse", + "AzureUCConfigPatchData", + "AzureUCConfigPatchRequest", + "AzureUCConfigPatchRequestAttributes", + "AzureUCConfigPatchRequestType", + "AzureUCConfigPostData", + "AzureUCConfigPostRequest", + "AzureUCConfigPostRequestAttributes", + "AzureUCConfigPostRequestType", + "AzureUCConfigsResponse", + "BillConfig", "BulkMuteFindingsRequest", "BulkMuteFindingsRequestAttributes", "BulkMuteFindingsRequestData", @@ -1672,6 +1740,10 @@ "CloudConfigurationRuleCreatePayload", "CloudConfigurationRuleOptions", "CloudConfigurationRuleType", + "CloudCostActivity", + "CloudCostActivityAttributes", + "CloudCostActivityResponse", + "CloudCostActivityType", "CloudWorkloadSecurityAgentRuleAttributes", "CloudWorkloadSecurityAgentRuleCreateAttributes", "CloudWorkloadSecurityAgentRuleCreateData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.frozen new file mode 100644 index 0000000000..f0a50294db --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T14:24:29.702Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml new file mode 100644 index 0000000000..504e78f395 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"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"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config + response: + body: + string: '{"data":{"type":"aws_cur_config","id":177,"attributes":{"account_id":"123456789123","bucket_name":"dd-cost-bucket","bucket_region":"us-east-1","report_prefix":"dd-report-prefix","report_name":"dd-report-name","months":15,"updated_at":"2023-12-12T14:24:30.907264","created_at":"2023-12-12T14:24:30.907264","status":"active","status_updated_at":"2023-12-12T14:24:30.904602","error_messages":[]}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.frozen new file mode 100644 index 0000000000..c9d8714c6d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T17:11:52.024Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml new file mode 100644 index 0000000000..bd9036f0cc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"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", + "is_enabled": true, "scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, + "type": "azure_uc_config_post_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config + response: + body: + string: '{"data": {"type": "azure_uc_configs", "id": 1, "attributes": {"configs": + [{"id": 1, "storage_container": "test_storage_container", "scope": "test_scope", + "status": "active", "account_id": "1234abcd-1234-abcd-1234-1234abcd1234", + "client_id": "test_client_id", "storage_account": "test_storage_account", + "months": 15, "error_messages": [], "dataset_type": "actual", "status_updated_at": + "2023-12-12T17:11:56.855669", "created_at": "2023-12-12T17:11:56.860554", + "updated_at": "2023-12-12T17:11:56.860554", "export_name": "test_export_name", + "export_path": "test_export_path"}, {"id": 1, "storage_container": "test_storage_container", + "scope": "test_scope", "status": "active", "account_id": "test_account_id", + "client_id": "test_client_id", "storage_account": "test_storage_account", + "months": 15, "error_messages": [], "dataset_type": "amortized", "status_updated_at": + "2023-12-12T17:11:56.855669", "created_at": "2023-12-12T17:11:56.861623", + "updated_at": "2023-12-12T17:11:56.861623", "export_name": "test_export_name", + "export_path": "test_export_path"}]}}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.frozen new file mode 100644 index 0000000000..846b3868d7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.frozen @@ -0,0 +1 @@ +2023-12-12T14:24:02.091Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.yaml new file mode 100644 index 0000000000..1fbdf953e4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_no_content_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config/100 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.frozen new file mode 100644 index 0000000000..595b320065 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.frozen @@ -0,0 +1 @@ +2023-12-12T16:00:55.255Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.yaml new file mode 100644 index 0000000000..affe2307c7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_no_content_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config/100 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.frozen new file mode 100644 index 0000000000..af095c7a13 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T13:33:48.031Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml new file mode 100644 index 0000000000..8597b27b1c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config + response: + body: + string: '{"data": [{"type": "aws_cur_config", "id": 100, "attributes": {"account_id": + "000000000000", "bucket_name": "test_bucket_name", "bucket_region": "us-east-1", + "report_prefix": "cur-hourly", "report_name": "billing-conductor-cur", "months": + 15, "updated_at": "2023-10-27T12:38:39.585408", "created_at": "2023-10-10T13:53:28.774143", + "status": "active", "status_updated_at": "2023-11-21T17:07:24.778386", "error_messages": + []}}]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.frozen new file mode 100644 index 0000000000..359a94ce68 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T15:29:02.625Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml new file mode 100644 index 0000000000..f21b5e95d3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config + response: + body: + string: '{"data": [{"type": "azure_uc_configs", "id": 1, "attributes": {"configs": + [{"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-06-29T12:43:36.569819", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-06-29T12:43:36.569819", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", + "status_updated_at": "2023-11-03T13:48:16.827724", "error_messages": [], "storage_account": + "test_storage_account", "months": 15, "export_path": "test_export_path"}, + {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-06-29T12:43:36.569819", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-06-29T12:43:36.569819", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", + "status_updated_at": "2023-11-03T13:48:16.827724", "error_messages": [], "storage_account": + "test_storage_account", "months": 15, "export_path": "test_export_path"}]}}, + {"type": "azure_uc_configs", "id": 1, "attributes": {"configs": [{"id": 1, + "export_name": "test_export_name", "scope": "test_scope", "created_at": "2023-11-09T16:26:33.859447", + "storage_container": "test_storage_container", "status": "active", "updated_at": + "2023-11-09T16:26:33.859447", "account_id": "test_account_id", "client_id": + "test_client_id", "dataset_type": "actual", "status_updated_at": "2023-11-09T16:26:33.849153", + "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}, + {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-11-09T16:26:33.862026", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-11-09T16:26:33.862026", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", + "status_updated_at": "2023-11-09T16:26:33.849153", "storage_account": "test_storage_account", + "months": 15, "export_path": "test_export_path"}]}}, {"type": "azure_uc_configs", + "id": 1, "attributes": {"configs": [{"id": 1, "export_name": "test_export_name", + "scope": "test_scope", "created_at": "2023-11-09T20:20:35.959808", "storage_container": + "test_storage_container", "status": "active", "updated_at": "2023-11-09T20:20:35.959808", + "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": + "actual", "status_updated_at": "2023-11-09T20:20:35.956202", "storage_account": + "test_storage_account", "months": 15, "export_path": "test_export_path"}, + {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-11-09T20:20:35.960815", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-11-09T20:20:35.960815", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", + "status_updated_at": "2023-11-09T20:20:35.956202", "storage_account": "test_storage_account", + "months": 15, "export_path": "test_export_path"}]}}]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.frozen new file mode 100644 index 0000000000..fc911e03b7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T14:56:29.893Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.yaml new file mode 100644 index 0000000000..89f23d4609 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_related_aws_accounts_returns_ok_response.yaml @@ -0,0 +1,31 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/aws_related_accounts?filter%5Bmanagement_account_id%5D=123456789123 + response: + body: + string: '{"data": [{"type": "aws_account", "id": "000000000000", "attributes": + {"name": "test_name", "has_datadog_integration": false}}, {"type": "aws_account", + "id": "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": + true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": + "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": + "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": + false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": + "test_name", "has_datadog_integration": true}}, {"type": "aws_account", "id": + "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": + false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": + "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": + "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": + true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": + "test_name", "has_datadog_integration": false}}]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.frozen new file mode 100644 index 0000000000..f30bb46fed --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-12T13:23:19.108Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml new file mode 100644 index 0000000000..50439f6496 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml @@ -0,0 +1,25 @@ +interactions: +- request: + body: '{"data": {"attributes": {"is_enabled": true}, "type": "aws_cur_config_patch_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config/100 + response: + body: + string: '{"data": [{"type": "aws_cur_config", "id": 100, "attributes": {"account_id": + "000000000000", "bucket_name": "test_bucket_name", "bucket_region": "us-east-1", + "report_prefix": "cur-report-hourly", "report_name": "cur-hourly", "months": + 15, "updated_at": "2023-10-18T08:15:45.265597", "created_at": "2022-07-25T17:19:47.190482", + "status": "active", "status_updated_at": "2023-11-08T22:47:55.372330", "error_messages": + []}}]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.frozen new file mode 100644 index 0000000000..b67ac855fe --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-13T13:29:24.025Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml new file mode 100644 index 0000000000..c0d2005eae --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml @@ -0,0 +1,32 @@ +interactions: +- request: + body: '{"data": {"attributes": {"is_enabled": true}, "type": "azure_uc_config_patch_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config/100 + response: + body: + string: '{"data": {"type": "azure_uc_configs", "id": 100, "attributes": {"configs": + [{"updated_at": "2023-06-29T12:43:36.569819", "export_path": "/amortized-cost", + "status": "active", "id": 56, "account_id": "test_account_id", "client_id": + "test_client_id", "dataset_type": "amortized", "created_at": "2023-06-29T12:43:36.569819", + "export_name": "test_export_name", "scope": "test_scope", "storage_account": + "test_storage_account", "storage_container": "test_storage_container", "status_updated_at": + "2023-12-13T13:29:24.462039", "months": 15}, {"updated_at": "2023-06-29T12:43:36.569819", + "export_path": "/actual-cost", "status": "active", "id": 55, "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", + "created_at": "2023-06-29T12:43:36.569819", "export_name": "test_export_name", + "scope": "test_scope", "storage_account": "test_storage_account", "storage_container": + "test_storage_container", "status_updated_at": "2023-12-13T13:29:24.462039", + "months": 15}]}}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature new file mode 100644 index 0000000000..1dfb05baea --- /dev/null +++ b/tests/v2/features/cloud_cost_management.feature @@ -0,0 +1,142 @@ +@endpoint(cloud-cost-management) @endpoint(cloud-cost-management-v2) +Feature: Cloud Cost Management + The Cloud Cost Management API allows you to setup, edit and delete cloud + cost management accounts for AWS & Azure. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CloudCostManagement" API + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: Cloud Cost Enabled returns "OK" response + Given new "GetCloudCostActivity" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: Create Cloud Cost Management AWS CUR config returns "Bad Request" 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.account_id" is equal to "123456789123" + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "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 @team:Datadog/integrations-tools-and-libraries + 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", "is_enabled": true, "scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "type": "azure_uc_config_post_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.configs[0].account_id" is equal to "1234abcd-1234-abcd-1234-1234abcd1234" + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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 @team:Datadog/integrations-tools-and-libraries + 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 + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: Delete Cloud Cost Management AWS CUR config returns "Not Found" 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 404 Not Found + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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 @team:Datadog/integrations-tools-and-libraries + 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 + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: Delete Cloud Cost Management Azure config returns "Not Found" 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 404 Not Found + + @replay-only @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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 @team:Datadog/integrations-tools-and-libraries + 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" + + @generated @skip @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: List related AWS accounts returns "Bad Request" response + Given new "ListAWSRelatedAccounts" request + And request contains "filter[management_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 @team:Datadog/integrations-tools-and-libraries + Scenario: List related AWS accounts returns "OK" response + Given new "ListAWSRelatedAccounts" request + And request contains "filter[management_account_id]" parameter with value "123456789123" + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.name" is equal to "test_name" + + @replay-only @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + 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" + And body with value {"data": {"attributes": {"is_enabled": true}, "type": "aws_cur_config_patch_request"}} + When the request is sent + 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 @team:Datadog/integrations-tools-and-libraries + 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" + And body with value {"data": {"attributes": {"is_enabled": true}, "type": "azure_uc_config_patch_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:Datadog/cloud-cost-management @team:Datadog/integrations-tools-and-libraries + Scenario: Update Cloud Cost Management Azure config returns "OK" response + Given new "UpdateCostAzureUCConfigs" request + And request contains "cloud_account_id" parameter with value "100" + And body with value {"data": {"attributes": {"is_enabled": true}, "type": "azure_uc_config_patch_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "azure_uc_configs" diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index fa0946c219..d4ee6f5c89 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -243,6 +243,66 @@ "type": "safe" } }, + "ListCostAWSCURConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "CreateCostAWSCURConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "DeleteCostAWSCURConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateCostAWSCURConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "ListAWSRelatedAccounts": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostAzureUCConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "CreateCostAzureUCConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "DeleteCostAzureUCConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateCostAzureUCConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GetCloudCostActivity": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": {