From 1f8e98b2ed101b7ae04d064aecad6756037814d0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 17 Oct 2024 21:36:48 +0000 Subject: [PATCH] Regenerate client from commit 96810b7f of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 730 ++++++++++++++++++ ...returns-AWS-Account-object-response.frozen | 1 + ...ig-returns-AWS-Account-object-response.yml | 40 + ...config-returns-Bad-Request-response.frozen | 1 + ...nt-config-returns-Bad-Request-response.yml | 24 + ...nt-config-returns-Conflict-response.frozen | 1 + ...count-config-returns-Conflict-response.yml | 63 ++ ...tion-returns-400-API-error-response.frozen | 1 + ...rtition-returns-400-API-error-response.yml | 24 + ...returns-AWS-Account-object-response.frozen | 1 + ...ig-returns-AWS-Account-object-response.yml | 42 + ...config-returns-Bad-Request-response.frozen | 1 + ...nt-config-returns-Bad-Request-response.yml | 21 + ...-config-returns-No-Content-response.frozen | 1 + ...unt-config-returns-No-Content-response.yml | 59 ++ ...t-config-returns-Not-Found-response.frozen | 1 + ...ount-config-returns-Not-Found-response.yml | 59 ++ ...rns-AWS-External-ID-object-response.frozen | 1 + ...eturns-AWS-External-ID-object-response.yml | 20 + ...returns-AWS-Account-object-response.frozen | 1 + ...ig-returns-AWS-Account-object-response.yml | 58 ++ ...config-returns-Bad-Request-response.frozen | 1 + ...nt-config-returns-Bad-Request-response.yml | 21 + ...t-config-returns-Not-Found-response.frozen | 1 + ...ount-config-returns-Not-Found-response.yml | 21 + ...s-AWS-Accounts-List-object-response.frozen | 1 + ...urns-AWS-Accounts-List-object-response.yml | 20 + ...-Logs-Services-List-object-response.frozen | 1 + ...AWS-Logs-Services-List-object-response.yml | 20 + ...AWS-Namespaces-List-object-response.frozen | 1 + ...ns-AWS-Namespaces-List-object-response.yml | 79 ++ ...returns-API-error-response-response.frozen | 1 + ...ig-returns-API-error-response-response.yml | 64 ++ ...returns-AWS-Account-object-response.frozen | 1 + ...ig-returns-AWS-Account-object-response.yml | 62 ++ ...config-returns-Bad-Request-response.frozen | 1 + ...nt-config-returns-Bad-Request-response.yml | 63 ++ ...t-config-returns-Not-Found-response.frozen | 1 + ...ount-config-returns-Not-Found-response.yml | 25 + .../v2/aws-integration/CreateAWSAccount.rb | 53 ++ .../v2/aws-integration/DeleteAWSAccount.rb | 11 + .../aws-integration/GenerateNewExternalID.rb | 8 + examples/v2/aws-integration/GetAWSAccount.rb | 11 + .../v2/aws-integration/ListAWSAccounts.rb | 8 + .../v2/aws-integration/ListAWSLogServices.rb | 5 + .../v2/aws-integration/ListAWSNamespaces.rb | 5 + .../v2/aws-integration/UpdateAWSAccount.rb | 56 ++ features/scenarios_model_mapping.rb | 16 + features/v1/aws_integration.feature | 52 +- features/v1/aws_logs_integration.feature | 26 +- features/v2/aws_integration.feature | 141 ++++ features/v2/given.json | 12 + features/v2/undo.json | 55 ++ lib/datadog_api_client/configuration.rb | 6 + lib/datadog_api_client/inflector.rb | 41 + .../v2/api/aws_integration_api.rb | 573 ++++++++++++++ .../v2/models/aws_account_create_request.rb | 105 +++ .../aws_account_create_request_attributes.rb | 235 ++++++ .../models/aws_account_create_request_data.rb | 144 ++++ .../v2/models/aws_account_partition.rb | 28 + .../v2/models/aws_account_patch_request.rb | 105 +++ .../aws_account_patch_request_attributes.rb | 213 +++++ .../models/aws_account_patch_request_data.rb | 154 ++++ .../v2/models/aws_account_response.rb | 105 +++ .../models/aws_account_response_attributes.rb | 255 ++++++ .../v2/models/aws_account_response_data.rb | 165 ++++ .../v2/models/aws_accounts_response.rb | 107 +++ .../v2/models/aws_auth_config.rb | 63 ++ .../v2/models/aws_auth_config_keys.rb | 144 ++++ .../v2/models/aws_auth_config_role.rb | 141 ++++ .../v2/models/aws_lambda_forwarder_config.rb | 119 +++ .../v2/models/aws_logs_config.rb | 105 +++ .../v2/models/aws_logs_services_response.rb | 105 +++ .../aws_logs_services_response_attributes.rb | 107 +++ .../models/aws_logs_services_response_data.rb | 125 +++ .../v2/models/aws_metrics_config.rb | 157 ++++ .../v2/models/aws_namespace_filters.rb | 65 ++ .../aws_namespace_filters_exclude_all.rb | 123 +++ .../aws_namespace_filters_exclude_only.rb | 125 +++ .../aws_namespace_filters_include_all.rb | 123 +++ .../aws_namespace_filters_include_only.rb | 125 +++ .../v2/models/aws_namespace_tag_filter.rb | 125 +++ .../v2/models/aws_namespaces_response.rb | 107 +++ .../aws_namespaces_response_attributes.rb | 105 +++ .../v2/models/aws_namespaces_response_data.rb | 125 +++ .../v2/models/aws_new_external_id_response.rb | 105 +++ ...aws_new_external_id_response_attributes.rb | 105 +++ .../aws_new_external_id_response_data.rb | 125 +++ .../v2/models/aws_regions.rb | 63 ++ .../v2/models/aws_regions_include_all.rb | 123 +++ .../v2/models/aws_regions_include_only.rb | 125 +++ .../v2/models/aws_resources_config.rb | 115 +++ .../v2/models/aws_traces_config.rb | 105 +++ .../v2/models/x_ray_services_include_all.rb | 123 +++ .../v2/models/x_ray_services_include_only.rb | 125 +++ .../v2/models/x_ray_services_list.rb | 63 ++ 97 files changed, 7460 insertions(+), 43 deletions(-) create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.yml create mode 100644 examples/v2/aws-integration/CreateAWSAccount.rb create mode 100644 examples/v2/aws-integration/DeleteAWSAccount.rb create mode 100644 examples/v2/aws-integration/GenerateNewExternalID.rb create mode 100644 examples/v2/aws-integration/GetAWSAccount.rb create mode 100644 examples/v2/aws-integration/ListAWSAccounts.rb create mode 100644 examples/v2/aws-integration/ListAWSLogServices.rb create mode 100644 examples/v2/aws-integration/ListAWSNamespaces.rb create mode 100644 examples/v2/aws-integration/UpdateAWSAccount.rb create mode 100644 features/v2/aws_integration.feature create mode 100644 lib/datadog_api_client/v2/api/aws_integration_api.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_create_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_partition.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_patch_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_patch_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_account_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_accounts_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_auth_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_auth_config_keys.rb create mode 100644 lib/datadog_api_client/v2/models/aws_auth_config_role.rb create mode 100644 lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_logs_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_logs_services_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_logs_services_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_logs_services_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_metrics_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_filters.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_all.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_filters_include_all.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_filters_include_only.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespaces_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespaces_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_namespaces_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_new_external_id_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_new_external_id_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_new_external_id_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_regions.rb create mode 100644 lib/datadog_api_client/v2/models/aws_regions_include_all.rb create mode 100644 lib/datadog_api_client/v2/models/aws_regions_include_only.rb create mode 100644 lib/datadog_api_client/v2/models/aws_resources_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_traces_config.rb create mode 100644 lib/datadog_api_client/v2/models/x_ray_services_include_all.rb create mode 100644 lib/datadog_api_client/v2/models/x_ray_services_include_only.rb create mode 100644 lib/datadog_api_client/v2/models/x_ray_services_list.rb diff --git a/.apigentools-info b/.apigentools-info index 8df24b0f1158..967866deddeb 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-17 14:10:53.037283", - "spec_repo_commit": "fb024a45" + "regenerated": "2024-10-17 21:36:22.883305", + "spec_repo_commit": "96810b7f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-17 14:10:53.055232", - "spec_repo_commit": "fb024a45" + "regenerated": "2024-10-17 21:36:22.901788", + "spec_repo_commit": "96810b7f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6efc200303cb..40c73c953430 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -84,6 +84,13 @@ components: required: false schema: $ref: '#/components/schemas/APIKeysSort' + AWSAccountConfigIDPathParameter: + description: Unique Datadog ID of the AWS Account Integration Config + in: path + name: aws_account_config_id + required: true + schema: + type: string ApplicationKeyFilterCreatedAtEndParameter: description: Only include application keys created on or before the specified date. @@ -955,6 +962,459 @@ components: type: string x-enum-varnames: - API_KEYS + AWSAccountConfigID: + description: Unique Datadog ID of the AWS Account Integration Config + example: 00000000-abcd-0001-0000-000000000000 + type: string + AWSAccountCreateRequest: + description: AWS Account Create Request body + properties: + data: + $ref: '#/components/schemas/AWSAccountCreateRequestData' + type: object + AWSAccountCreateRequestAttributes: + description: The AWS Account Integration Config to be created + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + - aws_partition + - auth_config + type: object + AWSAccountCreateRequestData: + description: AWS Account Create Request data + properties: + attributes: + $ref: '#/components/schemas/AWSAccountCreateRequestAttributes' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - attributes + - type + type: object + AWSAccountID: + description: AWS Account ID + example: '123456789012' + type: string + AWSAccountPartition: + default: aws + description: AWS Account partition + enum: + - aws + - aws-cn + - aws-us-gov + example: aws + type: string + x-enum-varnames: + - AWS + - AWS_CN + - AWS_US_GOV + AWSAccountPatchRequest: + description: AWS Account Patch Request body + properties: + data: + $ref: '#/components/schemas/AWSAccountPatchRequestData' + type: object + AWSAccountPatchRequestAttributes: + description: The AWS Account Integration Config to be updated + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + type: object + AWSAccountPatchRequestData: + description: AWS Account Patch Request data + properties: + attributes: + $ref: '#/components/schemas/AWSAccountPatchRequestAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - attributes + - type + type: object + AWSAccountResponse: + description: AWS Account response body + properties: + data: + $ref: '#/components/schemas/AWSAccountResponseData' + type: object + AWSAccountResponseAttributes: + description: The AWS Account Integration Config + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + created_at: + description: Timestamp of when the account integration was created + format: date-time + readOnly: true + type: string + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + modified_at: + description: Timestamp of when the account integration was updated + format: date-time + readOnly: true + type: string + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + - aws_partition + - auth_config + type: object + AWSAccountResponseData: + description: AWS Account Response body + properties: + attributes: + $ref: '#/components/schemas/AWSAccountResponseAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - id + - attributes + - type + type: object + AWSAccountTags: + description: Tags to apply to all metrics in the account + items: + example: key:value + type: string + nullable: true + type: array + AWSAccountType: + default: account + description: AWS Account resource type. + example: account + type: string + AWSAccountsResponse: + description: AWS Accounts response body + properties: + data: + description: List of AWS Account Integration Configs + items: + $ref: '#/components/schemas/AWSAccountResponseData' + type: array + type: object + AWSAuthConfig: + description: AWS Authentication config + oneOf: + - $ref: '#/components/schemas/AWSAuthConfigKeys' + - $ref: '#/components/schemas/AWSAuthConfigRole' + AWSAuthConfigKeys: + description: AWS Authentication config for key-based account + properties: + access_key_id: + description: AWS Access Key ID + example: AKIAIOSFODNN7EXAMPLE + type: string + secret_access_key: + description: AWS Secret Access Key + example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + minLength: 1 + type: string + writeOnly: true + required: + - access_key_id + type: object + AWSAuthConfigRole: + description: AWS Authentication config for role-based account + properties: + external_id: + description: AWS IAM External ID for associated role + type: string + role_name: + description: AWS IAM Role name + example: DatadogIntegrationRole + maxLength: 576 + minLength: 1 + type: string + required: + - role_name + type: object + AWSLambdaForwarderConfig: + description: AWS Lambda forwarder + properties: + lambdas: + description: List of Datadog Lambda Log Forwarder ARNs + items: + example: arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder + type: string + type: array + sources: + description: List of AWS services that will send logs to the Datadog Lambda + Log Forwarder + items: + example: s3 + type: string + type: array + type: object + AWSLogsConfig: + description: AWS Logs config + properties: + lambda_forwarder: + $ref: '#/components/schemas/AWSLambdaForwarderConfig' + type: object + AWSLogsServicesResponse: + description: AWS Logs Services response body + properties: + data: + $ref: '#/components/schemas/AWSLogsServicesResponseData' + type: object + AWSLogsServicesResponseAttributes: + description: AWS Logs Services response body + properties: + logs_services: + description: List of AWS services that can send logs to Datadog + items: + example: s3 + type: string + type: array + type: object + AWSLogsServicesResponseData: + description: AWS Logs Services response body + properties: + attributes: + $ref: '#/components/schemas/AWSLogsServicesResponseAttributes' + id: + default: get_logs_services + description: The `AWSLogsServicesResponseData` `id`. + type: string + type: + default: logs_services + description: The `AWSLogsServicesResponseData` `type`. + type: string + type: object + AWSMetricsConfig: + description: AWS Metrics config + properties: + automute_enabled: + description: Enable EC2 automute for AWS metrics + example: true + type: boolean + collect_cloudwatch_alarms: + description: Enable CloudWatch alarms collection + example: true + type: boolean + collect_custom_metrics: + description: Enable custom metrics collection + example: true + type: boolean + enabled: + description: Enable AWS metrics collection + example: true + type: boolean + namespace_filters: + $ref: '#/components/schemas/AWSNamespaceFilters' + tag_filters: + description: AWS Metrics tag filters list + items: + $ref: '#/components/schemas/AWSNamespaceTagFilter' + type: array + type: object + AWSNamespaceFilters: + description: AWS Metrics namespace filters + oneOf: + - $ref: '#/components/schemas/AWSNamespaceFiltersExcludeAll' + - $ref: '#/components/schemas/AWSNamespaceFiltersExcludeOnly' + - $ref: '#/components/schemas/AWSNamespaceFiltersIncludeAll' + - $ref: '#/components/schemas/AWSNamespaceFiltersIncludeOnly' + AWSNamespaceFiltersExcludeAll: + description: Exclude all namespaces + properties: + exclude_all: + description: Exclude all namespaces + example: false + type: boolean + required: + - exclude_all + AWSNamespaceFiltersExcludeOnly: + description: Exclude only these namespaces + properties: + exclude_only: + description: Exclude only these namespaces + example: + - AWS/EC2 + items: + example: AWS/EC2 + type: string + type: array + required: + - exclude_only + AWSNamespaceFiltersIncludeAll: + description: Include all namespaces + properties: + include_all: + description: Include all namespaces + example: false + type: boolean + required: + - include_all + AWSNamespaceFiltersIncludeOnly: + description: Include only these namespaces + properties: + include_only: + description: Include only these namespaces + example: + - AWS/EC2 + items: + example: AWS/EC2 + type: string + type: array + required: + - include_only + AWSNamespaceTagFilter: + description: AWS Metrics tag filters + properties: + namespace: + description: The AWS Namespace to apply the tag filters against + example: AWS/EC2 + type: string + tags: + description: The tags to filter based on + items: + example: key:value + type: string + nullable: true + type: array + type: object + AWSNamespacesResponse: + description: AWS Namespaces response body + properties: + data: + description: List of AWS CloudWatch namespaces that can send metrics to + Datadog + items: + $ref: '#/components/schemas/AWSNamespacesResponseData' + type: array + type: object + AWSNamespacesResponseAttributes: + description: AWS Namespaces response body + properties: + namespace: + description: AWS CloudWatch namespace + example: AWS/ApiGateway + type: string + type: object + AWSNamespacesResponseData: + description: AWS Namespaces response body + properties: + attributes: + $ref: '#/components/schemas/AWSNamespacesResponseAttributes' + id: + description: Datadog ID of the AWS Namespace + example: amazon-api-gateway + type: string + type: + default: namespace + description: The `AWSNamespacesResponseData` `type`. + type: string + type: object + AWSNewExternalIDResponse: + description: AWS External ID response body + properties: + data: + $ref: '#/components/schemas/AWSNewExternalIDResponseData' + type: object + AWSNewExternalIDResponseAttributes: + description: AWS External ID response body + properties: + external_id: + description: AWS IAM External ID for associated role + example: acb8f6b8a844443dbb726d07dcb1a870 + type: string + type: object + AWSNewExternalIDResponseData: + description: AWS External ID response body + properties: + attributes: + $ref: '#/components/schemas/AWSNewExternalIDResponseAttributes' + id: + default: generate_new_external_id + description: The `AWSNewExternalIDResponseData` `id`. + type: string + type: + default: generate_new_external_id + description: The `AWSNewExternalIDResponseData` `type`. + type: string + type: object + AWSRegions: + description: AWS Regions to collect data from + oneOf: + - $ref: '#/components/schemas/AWSRegionsIncludeAll' + - $ref: '#/components/schemas/AWSRegionsIncludeOnly' + AWSRegionsIncludeAll: + description: Include all regions + properties: + include_all: + description: Include all regions + example: false + type: boolean + required: + - include_all + AWSRegionsIncludeOnly: + description: Include only these regions + properties: + include_only: + description: Include only these regions + example: + - us-east-1 + items: + example: us-east-1 + type: string + type: array + required: + - include_only AWSRelatedAccount: description: AWS related account. properties: @@ -998,6 +1458,26 @@ components: $ref: '#/components/schemas/AWSRelatedAccount' type: array type: object + AWSResourcesConfig: + description: AWS Resources config + properties: + cloud_security_posture_management_collection: + description: Whether Datadog collects cloud security posture management + resources from your AWS account. + example: false + type: boolean + extended_collection: + description: Whether Datadog collects additional attributes and configuration + information about the resources in your AWS account. Required for `cspm_resource_collection`. + example: false + type: boolean + type: object + AWSTracesConfig: + description: AWS Traces config + properties: + xray_services: + $ref: '#/components/schemas/XRayServicesList' + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -25615,6 +26095,34 @@ components: description: The id of the instance. type: string type: object + XRayServicesIncludeAll: + description: Include all services + properties: + include_all: + description: Include all services + example: false + type: boolean + required: + - include_all + XRayServicesIncludeOnly: + description: Include only these services + nullable: true + properties: + include_only: + description: Include only these services + example: + - AWS/AppSync + items: + example: AWS/AppSync + type: string + type: array + required: + - include_only + XRayServicesList: + description: AWS X-Ray services to collect traces from + oneOf: + - $ref: '#/components/schemas/XRayServicesIncludeAll' + - $ref: '#/components/schemas/XRayServicesIncludeOnly' securitySchemes: AuthZ: description: This API uses OAuth 2 with the implicit grant flow. @@ -30427,6 +30935,223 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/aws/accounts: + get: + description: Get a list of AWS Account Integration Configs. + operationId: ListAWSAccounts + parameters: + - example: '123456789012' + in: query + name: aws_account_id + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountsResponse' + description: AWS Accounts List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Get all account configs + tags: + - AWS Integration + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + post: + description: Create a new AWS Account Integration Config. + operationId: CreateAWSAccount + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Create account config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/accounts/{aws_account_config_id}: + delete: + description: Delete an AWS Account Integration Config + operationId: DeleteAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Delete account config + tags: + - AWS Integration + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + get: + description: Get an AWS Account Integration Config + operationId: GetAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Get account config + tags: + - AWS Integration + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + patch: + description: Update an AWS Account Integration Config + operationId: UpdateAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountPatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Patch account config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/generate_new_external_id: + post: + description: Generate a new external ID for AWS role-based authentication. + operationId: GenerateNewExternalID + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSNewExternalIDResponse' + description: AWS External ID object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: AWS Integration - Generate new external ID + tags: + - AWS Integration + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/logs/services: + get: + description: Get a list of AWS services that can send logs to Datadog. + operationId: ListAWSLogServices + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSLogsServicesResponse' + description: AWS Logs Services List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: AWS Integration - List log services + tags: + - AWS Integration + /api/v2/integration/aws/namespaces: + get: + description: Get a list of AWS CloudWatch namespaces that can send metrics to + Datadog. + operationId: ListAWSNamespaces + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSNamespacesResponse' + description: AWS Namespaces List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: AWS Integration - List namespaces + tags: + - AWS Integration /api/v2/integration/gcp/accounts: get: description: List all GCP STS-enabled service accounts configured in your Datadog @@ -41311,6 +42036,11 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/ name: APM Retention Filters +- description: 'Configure your Datadog-AWS integration directly through the Datadog + API. + + For more information, see the [AWS integration page](https://docs.datadoghq.com/integrations/amazon_web_services).' + name: AWS Integration - description: Search your Audit Logs events over HTTP. name: Audit - description: '[The AuthN Mappings API](https://docs.datadoghq.com/account_management/authn_mapping/?tab=example) diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..1fdafeac42ab --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:47.796Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..d2fdcc6871f7 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.yml @@ -0,0 +1,40 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"46ed446c-8460-4f23-aad1-78ef9e6d209e","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"bfbe705fb0a44dbd8d3d87a578cd2355"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-10-17T21:26:48.239286052Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":true,"collect_cloudwatch_alarms":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"exclude_only":["AWS/SQS","AWS/ElasticMapReduce"]}},"modified_at":"2024-10-17T21:26:48.239290737Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/46ed446c-8460-4f23-aad1-78ef9e6d209e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..5908860d2fda --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:48.492Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..3d06ac683296 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws-invalid","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid partition: aws-invalid"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.frozen new file mode 100644 index 000000000000..c15af3d9c0f1 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:48.562Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.yml new file mode 100644 index 000000000000..57c0c20f4252 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.yml @@ -0,0 +1,63 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"58f8c3f8-1446-4cd9-adab-b19d3bef6946","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"2174d54974d34aec983decaf243d9f85"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:48.973808551Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:48.973812924Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"409","title":"Account already exists","detail":"AWS + account with provided id already exists"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Thu, 17 Oct 2024 21:26:48 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/58f8c3f8-1446-4cd9-adab-b19d3bef6946 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.frozen new file mode 100644 index 000000000000..520064df1ebc --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.frozen @@ -0,0 +1 @@ +2024-08-09T18:59:51.401Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.yml new file mode 100644 index 000000000000..55290ac72421 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-invalid-aws-partition-returns-400-API-error-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Fri, 09 Aug 2024 18:59:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"aws_account":{"account_tags":[],"auth_config":{"role_name":"test"},"aws_account_id":"172322422800","aws_partition":"aws-test","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":[],"sources":["s3"]}},"metrics_config":{"namespace_filters":{"exclude_only":["AWS/EC2"],"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":[]}]},"resources_config":{},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}},"id":"172322422800","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid partition: aws-test"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..2e16a115a03c --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-08-09T18:59:51.926Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..28e028423e82 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-with-valid-config-returns-AWS-Account-object-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Fri, 09 Aug 2024 18:59:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"aws_account":{"account_tags":[],"auth_config":{"role_name":"test"},"aws_account_id":"172322422800","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":[],"sources":["s3"]}},"metrics_config":{"namespace_filters":{"exclude_only":["AWS/EC2"],"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":[]}]},"resources_config":{},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}},"id":"172322422800","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"create_account","type":"account","attributes":{"aws_account":{"account_tags":null,"aws_account_id":"172322422800","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"auth_config":{"role_name":"test","external_id":"08df61ab19794766a0df51fa344ef31c"},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":null}],"namespace_filters":{"include_only":["AWS/EC2"]}},"logs_config":{"lambda_forwarder":{"sources":["s3"]}},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}},"resources_config":{"cloud_security_posture_management_collection":false}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 09 Aug 2024 18:59:51 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/172322422800 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..3440e660d6e1 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:49.757Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..aac3455e077b --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/not-a-uuid + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"aws_account_config_id\" in \"path\"; expected type \"uuid\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.frozen new file mode 100644 index 000000000000..da1c7999b57f --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:49.836Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.yml new file mode 100644 index 000000000000..bb3c5cf806cd --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.yml @@ -0,0 +1,59 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ef7143b8-a778-402f-bb5c-b648f30b8f1b","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"eaeaf6202c5546d8bfb794d340dc51d3"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:50.262139Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:50.262143201Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ef7143b8-a778-402f-bb5c-b648f30b8f1b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 17 Oct 2024 21:26:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ef7143b8-a778-402f-bb5c-b648f30b8f1b + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..69466f331111 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:50.629Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..72224bc9901a --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.yml @@ -0,0 +1,59 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:50 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"31fb67a7-3e51-4cab-a0be-6531ca478ed2","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"7aefb5ab59e9459e8b5dc9d975266c76"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:51.052883814Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:51.052887892Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:50 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- recorded_at: Thu, 17 Oct 2024 21:26:50 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/31fb67a7-3e51-4cab-a0be-6531ca478ed2 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen new file mode 100644 index 000000000000..9c677f9018ee --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:51.413Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.yml new file mode 100644 index 000000000000..feb594eb6583 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Generate-new-external-ID-returns-AWS-External-ID-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/generate_new_external_id + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"generate_new_external_id","type":"generate_new_external_id","attributes":{"external_id":"b63ebcfb781340dab3343989ad091114"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..f753798a65d9 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:51.514Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..d9141c9867a1 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"694c1b27-2836-4edc-89cd-b586e4ad629c","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"f5ddc155a732471092f76c849311e0c6"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:52.160741502Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:52.160745039Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/694c1b27-2836-4edc-89cd-b586e4ad629c + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"694c1b27-2836-4edc-89cd-b586e4ad629c","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"f5ddc155a732471092f76c849311e0c6"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:52.160742Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:52.160745Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:51 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/694c1b27-2836-4edc-89cd-b586e4ad629c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..e6a83f809910 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:52.526Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..872e6bf7e301 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/not-a-uuid + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"aws_account_config_id\" in \"path\"; expected type \"uuid\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..9050c2b0213c --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:52.610Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..680ff80a2c21 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.frozen new file mode 100644 index 000000000000..9be5554e9bcf --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:52.713Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.yml new file mode 100644 index 000000000000..c5b2c55c0a80 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-all-account-configs-returns-AWS-Accounts-List-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"e6daa8c4-58b6-42e1-970e-44e6fa812ce0","type":"account","attributes":{"account_tags":[],"auth_config":{"access_key_id":"AKIA514950102505"},"aws_account_id":"514950102505","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-09-06T00:18:12.382448Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:1234567890:function:datadog-forwarder-Forwarder"],"sources":[]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[],"namespace_filters":{"exclude_only":["AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-09-06T00:18:17.536561Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"a0c7f96e-a471-488e-84be-c3336e7ab693","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"859ffc73702c40f589cc3b74c5967e27"},"aws_account_id":"172830950700","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-10-07T13:58:28.577522Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-10-07T13:58:28.577526Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"3a3d5b83-2ad8-41d8-b82e-a3ba972a9783","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"be10a93f33a64b0ea872da2f48348979"},"aws_account_id":"172704974400","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-09-23T00:02:26.306293Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-09-23T00:02:26.306297Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"89a9dae5-cbe3-4fba-b1b2-aae8775ed319","type":"account","attributes":{"account_tags":["filter:one","filtertwo"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"e31ada331546486f9099cd5c01eef257"},"aws_account_id":"001725901256","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-2","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-09-09T17:00:58.823444Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["testTag","test:Tag2"]}],"namespace_filters":{"exclude_only":["AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-10-16T14:55:17.947931Z","resources_config":{"cloud_security_posture_management_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"d52e151c-c608-4e14-9f29-dfeff876bb39","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"c2909403ca9949db82c36adf6e8cdcfa"},"aws_account_id":"172772261200","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-09-30T18:56:55.042771Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-09-30T18:56:55.042775Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"d7d74617-832d-4c4d-a8c3-1e69d509ea52","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"2b1dd9fd35b0440ca4bf98ff70ac2e63"},"aws_account_id":"172772275700","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-09-30T18:59:18.175722Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-09-30T18:59:18.175727Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"7e5acac6-3ac8-4762-8100-479f03ccffc8","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"04548a334583412aa4e6f5548f4e9989"},"aws_account_id":"172532181900","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1","eu-west-1","eu-central-1","ap-southeast-1","ap-southeast-2","ap-northeast-1","ap-northeast-2","ap-northeast-3","sa-east-1","ap-south-1","ca-central-1","eu-west-2","eu-west-3","eu-north-1","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ca-west-1","eu-central-2","eu-south-1","eu-south-2","il-central-1","me-central-1","me-south-1"]},"created_at":"2024-09-03T00:03:40.248176Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-09-03T00:03:40.24818Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}},{"id":"7e1d660d-1142-45b1-a795-dc3900b6bd17","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"f61b52d768394db6851aed2f887ac6f6"},"aws_account_id":"172830950701","aws_partition":"aws","aws_regions":{"include_only":["me-south-1"]},"created_at":"2024-10-17T15:08:40.917209Z","logs_config":{"lambda_forwarder":{"lambdas":[],"sources":[]}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-10-17T15:08:40.917219Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":[]}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.frozen new file mode 100644 index 000000000000..4410cf37d69a --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:52.853Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.yml new file mode 100644 index 000000000000..767326863199 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-log-services-returns-AWS-Logs-Services-List-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/logs/services + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"get_logs_services","type":"logs_services","attributes":{"logs_services":["apigw-access-logs","apigw-execution-logs","cloudfront","elb","elbv2","lambda","redshift","s3","states","waf"]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.frozen new file mode 100644 index 000000000000..0fce84f2ddc6 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:52.920Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.yml new file mode 100644 index 000000000000..920b0a3baff6 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.yml @@ -0,0 +1,79 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/namespaces + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"amazon-api-gateway","type":"namespace","attributes":{"display_name":"API + Gateway","icon_id":"amazon-api-gateway","namespace":"AWS/ApiGateway"}},{"id":"amazon-app-runner","type":"namespace","attributes":{"display_name":"App + Runner","icon_id":"amazon-app-runner","namespace":"AWS/AppRunner"}},{"id":"amazon-appstream","type":"namespace","attributes":{"display_name":"AppStream","icon_id":"amazon-appstream","namespace":"AWS/AppStream"}},{"id":"amazon-appsync","type":"namespace","attributes":{"display_name":"AppSync","icon_id":"amazon-appsync","namespace":"AWS/AppSync"}},{"id":"amazon-elb","type":"namespace","attributes":{"display_name":"Application + Load Balancer","icon_id":"amazon-elb","namespace":"AWS/ApplicationELB"}},{"id":"amazon-athena","type":"namespace","attributes":{"display_name":"Athena","icon_id":"amazon-athena","namespace":"AWS/Athena"}},{"id":"amazon-auto-scaling","type":"namespace","attributes":{"display_name":"Auto + Scaling","icon_id":"amazon-auto-scaling","namespace":"AWS/AutoScaling"}},{"id":"amazon-backup","type":"namespace","attributes":{"display_name":"Backup","icon_id":"amazon-backup","namespace":"AWS/Backup"}},{"id":"amazon-bedrock","type":"namespace","attributes":{"display_name":"Bedrock","icon_id":"amazon-bedrock","namespace":"AWS/Bedrock"}},{"id":"amazon-billing","type":"namespace","attributes":{"display_name":"Billing","icon_id":"amazon-billing","namespace":"AWS/Billing"}},{"id":"amazon-certificate-manager","type":"namespace","attributes":{"display_name":"Certificate + Manager","icon_id":"amazon-certificate-manager","namespace":"AWS/CertificateManager"}},{"id":"amazon-elb","type":"namespace","attributes":{"display_name":"Classic + Load Balancer (ELB)","icon_id":"amazon-elb","namespace":"AWS/ELB"}},{"id":"amazon-cloudfront","type":"namespace","attributes":{"display_name":"CloudFront","icon_id":"amazon-cloudfront","namespace":"AWS/CloudFront"}},{"id":"amazon-cloudhsm","type":"namespace","attributes":{"display_name":"CloudHSM","icon_id":"amazon-cloudhsm","namespace":"AWS/CloudHSM"}},{"id":"amazon-cloudsearch","type":"namespace","attributes":{"display_name":"CloudSearch","icon_id":"amazon-cloudsearch","namespace":"AWS/CloudSearch"}},{"id":"amazon-codebuild","type":"namespace","attributes":{"display_name":"CodeBuild","icon_id":"amazon-codebuild","namespace":"AWS/CodeBuild"}},{"id":"amazon-codewhisperer","type":"namespace","attributes":{"display_name":"CodeWhisperer","icon_id":"amazon-codewhisperer","namespace":"AWS/CodeWhisperer"}},{"id":"amazon-cognito","type":"namespace","attributes":{"display_name":"Cognito","icon_id":"amazon-cognito","namespace":"AWS/Cognito"}},{"id":"amazon-config","type":"namespace","attributes":{"display_name":"Config","icon_id":"amazon-config","namespace":"AWS/Config"}},{"id":"amazon-connect","type":"namespace","attributes":{"display_name":"Connect","icon_id":"amazon-connect","namespace":"AWS/Connect"}},{"id":"amazon-dms","type":"namespace","attributes":{"display_name":"Database + Migration Service","icon_id":"amazon-dms","namespace":"AWS/DMS"}},{"id":"amazon-direct-connect","type":"namespace","attributes":{"display_name":"Direct + Connect","icon_id":"amazon-direct-connect","namespace":"AWS/DX"}},{"id":"amazon-documentdb","type":"namespace","attributes":{"display_name":"DocumentDB","icon_id":"amazon-documentdb","namespace":"AWS/DocDB"}},{"id":"amazon-dynamodb","type":"namespace","attributes":{"display_name":"DynamoDB","icon_id":"amazon-dynamodb","namespace":"AWS/DynamoDB"}},{"id":"amazon-dynamodb-accelerator","type":"namespace","attributes":{"display_name":"DynamoDB + Accelerator (DAX)","icon_id":"amazon-dynamodb-accelerator","namespace":"AWS/DAX"}},{"id":"amazon-ec2","type":"namespace","attributes":{"display_name":"EC2","icon_id":"amazon-ec2","namespace":"AWS/EC2"}},{"id":"amazon-ec2","type":"namespace","attributes":{"display_name":"EC2 + API","icon_id":"amazon-ec2","namespace":"AWS/EC2/API"}},{"id":"amazon-network-manager","type":"namespace","attributes":{"display_name":"EC2 + Infrastructure Performance","icon_id":"amazon-network-manager","namespace":"AWS/EC2/InfrastructurePerformance"}},{"id":"amazon-ec2-spot","type":"namespace","attributes":{"display_name":"EC2 + Spot","icon_id":"amazon-ec2-spot","namespace":"AWS/EC2Spot"}},{"id":"amazon-emr","type":"namespace","attributes":{"display_name":"EMR","icon_id":"amazon-emr","namespace":"AWS/ElasticMapReduce"}},{"id":"amazon-elasticache","type":"namespace","attributes":{"display_name":"ElastiCache","icon_id":"amazon-elasticache","namespace":"AWS/ElastiCache"}},{"id":"amazon-elastic-beanstalk","type":"namespace","attributes":{"display_name":"Elastic + Beanstalk","icon_id":"amazon-elastic-beanstalk","namespace":"AWS/ElasticBeanstalk"}},{"id":"amazon-ebs","type":"namespace","attributes":{"display_name":"Elastic + Block Store (EBS)","icon_id":"amazon-ebs","namespace":"AWS/EBS"}},{"id":"amazon-ecr","type":"namespace","attributes":{"display_name":"Elastic + Container Registry (ECR)","icon_id":"amazon-ecr","namespace":"AWS/ECR"}},{"id":"amazon-ecs","type":"namespace","attributes":{"display_name":"Elastic + Container Service (ECS)","icon_id":"amazon-ecs","namespace":"AWS/ECS"}},{"id":"amazon-efs","type":"namespace","attributes":{"display_name":"Elastic + File System (EFS)","icon_id":"amazon-efs","namespace":"AWS/EFS"}},{"id":"amazon-elastic-transcoder","type":"namespace","attributes":{"display_name":"Elastic + Transcoder","icon_id":"amazon-elastic-transcoder","namespace":"AWS/ElasticTranscoder"}},{"id":"amazon-mediaconnect","type":"namespace","attributes":{"display_name":"Elemental + MediaConnect","icon_id":"amazon-mediaconnect","namespace":"AWS/MediaConnect"}},{"id":"amazon-mediaconvert","type":"namespace","attributes":{"display_name":"Elemental + MediaConvert","icon_id":"amazon-mediaconvert","namespace":"AWS/MediaConvert"}},{"id":"amazon-medialive","type":"namespace","attributes":{"display_name":"Elemental + MediaLive","icon_id":"amazon-medialive","namespace":"AWS/MediaLive"}},{"id":"amazon-mediapackage","type":"namespace","attributes":{"display_name":"Elemental + MediaPackage","icon_id":"amazon-mediapackage","namespace":"AWS/MediaPackage"}},{"id":"amazon-mediastore","type":"namespace","attributes":{"display_name":"Elemental + MediaStore","icon_id":"amazon-mediastore","namespace":"AWS/MediaStore"}},{"id":"amazon-mediatailor","type":"namespace","attributes":{"display_name":"Elemental + MediaTailor","icon_id":"amazon-mediatailor","namespace":"AWS/MediaTailor"}},{"id":"amazon-event-bridge","type":"namespace","attributes":{"display_name":"EventBridge","icon_id":"amazon-event-bridge","namespace":"AWS/Events"}},{"id":"amazon-fsx","type":"namespace","attributes":{"display_name":"FSx","icon_id":"amazon-fsx","namespace":"AWS/FSx"}},{"id":"amazon-gamelift","type":"namespace","attributes":{"display_name":"GameLift","icon_id":"amazon-gamelift","namespace":"AWS/GameLift"}},{"id":"amazon-globalaccelerator","type":"namespace","attributes":{"display_name":"GlobalAccelerator","icon_id":"amazon-globalaccelerator","namespace":"AWS/GlobalAccelerator"}},{"id":"amazon-glue","type":"namespace","attributes":{"display_name":"Glue","icon_id":"amazon-glue","namespace":"Glue"}},{"id":"amazon-inspector","type":"namespace","attributes":{"display_name":"Inspector","icon_id":"amazon-inspector","namespace":"AWS/Inspector"}},{"id":"amazon-iot","type":"namespace","attributes":{"display_name":"IoT","icon_id":"amazon-iot","namespace":"AWS/IoT"}},{"id":"amazon-kms","type":"namespace","attributes":{"display_name":"Key + Management Service (KMS)","icon_id":"amazon-kms","namespace":"AWS/KMS"}},{"id":"amazon-keyspaces","type":"namespace","attributes":{"display_name":"Keyspaces + (for Apache Cassandra)","icon_id":"amazon-keyspaces","namespace":"AWS/Cassandra"}},{"id":"amazon-kinesis","type":"namespace","attributes":{"display_name":"Kinesis","icon_id":"amazon-kinesis","namespace":"AWS/Kinesis"}},{"id":"amazon-kinesis-data-analytics","type":"namespace","attributes":{"display_name":"Kinesis + Data Analytics","icon_id":"amazon-kinesis-data-analytics","namespace":"AWS/KinesisAnalytics"}},{"id":"amazon-firehose","type":"namespace","attributes":{"display_name":"Kinesis + Data Firehose","icon_id":"amazon-firehose","namespace":"AWS/Firehose"}},{"id":"amazon-lambda","type":"namespace","attributes":{"display_name":"Lambda","icon_id":"amazon-lambda","namespace":"AWS/Lambda"}},{"id":"amazon-lex","type":"namespace","attributes":{"display_name":"Lex","icon_id":"amazon-lex","namespace":"AWS/Lex"}},{"id":"amazon-mq","type":"namespace","attributes":{"display_name":"MQ","icon_id":"amazon-mq","namespace":"AWS/AmazonMQ"}},{"id":"amazon-machine-learning","type":"namespace","attributes":{"display_name":"Machine + Learning","icon_id":"amazon-machine-learning","namespace":"AWS/ML"}},{"id":"amazon-kafka","type":"namespace","attributes":{"display_name":"Managed + Streaming for Apache Kafka (MSK)","icon_id":"amazon-kafka","namespace":"AWS/Kafka"}},{"id":"amazon-mwaa","type":"namespace","attributes":{"display_name":"Managed + Workflows for Apache Airflow (MWAA)","icon_id":"amazon-mwaa","namespace":"AmazonMWAA"}},{"id":"amazon-memorydb","type":"namespace","attributes":{"display_name":"MemoryDB","icon_id":"amazon-memorydb","namespace":"AWS/MemoryDB"}},{"id":"amazon-nat-gateway","type":"namespace","attributes":{"display_name":"NAT + Gateway","icon_id":"amazon-nat-gateway","namespace":"AWS/NATGateway"}},{"id":"amazon-neptune","type":"namespace","attributes":{"display_name":"Neptune","icon_id":"amazon-neptune","namespace":"AWS/Neptune"}},{"id":"amazon-network-firewall","type":"namespace","attributes":{"display_name":"Network + Firewall","icon_id":"amazon-network-firewall","namespace":"AWS/NetworkFirewall"}},{"id":"amazon-elb","type":"namespace","attributes":{"display_name":"Network + Load Balancer","icon_id":"amazon-elb","namespace":"AWS/NetworkELB"}},{"id":"amazon-network-manager","type":"namespace","attributes":{"display_name":"Network + Manager","icon_id":"amazon-network-manager","namespace":"AWS/Network Manager"}},{"id":"amazon-cloudwatch","type":"namespace","attributes":{"display_name":"Network + Monitor","icon_id":"amazon-cloudwatch","namespace":"AWS/NetworkMonitor"}},{"id":"amazon-es","type":"namespace","attributes":{"display_name":"OpenSearch","icon_id":"amazon-es","namespace":"AWS/ES"}},{"id":"amazon-opensearch-serverless","type":"namespace","attributes":{"display_name":"OpenSearch + Serverless","icon_id":"amazon-opensearch-serverless","namespace":"AWS/AOSS"}},{"id":"amazon-opsworks","type":"namespace","attributes":{"display_name":"OpsWorks","icon_id":"amazon-opsworks","namespace":"AWS/OpsWorks"}},{"id":"amazon-polly","type":"namespace","attributes":{"display_name":"Polly","icon_id":"amazon-polly","namespace":"AWS/Polly"}},{"id":"amazon-privatelink","type":"namespace","attributes":{"display_name":"PrivateLink + Endpoints","icon_id":"amazon-privatelink","namespace":"AWS/PrivateLinkEndpoints"}},{"id":"amazon-privatelink","type":"namespace","attributes":{"display_name":"PrivateLink + Services","icon_id":"amazon-privatelink","namespace":"AWS/PrivateLinkServices"}},{"id":"amazon-rds","type":"namespace","attributes":{"display_name":"RDS","icon_id":"amazon-rds","namespace":"AWS/RDS"}},{"id":"amazon-rds-proxy","type":"namespace","attributes":{"display_name":"RDS + Proxy","icon_id":"amazon-rds-proxy","namespace":"AWS/RDS/Proxy"}},{"id":"amazon-redshift","type":"namespace","attributes":{"display_name":"Redshift","icon_id":"amazon-redshift","namespace":"AWS/Redshift"}},{"id":"amazon-rekognition","type":"namespace","attributes":{"display_name":"Rekognition","icon_id":"amazon-rekognition","namespace":"AWS/Rekognition"}},{"id":"amazon-route-53","type":"namespace","attributes":{"display_name":"Route + 53","icon_id":"amazon-route-53","namespace":"AWS/Route53"}},{"id":"amazon-route-53-resolver","type":"namespace","attributes":{"display_name":"Route + 53 Resolver","icon_id":"amazon-route-53-resolver","namespace":"AWS/Route53Resolver"}},{"id":"amazon-s3","type":"namespace","attributes":{"display_name":"S3","icon_id":"amazon-s3","namespace":"AWS/S3"}},{"id":"amazon-s3-storage-lens","type":"namespace","attributes":{"display_name":"S3 + Storage Lens","icon_id":"amazon-s3-storage-lens","namespace":"AWS/S3/Storage-Lens"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker","icon_id":"amazon-sagemaker","namespace":"AWS/SageMaker"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Endpoints","icon_id":"amazon-sagemaker","namespace":"/aws/sagemaker/Endpoints"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Labeling Jobs","icon_id":"amazon-sagemaker","namespace":"AWS/Sagemaker/LabelingJobs"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Model Building Pipeline","icon_id":"amazon-sagemaker","namespace":"AWS/Sagemaker/ModelBuildingPipeline"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Processing Jobs","icon_id":"amazon-sagemaker","namespace":"/aws/sagemaker/ProcessingJobs"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Training Jobs","icon_id":"amazon-sagemaker","namespace":"/aws/sagemaker/TrainingJobs"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Transform Jobs","icon_id":"amazon-sagemaker","namespace":"/aws/sagemaker/TransformJobs"}},{"id":"amazon-sagemaker","type":"namespace","attributes":{"display_name":"SageMaker + Workteam","icon_id":"amazon-sagemaker","namespace":"AWS/SageMaker/Workteam"}},{"id":"amazon-service-quotas","type":"namespace","attributes":{"display_name":"Service + Quotas","icon_id":"amazon-service-quotas","namespace":"AWS/ServiceQuotas"}},{"id":"amazon-shield","type":"namespace","attributes":{"display_name":"Shield","icon_id":"amazon-shield","namespace":"AWS/DDoSProtection"}},{"id":"amazon-ses","type":"namespace","attributes":{"display_name":"Simple + Email Service (SES)","icon_id":"amazon-ses","namespace":"AWS/SES"}},{"id":"amazon-sns","type":"namespace","attributes":{"display_name":"Simple + Notification Service (SNS)","icon_id":"amazon-sns","namespace":"AWS/SNS"}},{"id":"amazon-sqs","type":"namespace","attributes":{"display_name":"Simple + Queue Service (SQS)","icon_id":"amazon-sqs","namespace":"AWS/SQS"}},{"id":"amazon-swf","type":"namespace","attributes":{"display_name":"Simple + Workflow Service (SWF)","icon_id":"amazon-swf","namespace":"AWS/SWF"}},{"id":"amazon-step-functions","type":"namespace","attributes":{"display_name":"Step + Functions (States)","icon_id":"amazon-step-functions","namespace":"AWS/States"}},{"id":"amazon-storage-gateway","type":"namespace","attributes":{"display_name":"Storage + Gateway","icon_id":"amazon-storage-gateway","namespace":"AWS/StorageGateway"}},{"id":"amazon-textract","type":"namespace","attributes":{"display_name":"Textract","icon_id":"amazon-textract","namespace":"AWS/Textract"}},{"id":"amazon-vpc","type":"namespace","attributes":{"display_name":"Transit + Gateway","icon_id":"amazon-vpc","namespace":"AWS/TransitGateway"}},{"id":"amazon-translate","type":"namespace","attributes":{"display_name":"Translate","icon_id":"amazon-translate","namespace":"AWS/Translate"}},{"id":"amazon-trusted-advisor","type":"namespace","attributes":{"display_name":"Trusted + Advisor","icon_id":"amazon-trusted-advisor","namespace":"AWS/TrustedAdvisor"}},{"id":"amazon-vpn","type":"namespace","attributes":{"display_name":"VPN","icon_id":"amazon-vpn","namespace":"AWS/VPN"}},{"id":"amazon-waf","type":"namespace","attributes":{"display_name":"WAF","icon_id":"amazon-waf","namespace":"WAF"}},{"id":"amazon-waf","type":"namespace","attributes":{"display_name":"WAFV2","icon_id":"amazon-waf","namespace":"AWS/WAFV2"}},{"id":"amazon-workspaces","type":"namespace","attributes":{"display_name":"WorkSpaces","icon_id":"amazon-workspaces","namespace":"AWS/WorkSpaces"}},{"id":"amazon-xray","type":"namespace","attributes":{"display_name":"X-Ray","icon_id":"amazon-xray","namespace":"AWS/X-Ray"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.frozen new file mode 100644 index 000000000000..042faedbb739 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.frozen @@ -0,0 +1 @@ +2024-08-21T20:16:52.731Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.yml new file mode 100644 index 000000000000..b852f5b4cfbb --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-API-error-response-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Wed, 21 Aug 2024 20:16:52 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1"]},"logs_config":{},"metrics_config":{"automute_enabled":true,"enabled":false,"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}]},"resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"123456789012","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b5333e91-03e0-4a3f-9bd6-07e2d83cb85f","type":"account","attributes":{"account_tags":["$KEY:$VALUE"],"auth_config":{"role_name":"DatadogAWSIntegrationRole","external_id":"aa55eef398064c1ab1937f6f008b7184"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-2","us-west-1"]},"created_at":"2024-08-21T20:16:53.079170523Z","logs_config":{"lambda_forwarder":{}},"metrics_config":{"enabled":false,"automute_enabled":true,"collect_custom_metrics":true,"collect_cloudwatch_alarms":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["$KEY:$VALUE"]}],"namespace_filters":{"exclude_only":["AWS/AutoScaling","AWS/ElasticMapReduce","AWS/SQS"]}},"modified_at":"2024-08-21T20:16:53.079176907Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 21 Aug 2024 20:16:52 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":[],"auth_config":{"role_name":"test"},"aws_account_id":"123456789012","aws_partition":"aws-test","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":[],"sources":["s3"]}},"metrics_config":{"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":[]}]},"resources_config":{},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"123456789012","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/123456789012 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid partition: aws-test"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Wed, 21 Aug 2024 20:16:52 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/123456789012 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..0ca4f8a300b1 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:53.008Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..47f645a4b3d9 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"8de30a6a-03f0-407c-8a48-56de120de9f1","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"25835fa1d01941e29d8ffb623d21e520"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:53.433422567Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:53.433426727Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/8de30a6a-03f0-407c-8a48-56de120de9f1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"8de30a6a-03f0-407c-8a48-56de120de9f1","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"25835fa1d01941e29d8ffb623d21e520"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:53.433423Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":true,"collect_cloudwatch_alarms":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:53.611662385Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/8de30a6a-03f0-407c-8a48-56de120de9f1 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..c862a2084c3e --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:53.848Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..d8dbe683661f --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.yml @@ -0,0 +1,63 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":false,"collect_custom_metrics":false,"enabled":true,"namespace_filters":{"include_only":["AWS/EC2"]},"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}},"id":"00000000-abcd-0001-0000-000000000000","type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a9b608e7-9ad5-47b2-873f-8df94dec79f6","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"e0f55167b3f14783b7b2934241686c3d"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-17T21:26:54.457330826Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2024-10-17T21:26:54.457334502Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/a9b608e7-9ad5-47b2-873f-8df94dec79f6 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"cannot switch between + role and key based auth"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 17 Oct 2024 21:26:53 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/a9b608e7-9ad5-47b2-873f-8df94dec79f6 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..1a65b3b4dae9 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-17T21:26:54.809Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..57b2821dcdc9 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 17 Oct 2024 21:26:54 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/examples/v2/aws-integration/CreateAWSAccount.rb b/examples/v2/aws-integration/CreateAWSAccount.rb new file mode 100644 index 000000000000..f4d099264e5f --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccount.rb @@ -0,0 +1,53 @@ +# AWS Integration - Create account config returns "AWS Account object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_aws_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +body = DatadogAPIClient::V2::AWSAccountCreateRequest.new({ + data: DatadogAPIClient::V2::AWSAccountCreateRequestData.new({ + attributes: DatadogAPIClient::V2::AWSAccountCreateRequestAttributes.new({ + account_tags: [ + "key:value", + ], + auth_config: DatadogAPIClient::V2::AWSAuthConfigRole.new({ + role_name: "DatadogIntegrationRole", + }), + aws_account_id: "123456789012", + aws_partition: DatadogAPIClient::V2::AWSAccountPartition::AWS, + logs_config: DatadogAPIClient::V2::AWSLogsConfig.new({ + lambda_forwarder: DatadogAPIClient::V2::AWSLambdaForwarderConfig.new({ + lambdas: [ + "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder", + ], + sources: [ + "s3", + ], + }), + }), + metrics_config: DatadogAPIClient::V2::AWSMetricsConfig.new({ + automute_enabled: true, + collect_cloudwatch_alarms: true, + collect_custom_metrics: true, + enabled: true, + tag_filters: [ + DatadogAPIClient::V2::AWSNamespaceTagFilter.new({ + namespace: "AWS/EC2", + tags: [ + "key:value", + ], + }), + ], + }), + resources_config: DatadogAPIClient::V2::AWSResourcesConfig.new({ + cloud_security_posture_management_collection: false, + extended_collection: false, + }), + traces_config: DatadogAPIClient::V2::AWSTracesConfig.new({}), + }), + type: "account", + }), +}) +p api_instance.create_aws_account(body) diff --git a/examples/v2/aws-integration/DeleteAWSAccount.rb b/examples/v2/aws-integration/DeleteAWSAccount.rb new file mode 100644 index 000000000000..77141e060e1c --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccount.rb @@ -0,0 +1,11 @@ +# AWS Integration - Delete account config returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_aws_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +# there is a valid "aws_account_v2" in the system +AWS_ACCOUNT_V2_DATA_ID = ENV["AWS_ACCOUNT_V2_DATA_ID"] +api_instance.delete_aws_account(AWS_ACCOUNT_V2_DATA_ID) diff --git a/examples/v2/aws-integration/GenerateNewExternalID.rb b/examples/v2/aws-integration/GenerateNewExternalID.rb new file mode 100644 index 000000000000..ff1d08c393d6 --- /dev/null +++ b/examples/v2/aws-integration/GenerateNewExternalID.rb @@ -0,0 +1,8 @@ +# AWS Integration - Generate new external ID returns "AWS External ID object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.generate_new_external_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.generate_new_external_id() diff --git a/examples/v2/aws-integration/GetAWSAccount.rb b/examples/v2/aws-integration/GetAWSAccount.rb new file mode 100644 index 000000000000..e5837502de55 --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccount.rb @@ -0,0 +1,11 @@ +# AWS Integration - Get account config returns "AWS Account object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_aws_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +# there is a valid "aws_account_v2" in the system +AWS_ACCOUNT_V2_DATA_ID = ENV["AWS_ACCOUNT_V2_DATA_ID"] +p api_instance.get_aws_account(AWS_ACCOUNT_V2_DATA_ID) diff --git a/examples/v2/aws-integration/ListAWSAccounts.rb b/examples/v2/aws-integration/ListAWSAccounts.rb new file mode 100644 index 000000000000..8cebfbefd9c9 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSAccounts.rb @@ -0,0 +1,8 @@ +# AWS Integration - Get all account configs returns "AWS Accounts List object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_aws_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.list_aws_accounts() diff --git a/examples/v2/aws-integration/ListAWSLogServices.rb b/examples/v2/aws-integration/ListAWSLogServices.rb new file mode 100644 index 000000000000..d51db8e37aa0 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSLogServices.rb @@ -0,0 +1,5 @@ +# AWS Integration - List log services returns "AWS Logs Services List object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.list_aws_log_services() diff --git a/examples/v2/aws-integration/ListAWSNamespaces.rb b/examples/v2/aws-integration/ListAWSNamespaces.rb new file mode 100644 index 000000000000..bda08dea7416 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSNamespaces.rb @@ -0,0 +1,5 @@ +# AWS Integration - List namespaces returns "AWS Namespaces List object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.list_aws_namespaces() diff --git a/examples/v2/aws-integration/UpdateAWSAccount.rb b/examples/v2/aws-integration/UpdateAWSAccount.rb new file mode 100644 index 000000000000..a7d0097d8253 --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccount.rb @@ -0,0 +1,56 @@ +# AWS Integration - Patch account config returns "AWS Account object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_aws_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +# there is a valid "aws_account_v2" in the system +AWS_ACCOUNT_V2_DATA_ID = ENV["AWS_ACCOUNT_V2_DATA_ID"] + +body = DatadogAPIClient::V2::AWSAccountPatchRequest.new({ + data: DatadogAPIClient::V2::AWSAccountPatchRequestData.new({ + attributes: DatadogAPIClient::V2::AWSAccountPatchRequestAttributes.new({ + account_tags: [ + "key:value", + ], + auth_config: DatadogAPIClient::V2::AWSAuthConfigRole.new({ + role_name: "DatadogIntegrationRole", + }), + aws_account_id: "123456789012", + aws_partition: DatadogAPIClient::V2::AWSAccountPartition::AWS, + logs_config: DatadogAPIClient::V2::AWSLogsConfig.new({ + lambda_forwarder: DatadogAPIClient::V2::AWSLambdaForwarderConfig.new({ + lambdas: [ + "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder", + ], + sources: [ + "s3", + ], + }), + }), + metrics_config: DatadogAPIClient::V2::AWSMetricsConfig.new({ + automute_enabled: true, + collect_cloudwatch_alarms: true, + collect_custom_metrics: true, + enabled: true, + tag_filters: [ + DatadogAPIClient::V2::AWSNamespaceTagFilter.new({ + namespace: "AWS/EC2", + tags: [ + "key:value", + ], + }), + ], + }), + resources_config: DatadogAPIClient::V2::AWSResourcesConfig.new({ + cloud_security_posture_management_collection: false, + extended_collection: false, + }), + traces_config: DatadogAPIClient::V2::AWSTracesConfig.new({}), + }), + type: "account", + }), +}) +p api_instance.update_aws_account(AWS_ACCOUNT_V2_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 7ebbf68ba166..2659c5fc385f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1304,6 +1304,22 @@ "todo_id" => "String", "body" => "IncidentTodoPatchRequest", }, + "v2.ListAWSAccounts" => { + "aws_account_id" => "String", + }, + "v2.CreateAWSAccount" => { + "body" => "AWSAccountCreateRequest", + }, + "v2.DeleteAWSAccount" => { + "aws_account_config_id" => "String", + }, + "v2.GetAWSAccount" => { + "aws_account_config_id" => "String", + }, + "v2.UpdateAWSAccount" => { + "aws_account_config_id" => "String", + "body" => "AWSAccountPatchRequest", + }, "v2.CreateGCPSTSAccount" => { "body" => "GCPSTSServiceAccountCreateRequest", }, diff --git a/features/v1/aws_integration.feature b/features/v1/aws_integration.feature index 017326abd32f..08c57bbc61eb 100644 --- a/features/v1/aws_integration.feature +++ b/features/v1/aws_integration.feature @@ -9,70 +9,70 @@ Feature: AWS Integration And a valid "appKeyAuth" key in the system And an instance of "AWSIntegration" API - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Bad Request" response Given new "CreateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Conflict Error" response Given new "CreateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "OK" response Given new "CreateAWSAccount" request And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an Amazon EventBridge source returns "Bad Request" response Given new "CreateAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an Amazon EventBridge source returns "OK" response Given new "CreateAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete a tag filtering entry returns "Bad Request" response Given new "DeleteAWSTagFilter" request And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete a tag filtering entry returns "OK" response Given new "DeleteAWSTagFilter" request And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Conflict Error" response Given new "DeleteAWSAccount" request And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "OK" response Given there is a valid "aws_account" in the system And new "DeleteAWSAccount" request @@ -80,107 +80,107 @@ Feature: AWS Integration When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an Amazon EventBridge source returns "Bad Request" response Given new "DeleteAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an Amazon EventBridge source returns "OK" response Given new "DeleteAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Generate a new external ID returns "Bad Request" response Given new "CreateNewAWSExternalID" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Generate a new external ID returns "OK" response Given new "CreateNewAWSExternalID" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all AWS tag filters returns "Bad Request" response Given new "ListAWSTagFilters" request And request contains "account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all AWS tag filters returns "OK" response Given new "ListAWSTagFilters" request And request contains "account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all Amazon EventBridge sources returns "Bad Request" response Given new "ListAWSEventBridgeSources" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all Amazon EventBridge sources returns "OK" response Given new "ListAWSEventBridgeSources" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS integrations returns "Bad Request" response Given new "ListAWSAccounts" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS integrations returns "OK" response Given new "ListAWSAccounts" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List namespace rules returns "OK" response Given new "ListAvailableAWSNamespaces" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Set an AWS tag filter returns "Bad Request" response Given new "CreateAWSTagFilter" request And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Set an AWS tag filter returns "OK" response Given new "CreateAWSTagFilter" request And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "Bad Request" response Given new "UpdateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "Conflict Error" response Given new "UpdateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "OK" response Given there is a valid "aws_account" in the system And new "UpdateAWSAccount" request diff --git a/features/v1/aws_logs_integration.feature b/features/v1/aws_logs_integration.feature index 5459cbb79478..622d8d7debac 100644 --- a/features/v1/aws_logs_integration.feature +++ b/features/v1/aws_logs_integration.feature @@ -10,89 +10,89 @@ Feature: AWS Logs Integration And a valid "appKeyAuth" key in the system And an instance of "AWSLogsIntegration" API - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Add AWS Log Lambda ARN returns "Bad Request" response Given new "CreateAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Add AWS Log Lambda ARN returns "OK" response Given new "CreateAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check permissions for log services returns "Bad Request" response Given new "CheckAWSLogsServicesAsync" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check permissions for log services returns "OK" response Given new "CheckAWSLogsServicesAsync" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check that an AWS Lambda Function exists returns "Bad Request" response Given new "CheckAWSLogsLambdaAsync" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check that an AWS Lambda Function exists returns "OK" response Given new "CheckAWSLogsLambdaAsync" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS Logs integration returns "Bad Request" response Given new "DeleteAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS Logs integration returns "OK" response Given new "DeleteAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Enable an AWS Logs integration returns "Bad Request" response Given new "EnableAWSLogServices" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Enable an AWS Logs integration returns "OK" response Given new "EnableAWSLogServices" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get list of AWS log ready services returns "OK" response Given new "ListAWSLogsServices" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS Logs integrations returns "Bad Request" response Given new "ListAWSLogsIntegrations" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS Logs integrations returns "OK" response Given new "ListAWSLogsIntegrations" request When the request is sent diff --git a/features/v2/aws_integration.feature b/features/v2/aws_integration.feature new file mode 100644 index 000000000000..637b09a13bad --- /dev/null +++ b/features/v2/aws_integration.feature @@ -0,0 +1,141 @@ +@endpoint(aws-integration) @endpoint(aws-integration-v2) +Feature: AWS Integration + Configure your Datadog-AWS integration directly through the Datadog API. + For more information, see the [AWS integration + page](https://docs.datadoghq.com/integrations/amazon_web_services). + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AWSIntegration" API + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Create account config returns "AWS Account object" response + Given operation "CreateAWSAccount" enabled + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Create account config returns "Bad Request" response + Given operation "CreateAWSAccount" enabled + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Create account config returns "Conflict" response + Given operation "CreateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Delete account config returns "Bad Request" response + Given operation "DeleteAWSAccount" enabled + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter with value "not-a-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Delete account config returns "No Content" response + Given operation "DeleteAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Delete account config returns "Not Found" response + Given operation "DeleteAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Generate new external ID returns "AWS External ID object" response + Given operation "GenerateNewExternalID" enabled + And new "GenerateNewExternalID" request + When the request is sent + Then the response status is 200 AWS External ID object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Get account config returns "AWS Account object" response + Given operation "GetAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Get account config returns "Bad Request" response + Given operation "GetAWSAccount" enabled + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter with value "not-a-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Get account config returns "Not Found" response + Given operation "GetAWSAccount" enabled + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Get all account configs returns "AWS Accounts List object" response + Given operation "ListAWSAccounts" enabled + And new "ListAWSAccounts" request + When the request is sent + Then the response status is 200 AWS Accounts List object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - List log services returns "AWS Logs Services List object" response + Given new "ListAWSLogServices" request + When the request is sent + Then the response status is 200 AWS Logs Services List object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - List namespaces returns "AWS Namespaces List object" response + Given new "ListAWSNamespaces" request + When the request is sent + Then the response status is 200 AWS Namespaces List object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Patch account config returns "AWS Account object" response + Given operation "UpdateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Patch account config returns "Bad Request" response + Given operation "UpdateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: AWS Integration - Patch account config returns "Not Found" response + Given operation "UpdateAWSAccount" enabled + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/features/v2/given.json b/features/v2/given.json index efc7bed91b5b..d0966217f24b 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -200,6 +200,18 @@ "tag": "Incidents", "operationId": "CreateIncidentTodo" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"id\": \"00000000-abcd-0001-0000-000000000000\",\n \"type\": \"account\",\n \"attributes\": {\n \"account_tags\": [\n \"key:value\"\n ],\n \"auth_config\": {\n \"role_name\": \"DatadogIntegrationRole\"\n },\n \"aws_account_id\": \"123456789012\",\n \"aws_partition\": \"aws\",\n \"aws_regions\": {\n \"include_only\": [\n \"us-east-1\"\n ]\n },\n \"logs_config\": {\n \"lambda_forwarder\": {\n \"lambdas\": [\n \"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"\n ],\n \"sources\": [\n \"s3\"\n ]\n }\n },\n \"metrics_config\": {\n \"enabled\": true,\n \"automute_enabled\": true,\n \"collect_custom_metrics\": false,\n \"collect_cloudwatch_alarms\": false,\n \"tag_filters\": [\n {\n \"namespace\": \"AWS/EC2\",\n \"tags\": [\n \"key:value\"\n ]\n }\n ],\n \"namespace_filters\": {\n \"include_only\": [\n \"AWS/EC2\"\n ]\n }\n },\n \"resources_config\": {\n \"cloud_security_posture_management_collection\": false,\n \"extended_collection\": false\n },\n \"traces_config\": {\n \"xray_services\": {\n \"include_only\": [\n \"AWS/AppSync\"\n ]\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"aws_account_v2\" in the system", + "key": "aws_account_v2", + "tag": "AWS Integration", + "operationId": "CreateAWSAccount" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 62da7c99ef99..eb57793abe36 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -745,6 +745,61 @@ "type": "idempotent" } }, + "ListAWSAccounts": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateAWSAccount": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSAccount", + "parameters": [ + { + "name": "aws_account_config_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "GetAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "UpdateAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "GenerateNewExternalID": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "ListAWSLogServices": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "ListAWSNamespaces": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, "ListGCPSTSAccounts": { "tag": "GCP Integration", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7ceada3185b5..5a07433568f1 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -216,6 +216,12 @@ def initialize "v2.update_incident_attachments": false, "v2.update_incident_integration": false, "v2.update_incident_todo": false, + "v2.create_aws_account": false, + "v2.delete_aws_account": false, + "v2.generate_new_external_id": false, + "v2.get_aws_account": false, + "v2.list_aws_accounts": false, + "v2.update_aws_account": false, "v2.query_scalar_data": false, "v2.query_timeseries_data": false, "v2.get_finding": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7b073d1fb095..cdcf9544e960 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -969,6 +969,20 @@ def overrides "v2.authn_mapping_update_data" => "AuthNMappingUpdateData", "v2.authn_mapping_update_relationships" => "AuthNMappingUpdateRelationships", "v2.authn_mapping_update_request" => "AuthNMappingUpdateRequest", + "v2.aws_account_create_request" => "AWSAccountCreateRequest", + "v2.aws_account_create_request_attributes" => "AWSAccountCreateRequestAttributes", + "v2.aws_account_create_request_data" => "AWSAccountCreateRequestData", + "v2.aws_account_partition" => "AWSAccountPartition", + "v2.aws_account_patch_request" => "AWSAccountPatchRequest", + "v2.aws_account_patch_request_attributes" => "AWSAccountPatchRequestAttributes", + "v2.aws_account_patch_request_data" => "AWSAccountPatchRequestData", + "v2.aws_account_response" => "AWSAccountResponse", + "v2.aws_account_response_attributes" => "AWSAccountResponseAttributes", + "v2.aws_account_response_data" => "AWSAccountResponseData", + "v2.aws_accounts_response" => "AWSAccountsResponse", + "v2.aws_auth_config" => "AWSAuthConfig", + "v2.aws_auth_config_keys" => "AWSAuthConfigKeys", + "v2.aws_auth_config_role" => "AWSAuthConfigRole", "v2.aws_cur_config" => "AwsCURConfig", "v2.aws_cur_config_attributes" => "AwsCURConfigAttributes", "v2.aws_cur_config_patch_data" => "AwsCURConfigPatchData", @@ -982,10 +996,33 @@ def overrides "v2.aws_cur_config_response" => "AwsCURConfigResponse", "v2.aws_cur_configs_response" => "AwsCURConfigsResponse", "v2.aws_cur_config_type" => "AwsCURConfigType", + "v2.aws_lambda_forwarder_config" => "AWSLambdaForwarderConfig", + "v2.aws_logs_config" => "AWSLogsConfig", + "v2.aws_logs_services_response" => "AWSLogsServicesResponse", + "v2.aws_logs_services_response_attributes" => "AWSLogsServicesResponseAttributes", + "v2.aws_logs_services_response_data" => "AWSLogsServicesResponseData", + "v2.aws_metrics_config" => "AWSMetricsConfig", + "v2.aws_namespace_filters" => "AWSNamespaceFilters", + "v2.aws_namespace_filters_exclude_all" => "AWSNamespaceFiltersExcludeAll", + "v2.aws_namespace_filters_exclude_only" => "AWSNamespaceFiltersExcludeOnly", + "v2.aws_namespace_filters_include_all" => "AWSNamespaceFiltersIncludeAll", + "v2.aws_namespace_filters_include_only" => "AWSNamespaceFiltersIncludeOnly", + "v2.aws_namespaces_response" => "AWSNamespacesResponse", + "v2.aws_namespaces_response_attributes" => "AWSNamespacesResponseAttributes", + "v2.aws_namespaces_response_data" => "AWSNamespacesResponseData", + "v2.aws_namespace_tag_filter" => "AWSNamespaceTagFilter", + "v2.aws_new_external_id_response" => "AWSNewExternalIDResponse", + "v2.aws_new_external_id_response_attributes" => "AWSNewExternalIDResponseAttributes", + "v2.aws_new_external_id_response_data" => "AWSNewExternalIDResponseData", + "v2.aws_regions" => "AWSRegions", + "v2.aws_regions_include_all" => "AWSRegionsIncludeAll", + "v2.aws_regions_include_only" => "AWSRegionsIncludeOnly", "v2.aws_related_account" => "AWSRelatedAccount", "v2.aws_related_account_attributes" => "AWSRelatedAccountAttributes", "v2.aws_related_accounts_response" => "AWSRelatedAccountsResponse", "v2.aws_related_account_type" => "AWSRelatedAccountType", + "v2.aws_resources_config" => "AWSResourcesConfig", + "v2.aws_traces_config" => "AWSTracesConfig", "v2.azure_uc_config" => "AzureUCConfig", "v2.azure_uc_config_pair" => "AzureUCConfigPair", "v2.azure_uc_config_pair_attributes" => "AzureUCConfigPairAttributes", @@ -2519,6 +2556,9 @@ def overrides "v2.worklflow_get_instance_response" => "WorklflowGetInstanceResponse", "v2.worklflow_get_instance_response_data" => "WorklflowGetInstanceResponseData", "v2.worklflow_get_instance_response_data_attributes" => "WorklflowGetInstanceResponseDataAttributes", + "v2.x_ray_services_include_all" => "XRayServicesIncludeAll", + "v2.x_ray_services_include_only" => "XRayServicesIncludeOnly", + "v2.x_ray_services_list" => "XRayServicesList", # APIs "v1.authentication_api" => "AuthenticationAPI", "v1.aws_integration_api" => "AWSIntegrationAPI", @@ -2555,6 +2595,7 @@ def overrides "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", "v2.audit_api" => "AuditAPI", "v2.authn_mappings_api" => "AuthNMappingsAPI", + "v2.aws_integration_api" => "AWSIntegrationAPI", "v2.case_management_api" => "CaseManagementAPI", "v2.ci_visibility_pipelines_api" => "CIVisibilityPipelinesAPI", "v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI", diff --git a/lib/datadog_api_client/v2/api/aws_integration_api.rb b/lib/datadog_api_client/v2/api/aws_integration_api.rb new file mode 100644 index 000000000000..d5317f36e156 --- /dev/null +++ b/lib/datadog_api_client/v2/api/aws_integration_api.rb @@ -0,0 +1,573 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class AWSIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # AWS Integration - Create account config. + # + # @see #create_aws_account_with_http_info + def create_aws_account(body, opts = {}) + data, _status_code, _headers = create_aws_account_with_http_info(body, opts) + data + end + + # AWS Integration - Create account config. + # + # Create a new AWS Account Integration Config. + # + # @param body [AWSAccountCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AWSAccountResponse, Integer, Hash)>] AWSAccountResponse data, response status code and response headers + def create_aws_account_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_aws_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_aws_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_aws_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.create_aws_account ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AWSIntegrationAPI.create_aws_account" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AWSAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_aws_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#create_aws_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - Delete account config. + # + # @see #delete_aws_account_with_http_info + def delete_aws_account(aws_account_config_id, opts = {}) + delete_aws_account_with_http_info(aws_account_config_id, opts) + nil + end + + # AWS Integration - Delete account config. + # + # Delete an AWS Account Integration Config + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_aws_account_with_http_info(aws_account_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_aws_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_aws_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_aws_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.delete_aws_account ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.delete_aws_account" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_aws_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#delete_aws_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - Generate new external ID. + # + # @see #generate_new_external_id_with_http_info + def generate_new_external_id(opts = {}) + data, _status_code, _headers = generate_new_external_id_with_http_info(opts) + data + end + + # AWS Integration - Generate new external ID. + # + # Generate a new external ID for AWS role-based authentication. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AWSNewExternalIDResponse, Integer, Hash)>] AWSNewExternalIDResponse data, response status code and response headers + def generate_new_external_id_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.generate_new_external_id".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.generate_new_external_id") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.generate_new_external_id")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.generate_new_external_id ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/generate_new_external_id' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSNewExternalIDResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :generate_new_external_id, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#generate_new_external_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - Get account config. + # + # @see #get_aws_account_with_http_info + def get_aws_account(aws_account_config_id, opts = {}) + data, _status_code, _headers = get_aws_account_with_http_info(aws_account_config_id, opts) + data + end + + # AWS Integration - Get account config. + # + # Get an AWS Account Integration Config + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config + # @param opts [Hash] the optional parameters + # @return [Array<(AWSAccountResponse, Integer, Hash)>] AWSAccountResponse data, response status code and response headers + def get_aws_account_with_http_info(aws_account_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_aws_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_aws_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_aws_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.get_aws_account ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.get_aws_account" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_aws_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#get_aws_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - Get all account configs. + # + # @see #list_aws_accounts_with_http_info + def list_aws_accounts(opts = {}) + data, _status_code, _headers = list_aws_accounts_with_http_info(opts) + data + end + + # AWS Integration - Get all account configs. + # + # Get a list of AWS Account Integration Configs. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :aws_account_id + # @return [Array<(AWSAccountsResponse, Integer, Hash)>] AWSAccountsResponse data, response status code and response headers + def list_aws_accounts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_aws_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.list_aws_accounts ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'aws_account_id'] = opts[:'aws_account_id'] if !opts[:'aws_account_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_aws_accounts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#list_aws_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - List log services. + # + # @see #list_aws_log_services_with_http_info + def list_aws_log_services(opts = {}) + data, _status_code, _headers = list_aws_log_services_with_http_info(opts) + data + end + + # AWS Integration - List log services. + # + # Get a list of AWS services that can send logs to Datadog. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AWSLogsServicesResponse, Integer, Hash)>] AWSLogsServicesResponse data, response status code and response headers + def list_aws_log_services_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.list_aws_log_services ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/logs/services' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSLogsServicesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_aws_log_services, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#list_aws_log_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - List namespaces. + # + # @see #list_aws_namespaces_with_http_info + def list_aws_namespaces(opts = {}) + data, _status_code, _headers = list_aws_namespaces_with_http_info(opts) + data + end + + # AWS Integration - List namespaces. + # + # Get a list of AWS CloudWatch namespaces that can send metrics to Datadog. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AWSNamespacesResponse, Integer, Hash)>] AWSNamespacesResponse data, response status code and response headers + def list_aws_namespaces_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.list_aws_namespaces ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/namespaces' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSNamespacesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_aws_namespaces, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#list_aws_namespaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # AWS Integration - Patch account config. + # + # @see #update_aws_account_with_http_info + def update_aws_account(aws_account_config_id, body, opts = {}) + data, _status_code, _headers = update_aws_account_with_http_info(aws_account_config_id, body, opts) + data + end + + # AWS Integration - Patch account config. + # + # Update an AWS Account Integration Config + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config + # @param body [AWSAccountPatchRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AWSAccountResponse, Integer, Hash)>] AWSAccountResponse data, response status code and response headers + def update_aws_account_with_http_info(aws_account_config_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_aws_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_aws_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_aws_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.update_aws_account ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.update_aws_account" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AWSIntegrationAPI.update_aws_account" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AWSAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_aws_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#update_aws_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_create_request.rb b/lib/datadog_api_client/v2/models/aws_account_create_request.rb new file mode 100644 index 000000000000..c76372d5d15a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_create_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account Create Request body + class AWSAccountCreateRequest + include BaseGenericModel + + # AWS Account Create Request data + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSAccountCreateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb new file mode 100644 index 000000000000..14fe39f08c9d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb @@ -0,0 +1,235 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The AWS Account Integration Config to be created + class AWSAccountCreateRequestAttributes + include BaseGenericModel + + # Tags to apply to all metrics in the account + attr_accessor :account_tags + + # AWS Authentication config + attr_reader :auth_config + + # AWS Account ID + attr_reader :aws_account_id + + # AWS Account partition + attr_reader :aws_partition + + # AWS Regions to collect data from + attr_accessor :aws_regions + + # AWS Logs config + attr_accessor :logs_config + + # AWS Metrics config + attr_accessor :metrics_config + + # AWS Resources config + attr_accessor :resources_config + + # AWS Traces config + attr_accessor :traces_config + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_tags' => :'account_tags', + :'auth_config' => :'auth_config', + :'aws_account_id' => :'aws_account_id', + :'aws_partition' => :'aws_partition', + :'aws_regions' => :'aws_regions', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'resources_config' => :'resources_config', + :'traces_config' => :'traces_config' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_tags' => :'Array', + :'auth_config' => :'AWSAuthConfig', + :'aws_account_id' => :'String', + :'aws_partition' => :'AWSAccountPartition', + :'aws_regions' => :'AWSRegions', + :'logs_config' => :'AWSLogsConfig', + :'metrics_config' => :'AWSMetricsConfig', + :'resources_config' => :'AWSResourcesConfig', + :'traces_config' => :'AWSTracesConfig' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'account_tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_tags') + if (value = attributes[:'account_tags']).is_a?(Array) + self.account_tags = value + end + end + + if attributes.key?(:'auth_config') + self.auth_config = attributes[:'auth_config'] + end + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_partition') + self.aws_partition = attributes[:'aws_partition'] + end + + if attributes.key?(:'aws_regions') + self.aws_regions = attributes[:'aws_regions'] + end + + if attributes.key?(:'logs_config') + self.logs_config = attributes[:'logs_config'] + end + + if attributes.key?(:'metrics_config') + self.metrics_config = attributes[:'metrics_config'] + end + + if attributes.key?(:'resources_config') + self.resources_config = attributes[:'resources_config'] + end + + if attributes.key?(:'traces_config') + self.traces_config = attributes[:'traces_config'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @auth_config.nil? + return false if @aws_account_id.nil? + return false if @aws_partition.nil? + true + end + + # Custom attribute writer method with validation + # @param auth_config [Object] Object to be assigned + # @!visibility private + def auth_config=(auth_config) + if auth_config.nil? + fail ArgumentError, 'invalid value for "auth_config", auth_config cannot be nil.' + end + @auth_config = auth_config + end + + # Custom attribute writer method with validation + # @param aws_account_id [Object] Object to be assigned + # @!visibility private + def aws_account_id=(aws_account_id) + if aws_account_id.nil? + fail ArgumentError, 'invalid value for "aws_account_id", aws_account_id cannot be nil.' + end + @aws_account_id = aws_account_id + end + + # Custom attribute writer method with validation + # @param aws_partition [Object] Object to be assigned + # @!visibility private + def aws_partition=(aws_partition) + if aws_partition.nil? + fail ArgumentError, 'invalid value for "aws_partition", aws_partition cannot be nil.' + end + @aws_partition = aws_partition + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_tags == o.account_tags && + auth_config == o.auth_config && + aws_account_id == o.aws_account_id && + aws_partition == o.aws_partition && + aws_regions == o.aws_regions && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + resources_config == o.resources_config && + traces_config == o.traces_config + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, logs_config, metrics_config, resources_config, traces_config].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_create_request_data.rb b/lib/datadog_api_client/v2/models/aws_account_create_request_data.rb new file mode 100644 index 000000000000..71ef08a5b35d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_create_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account Create Request data + class AWSAccountCreateRequestData + include BaseGenericModel + + # The AWS Account Integration Config to be created + attr_reader :attributes + + # AWS Account resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSAccountCreateRequestAttributes', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountCreateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_partition.rb b/lib/datadog_api_client/v2/models/aws_account_partition.rb new file mode 100644 index 000000000000..81722f2246c2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_partition.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account partition + class AWSAccountPartition + include BaseEnumModel + + AWS = "aws".freeze + AWS_CN = "aws-cn".freeze + AWS_US_GOV = "aws-us-gov".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_patch_request.rb b/lib/datadog_api_client/v2/models/aws_account_patch_request.rb new file mode 100644 index 000000000000..02dbae915753 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_patch_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account Patch Request body + class AWSAccountPatchRequest + include BaseGenericModel + + # AWS Account Patch Request data + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSAccountPatchRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_patch_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_patch_request_attributes.rb new file mode 100644 index 000000000000..3130c9d58b94 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_patch_request_attributes.rb @@ -0,0 +1,213 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The AWS Account Integration Config to be updated + class AWSAccountPatchRequestAttributes + include BaseGenericModel + + # Tags to apply to all metrics in the account + attr_accessor :account_tags + + # AWS Authentication config + attr_accessor :auth_config + + # AWS Account ID + attr_reader :aws_account_id + + # AWS Account partition + attr_accessor :aws_partition + + # AWS Regions to collect data from + attr_accessor :aws_regions + + # AWS Logs config + attr_accessor :logs_config + + # AWS Metrics config + attr_accessor :metrics_config + + # AWS Resources config + attr_accessor :resources_config + + # AWS Traces config + attr_accessor :traces_config + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_tags' => :'account_tags', + :'auth_config' => :'auth_config', + :'aws_account_id' => :'aws_account_id', + :'aws_partition' => :'aws_partition', + :'aws_regions' => :'aws_regions', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'resources_config' => :'resources_config', + :'traces_config' => :'traces_config' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_tags' => :'Array', + :'auth_config' => :'AWSAuthConfig', + :'aws_account_id' => :'String', + :'aws_partition' => :'AWSAccountPartition', + :'aws_regions' => :'AWSRegions', + :'logs_config' => :'AWSLogsConfig', + :'metrics_config' => :'AWSMetricsConfig', + :'resources_config' => :'AWSResourcesConfig', + :'traces_config' => :'AWSTracesConfig' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'account_tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountPatchRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_tags') + if (value = attributes[:'account_tags']).is_a?(Array) + self.account_tags = value + end + end + + if attributes.key?(:'auth_config') + self.auth_config = attributes[:'auth_config'] + end + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_partition') + self.aws_partition = attributes[:'aws_partition'] + end + + if attributes.key?(:'aws_regions') + self.aws_regions = attributes[:'aws_regions'] + end + + if attributes.key?(:'logs_config') + self.logs_config = attributes[:'logs_config'] + end + + if attributes.key?(:'metrics_config') + self.metrics_config = attributes[:'metrics_config'] + end + + if attributes.key?(:'resources_config') + self.resources_config = attributes[:'resources_config'] + end + + if attributes.key?(:'traces_config') + self.traces_config = attributes[:'traces_config'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @aws_account_id.nil? + true + end + + # Custom attribute writer method with validation + # @param aws_account_id [Object] Object to be assigned + # @!visibility private + def aws_account_id=(aws_account_id) + if aws_account_id.nil? + fail ArgumentError, 'invalid value for "aws_account_id", aws_account_id cannot be nil.' + end + @aws_account_id = aws_account_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_tags == o.account_tags && + auth_config == o.auth_config && + aws_account_id == o.aws_account_id && + aws_partition == o.aws_partition && + aws_regions == o.aws_regions && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + resources_config == o.resources_config && + traces_config == o.traces_config + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, logs_config, metrics_config, resources_config, traces_config].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_patch_request_data.rb b/lib/datadog_api_client/v2/models/aws_account_patch_request_data.rb new file mode 100644 index 000000000000..ea86a3953933 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_patch_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account Patch Request data + class AWSAccountPatchRequestData + include BaseGenericModel + + # The AWS Account Integration Config to be updated + attr_reader :attributes + + # Unique Datadog ID of the AWS Account Integration Config + attr_accessor :id + + # AWS Account resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSAccountPatchRequestAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountPatchRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_response.rb b/lib/datadog_api_client/v2/models/aws_account_response.rb new file mode 100644 index 000000000000..0c49d3b3e611 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account response body + class AWSAccountResponse + include BaseGenericModel + + # AWS Account Response body + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSAccountResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb new file mode 100644 index 000000000000..9a1f2ba8b1e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb @@ -0,0 +1,255 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The AWS Account Integration Config + class AWSAccountResponseAttributes + include BaseGenericModel + + # Tags to apply to all metrics in the account + attr_accessor :account_tags + + # AWS Authentication config + attr_reader :auth_config + + # AWS Account ID + attr_reader :aws_account_id + + # AWS Account partition + attr_reader :aws_partition + + # AWS Regions to collect data from + attr_accessor :aws_regions + + # Timestamp of when the account integration was created + attr_accessor :created_at + + # AWS Logs config + attr_accessor :logs_config + + # AWS Metrics config + attr_accessor :metrics_config + + # Timestamp of when the account integration was updated + attr_accessor :modified_at + + # AWS Resources config + attr_accessor :resources_config + + # AWS Traces config + attr_accessor :traces_config + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_tags' => :'account_tags', + :'auth_config' => :'auth_config', + :'aws_account_id' => :'aws_account_id', + :'aws_partition' => :'aws_partition', + :'aws_regions' => :'aws_regions', + :'created_at' => :'created_at', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'modified_at' => :'modified_at', + :'resources_config' => :'resources_config', + :'traces_config' => :'traces_config' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_tags' => :'Array', + :'auth_config' => :'AWSAuthConfig', + :'aws_account_id' => :'String', + :'aws_partition' => :'AWSAccountPartition', + :'aws_regions' => :'AWSRegions', + :'created_at' => :'Time', + :'logs_config' => :'AWSLogsConfig', + :'metrics_config' => :'AWSMetricsConfig', + :'modified_at' => :'Time', + :'resources_config' => :'AWSResourcesConfig', + :'traces_config' => :'AWSTracesConfig' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'account_tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_tags') + if (value = attributes[:'account_tags']).is_a?(Array) + self.account_tags = value + end + end + + if attributes.key?(:'auth_config') + self.auth_config = attributes[:'auth_config'] + end + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_partition') + self.aws_partition = attributes[:'aws_partition'] + end + + if attributes.key?(:'aws_regions') + self.aws_regions = attributes[:'aws_regions'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'logs_config') + self.logs_config = attributes[:'logs_config'] + end + + if attributes.key?(:'metrics_config') + self.metrics_config = attributes[:'metrics_config'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'resources_config') + self.resources_config = attributes[:'resources_config'] + end + + if attributes.key?(:'traces_config') + self.traces_config = attributes[:'traces_config'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @auth_config.nil? + return false if @aws_account_id.nil? + return false if @aws_partition.nil? + true + end + + # Custom attribute writer method with validation + # @param auth_config [Object] Object to be assigned + # @!visibility private + def auth_config=(auth_config) + if auth_config.nil? + fail ArgumentError, 'invalid value for "auth_config", auth_config cannot be nil.' + end + @auth_config = auth_config + end + + # Custom attribute writer method with validation + # @param aws_account_id [Object] Object to be assigned + # @!visibility private + def aws_account_id=(aws_account_id) + if aws_account_id.nil? + fail ArgumentError, 'invalid value for "aws_account_id", aws_account_id cannot be nil.' + end + @aws_account_id = aws_account_id + end + + # Custom attribute writer method with validation + # @param aws_partition [Object] Object to be assigned + # @!visibility private + def aws_partition=(aws_partition) + if aws_partition.nil? + fail ArgumentError, 'invalid value for "aws_partition", aws_partition cannot be nil.' + end + @aws_partition = aws_partition + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_tags == o.account_tags && + auth_config == o.auth_config && + aws_account_id == o.aws_account_id && + aws_partition == o.aws_partition && + aws_regions == o.aws_regions && + created_at == o.created_at && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + modified_at == o.modified_at && + resources_config == o.resources_config && + traces_config == o.traces_config + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, created_at, logs_config, metrics_config, modified_at, resources_config, traces_config].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_response_data.rb b/lib/datadog_api_client/v2/models/aws_account_response_data.rb new file mode 100644 index 000000000000..ca53718d405c --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Account Response body + class AWSAccountResponseData + include BaseGenericModel + + # The AWS Account Integration Config + attr_reader :attributes + + # Unique Datadog ID of the AWS Account Integration Config + attr_reader :id + + # AWS Account resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSAccountResponseAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_accounts_response.rb b/lib/datadog_api_client/v2/models/aws_accounts_response.rb new file mode 100644 index 000000000000..84a24af9ade0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_accounts_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Accounts response body + class AWSAccountsResponse + include BaseGenericModel + + # List of AWS Account Integration Configs + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAccountsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_auth_config.rb b/lib/datadog_api_client/v2/models/aws_auth_config.rb new file mode 100644 index 000000000000..98f84cae807a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_auth_config.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Authentication config + module AWSAuthConfig + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AWSAuthConfigKeys', + :'AWSAuthConfigRole' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_auth_config_keys.rb b/lib/datadog_api_client/v2/models/aws_auth_config_keys.rb new file mode 100644 index 000000000000..5355bb02ad07 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_auth_config_keys.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Authentication config for key-based account + class AWSAuthConfigKeys + include BaseGenericModel + + # AWS Access Key ID + attr_reader :access_key_id + + # AWS Secret Access Key + attr_reader :secret_access_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_key_id' => :'access_key_id', + :'secret_access_key' => :'secret_access_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_key_id' => :'String', + :'secret_access_key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAuthConfigKeys` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'access_key_id') + self.access_key_id = attributes[:'access_key_id'] + end + + if attributes.key?(:'secret_access_key') + self.secret_access_key = attributes[:'secret_access_key'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @access_key_id.nil? + return false if !@secret_access_key.nil? && @secret_access_key.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param access_key_id [Object] Object to be assigned + # @!visibility private + def access_key_id=(access_key_id) + if access_key_id.nil? + fail ArgumentError, 'invalid value for "access_key_id", access_key_id cannot be nil.' + end + @access_key_id = access_key_id + end + + # Custom attribute writer method with validation + # @param secret_access_key [Object] Object to be assigned + # @!visibility private + def secret_access_key=(secret_access_key) + if !secret_access_key.nil? && secret_access_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "secret_access_key", the character length must be great than or equal to 1.' + end + @secret_access_key = secret_access_key + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + access_key_id == o.access_key_id && + secret_access_key == o.secret_access_key + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_key_id, secret_access_key].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_auth_config_role.rb b/lib/datadog_api_client/v2/models/aws_auth_config_role.rb new file mode 100644 index 000000000000..5534067348f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_auth_config_role.rb @@ -0,0 +1,141 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Authentication config for role-based account + class AWSAuthConfigRole + include BaseGenericModel + + # AWS IAM External ID for associated role + attr_accessor :external_id + + # AWS IAM Role name + attr_reader :role_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'external_id' => :'external_id', + :'role_name' => :'role_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'external_id' => :'String', + :'role_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSAuthConfigRole` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + + if attributes.key?(:'role_name') + self.role_name = attributes[:'role_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @role_name.nil? + return false if @role_name.to_s.length > 576 + return false if @role_name.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param role_name [Object] Object to be assigned + # @!visibility private + def role_name=(role_name) + if role_name.nil? + fail ArgumentError, 'invalid value for "role_name", role_name cannot be nil.' + end + if role_name.to_s.length > 576 + fail ArgumentError, 'invalid value for "role_name", the character length must be smaller than or equal to 576.' + end + if role_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "role_name", the character length must be great than or equal to 1.' + end + @role_name = role_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + external_id == o.external_id && + role_name == o.role_name + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [external_id, role_name].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb b/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb new file mode 100644 index 000000000000..ec4dfcf78e6a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Lambda forwarder + class AWSLambdaForwarderConfig + include BaseGenericModel + + # List of Datadog Lambda Log Forwarder ARNs + attr_accessor :lambdas + + # List of AWS services that will send logs to the Datadog Lambda Log Forwarder + attr_accessor :sources + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'lambdas' => :'lambdas', + :'sources' => :'sources' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'lambdas' => :'Array', + :'sources' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSLambdaForwarderConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'lambdas') + if (value = attributes[:'lambdas']).is_a?(Array) + self.lambdas = value + end + end + + if attributes.key?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lambdas == o.lambdas && + sources == o.sources + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [lambdas, sources].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_logs_config.rb b/lib/datadog_api_client/v2/models/aws_logs_config.rb new file mode 100644 index 000000000000..06bc6791cbb1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_config.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Logs config + class AWSLogsConfig + include BaseGenericModel + + # AWS Lambda forwarder + attr_accessor :lambda_forwarder + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'lambda_forwarder' => :'lambda_forwarder' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'lambda_forwarder' => :'AWSLambdaForwarderConfig' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSLogsConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'lambda_forwarder') + self.lambda_forwarder = attributes[:'lambda_forwarder'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lambda_forwarder == o.lambda_forwarder + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [lambda_forwarder].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_logs_services_response.rb b/lib/datadog_api_client/v2/models/aws_logs_services_response.rb new file mode 100644 index 000000000000..ad1b6ea0f6a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Logs Services response body + class AWSLogsServicesResponse + include BaseGenericModel + + # AWS Logs Services response body + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSLogsServicesResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSLogsServicesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_logs_services_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_logs_services_response_attributes.rb new file mode 100644 index 000000000000..50373b199e29 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Logs Services response body + class AWSLogsServicesResponseAttributes + include BaseGenericModel + + # List of AWS services that can send logs to Datadog + attr_accessor :logs_services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'logs_services' => :'logs_services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'logs_services' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSLogsServicesResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'logs_services') + if (value = attributes[:'logs_services']).is_a?(Array) + self.logs_services = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + logs_services == o.logs_services + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [logs_services].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_logs_services_response_data.rb b/lib/datadog_api_client/v2/models/aws_logs_services_response_data.rb new file mode 100644 index 000000000000..34a9b5be5d89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Logs Services response body + class AWSLogsServicesResponseData + include BaseGenericModel + + # AWS Logs Services response body + attr_accessor :attributes + + # The `AWSLogsServicesResponseData` `id`. + attr_accessor :id + + # The `AWSLogsServicesResponseData` `type`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSLogsServicesResponseAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSLogsServicesResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_metrics_config.rb b/lib/datadog_api_client/v2/models/aws_metrics_config.rb new file mode 100644 index 000000000000..a84700b80bfb --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_metrics_config.rb @@ -0,0 +1,157 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Metrics config + class AWSMetricsConfig + include BaseGenericModel + + # Enable EC2 automute for AWS metrics + attr_accessor :automute_enabled + + # Enable CloudWatch alarms collection + attr_accessor :collect_cloudwatch_alarms + + # Enable custom metrics collection + attr_accessor :collect_custom_metrics + + # Enable AWS metrics collection + attr_accessor :enabled + + # AWS Metrics namespace filters + attr_accessor :namespace_filters + + # AWS Metrics tag filters list + attr_accessor :tag_filters + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'automute_enabled' => :'automute_enabled', + :'collect_cloudwatch_alarms' => :'collect_cloudwatch_alarms', + :'collect_custom_metrics' => :'collect_custom_metrics', + :'enabled' => :'enabled', + :'namespace_filters' => :'namespace_filters', + :'tag_filters' => :'tag_filters' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'automute_enabled' => :'Boolean', + :'collect_cloudwatch_alarms' => :'Boolean', + :'collect_custom_metrics' => :'Boolean', + :'enabled' => :'Boolean', + :'namespace_filters' => :'AWSNamespaceFilters', + :'tag_filters' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSMetricsConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'automute_enabled') + self.automute_enabled = attributes[:'automute_enabled'] + end + + if attributes.key?(:'collect_cloudwatch_alarms') + self.collect_cloudwatch_alarms = attributes[:'collect_cloudwatch_alarms'] + end + + if attributes.key?(:'collect_custom_metrics') + self.collect_custom_metrics = attributes[:'collect_custom_metrics'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'namespace_filters') + self.namespace_filters = attributes[:'namespace_filters'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + automute_enabled == o.automute_enabled && + collect_cloudwatch_alarms == o.collect_cloudwatch_alarms && + collect_custom_metrics == o.collect_custom_metrics && + enabled == o.enabled && + namespace_filters == o.namespace_filters && + tag_filters == o.tag_filters + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [automute_enabled, collect_cloudwatch_alarms, collect_custom_metrics, enabled, namespace_filters, tag_filters].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters.rb new file mode 100644 index 000000000000..139549c27af9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters.rb @@ -0,0 +1,65 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Metrics namespace filters + module AWSNamespaceFilters + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AWSNamespaceFiltersExcludeAll', + :'AWSNamespaceFiltersExcludeOnly', + :'AWSNamespaceFiltersIncludeAll', + :'AWSNamespaceFiltersIncludeOnly' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_all.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_all.rb new file mode 100644 index 000000000000..a70a1dc6a383 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_all.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Exclude all namespaces + class AWSNamespaceFiltersExcludeAll + include BaseGenericModel + + # Exclude all namespaces + attr_reader :exclude_all + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'exclude_all' => :'exclude_all' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'exclude_all' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespaceFiltersExcludeAll` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'exclude_all') + self.exclude_all = attributes[:'exclude_all'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @exclude_all.nil? + true + end + + # Custom attribute writer method with validation + # @param exclude_all [Object] Object to be assigned + # @!visibility private + def exclude_all=(exclude_all) + if exclude_all.nil? + fail ArgumentError, 'invalid value for "exclude_all", exclude_all cannot be nil.' + end + @exclude_all = exclude_all + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + exclude_all == o.exclude_all + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [exclude_all].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb new file mode 100644 index 000000000000..63ae62ff982d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Exclude only these namespaces + class AWSNamespaceFiltersExcludeOnly + include BaseGenericModel + + # Exclude only these namespaces + attr_reader :exclude_only + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'exclude_only' => :'exclude_only' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'exclude_only' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespaceFiltersExcludeOnly` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'exclude_only') + if (value = attributes[:'exclude_only']).is_a?(Array) + self.exclude_only = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @exclude_only.nil? + true + end + + # Custom attribute writer method with validation + # @param exclude_only [Object] Object to be assigned + # @!visibility private + def exclude_only=(exclude_only) + if exclude_only.nil? + fail ArgumentError, 'invalid value for "exclude_only", exclude_only cannot be nil.' + end + @exclude_only = exclude_only + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + exclude_only == o.exclude_only + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [exclude_only].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters_include_all.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters_include_all.rb new file mode 100644 index 000000000000..40f3e160dc42 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters_include_all.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include all namespaces + class AWSNamespaceFiltersIncludeAll + include BaseGenericModel + + # Include all namespaces + attr_reader :include_all + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_all' => :'include_all' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_all' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespaceFiltersIncludeAll` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_all') + self.include_all = attributes[:'include_all'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_all.nil? + true + end + + # Custom attribute writer method with validation + # @param include_all [Object] Object to be assigned + # @!visibility private + def include_all=(include_all) + if include_all.nil? + fail ArgumentError, 'invalid value for "include_all", include_all cannot be nil.' + end + @include_all = include_all + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_all == o.include_all + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_all].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters_include_only.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters_include_only.rb new file mode 100644 index 000000000000..083ba69953db --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters_include_only.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include only these namespaces + class AWSNamespaceFiltersIncludeOnly + include BaseGenericModel + + # Include only these namespaces + attr_reader :include_only + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_only' => :'include_only' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_only' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespaceFiltersIncludeOnly` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_only') + if (value = attributes[:'include_only']).is_a?(Array) + self.include_only = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_only.nil? + true + end + + # Custom attribute writer method with validation + # @param include_only [Object] Object to be assigned + # @!visibility private + def include_only=(include_only) + if include_only.nil? + fail ArgumentError, 'invalid value for "include_only", include_only cannot be nil.' + end + @include_only = include_only + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_only == o.include_only + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_only].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb b/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb new file mode 100644 index 000000000000..b8492981f4b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Metrics tag filters + class AWSNamespaceTagFilter + include BaseGenericModel + + # The AWS Namespace to apply the tag filters against + attr_accessor :namespace + + # The tags to filter based on + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'namespace' => :'namespace', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'namespace' => :'String', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespaceTagFilter` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'namespace') + self.namespace = attributes[:'namespace'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + namespace == o.namespace && + tags == o.tags + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [namespace, tags].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespaces_response.rb b/lib/datadog_api_client/v2/models/aws_namespaces_response.rb new file mode 100644 index 000000000000..9d44a3d8cb1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Namespaces response body + class AWSNamespacesResponse + include BaseGenericModel + + # List of AWS CloudWatch namespaces that can send metrics to Datadog + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespacesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespaces_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_namespaces_response_attributes.rb new file mode 100644 index 000000000000..6e9f6bb81bbe --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Namespaces response body + class AWSNamespacesResponseAttributes + include BaseGenericModel + + # AWS CloudWatch namespace + attr_accessor :namespace + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'namespace' => :'namespace' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'namespace' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespacesResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'namespace') + self.namespace = attributes[:'namespace'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + namespace == o.namespace + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [namespace].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_namespaces_response_data.rb b/lib/datadog_api_client/v2/models/aws_namespaces_response_data.rb new file mode 100644 index 000000000000..c32bba29dadd --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Namespaces response body + class AWSNamespacesResponseData + include BaseGenericModel + + # AWS Namespaces response body + attr_accessor :attributes + + # Datadog ID of the AWS Namespace + attr_accessor :id + + # The `AWSNamespacesResponseData` `type`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSNamespacesResponseAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNamespacesResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_new_external_id_response.rb b/lib/datadog_api_client/v2/models/aws_new_external_id_response.rb new file mode 100644 index 000000000000..57337d549a67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS External ID response body + class AWSNewExternalIDResponse + include BaseGenericModel + + # AWS External ID response body + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSNewExternalIDResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNewExternalIDResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_new_external_id_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_new_external_id_response_attributes.rb new file mode 100644 index 000000000000..8eaa54441e55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS External ID response body + class AWSNewExternalIDResponseAttributes + include BaseGenericModel + + # AWS IAM External ID for associated role + attr_accessor :external_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'external_id' => :'external_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'external_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNewExternalIDResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + external_id == o.external_id + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [external_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_new_external_id_response_data.rb b/lib/datadog_api_client/v2/models/aws_new_external_id_response_data.rb new file mode 100644 index 000000000000..2589eba63e46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS External ID response body + class AWSNewExternalIDResponseData + include BaseGenericModel + + # AWS External ID response body + attr_accessor :attributes + + # The `AWSNewExternalIDResponseData` `id`. + attr_accessor :id + + # The `AWSNewExternalIDResponseData` `type`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSNewExternalIDResponseAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSNewExternalIDResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_regions.rb b/lib/datadog_api_client/v2/models/aws_regions.rb new file mode 100644 index 000000000000..2d6e0ec116e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_regions.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Regions to collect data from + module AWSRegions + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AWSRegionsIncludeAll', + :'AWSRegionsIncludeOnly' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_regions_include_all.rb b/lib/datadog_api_client/v2/models/aws_regions_include_all.rb new file mode 100644 index 000000000000..2a432540613a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_regions_include_all.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include all regions + class AWSRegionsIncludeAll + include BaseGenericModel + + # Include all regions + attr_reader :include_all + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_all' => :'include_all' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_all' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSRegionsIncludeAll` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_all') + self.include_all = attributes[:'include_all'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_all.nil? + true + end + + # Custom attribute writer method with validation + # @param include_all [Object] Object to be assigned + # @!visibility private + def include_all=(include_all) + if include_all.nil? + fail ArgumentError, 'invalid value for "include_all", include_all cannot be nil.' + end + @include_all = include_all + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_all == o.include_all + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_all].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_regions_include_only.rb b/lib/datadog_api_client/v2/models/aws_regions_include_only.rb new file mode 100644 index 000000000000..62f002bcd1a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_regions_include_only.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include only these regions + class AWSRegionsIncludeOnly + include BaseGenericModel + + # Include only these regions + attr_reader :include_only + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_only' => :'include_only' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_only' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSRegionsIncludeOnly` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_only') + if (value = attributes[:'include_only']).is_a?(Array) + self.include_only = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_only.nil? + true + end + + # Custom attribute writer method with validation + # @param include_only [Object] Object to be assigned + # @!visibility private + def include_only=(include_only) + if include_only.nil? + fail ArgumentError, 'invalid value for "include_only", include_only cannot be nil.' + end + @include_only = include_only + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_only == o.include_only + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_only].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_resources_config.rb b/lib/datadog_api_client/v2/models/aws_resources_config.rb new file mode 100644 index 000000000000..541db7cb3976 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_resources_config.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Resources config + class AWSResourcesConfig + include BaseGenericModel + + # Whether Datadog collects cloud security posture management resources from your AWS account. + attr_accessor :cloud_security_posture_management_collection + + # Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for `cspm_resource_collection`. + attr_accessor :extended_collection + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud_security_posture_management_collection' => :'cloud_security_posture_management_collection', + :'extended_collection' => :'extended_collection' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud_security_posture_management_collection' => :'Boolean', + :'extended_collection' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSResourcesConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cloud_security_posture_management_collection') + self.cloud_security_posture_management_collection = attributes[:'cloud_security_posture_management_collection'] + end + + if attributes.key?(:'extended_collection') + self.extended_collection = attributes[:'extended_collection'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cloud_security_posture_management_collection == o.cloud_security_posture_management_collection && + extended_collection == o.extended_collection + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud_security_posture_management_collection, extended_collection].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_traces_config.rb b/lib/datadog_api_client/v2/models/aws_traces_config.rb new file mode 100644 index 000000000000..763f1153e2cb --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_traces_config.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Traces config + class AWSTracesConfig + include BaseGenericModel + + # AWS X-Ray services to collect traces from + attr_accessor :xray_services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'xray_services' => :'xray_services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'xray_services' => :'XRayServicesList' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSTracesConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'xray_services') + self.xray_services = attributes[:'xray_services'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + xray_services == o.xray_services + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [xray_services].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/x_ray_services_include_all.rb b/lib/datadog_api_client/v2/models/x_ray_services_include_all.rb new file mode 100644 index 000000000000..cf8a8ea50340 --- /dev/null +++ b/lib/datadog_api_client/v2/models/x_ray_services_include_all.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include all services + class XRayServicesIncludeAll + include BaseGenericModel + + # Include all services + attr_reader :include_all + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_all' => :'include_all' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_all' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::XRayServicesIncludeAll` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_all') + self.include_all = attributes[:'include_all'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_all.nil? + true + end + + # Custom attribute writer method with validation + # @param include_all [Object] Object to be assigned + # @!visibility private + def include_all=(include_all) + if include_all.nil? + fail ArgumentError, 'invalid value for "include_all", include_all cannot be nil.' + end + @include_all = include_all + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_all == o.include_all + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_all].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/x_ray_services_include_only.rb b/lib/datadog_api_client/v2/models/x_ray_services_include_only.rb new file mode 100644 index 000000000000..d5798dbb2b21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/x_ray_services_include_only.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Include only these services + class XRayServicesIncludeOnly + include BaseGenericModel + + # Include only these services + attr_reader :include_only + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_only' => :'include_only' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_only' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::XRayServicesIncludeOnly` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_only') + if (value = attributes[:'include_only']).is_a?(Array) + self.include_only = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @include_only.nil? + true + end + + # Custom attribute writer method with validation + # @param include_only [Object] Object to be assigned + # @!visibility private + def include_only=(include_only) + if include_only.nil? + fail ArgumentError, 'invalid value for "include_only", include_only cannot be nil.' + end + @include_only = include_only + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_only == o.include_only + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_only].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/x_ray_services_list.rb b/lib/datadog_api_client/v2/models/x_ray_services_list.rb new file mode 100644 index 000000000000..0387bb180331 --- /dev/null +++ b/lib/datadog_api_client/v2/models/x_ray_services_list.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS X-Ray services to collect traces from + module XRayServicesList + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'XRayServicesIncludeAll', + :'XRayServicesIncludeOnly' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end