diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a3a38ebca935..ad1dba70f7ca 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. @@ -983,6 +990,536 @@ 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' + required: + - data + 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 + AWSAccountResponse: + description: AWS Account response body + properties: + data: + $ref: '#/components/schemas/AWSAccountResponseData' + required: + - data + 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 + 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 + - type + type: object + AWSAccountTags: + description: Tags to apply to all metrics in the account + items: + description: Tag to apply to all metrics in the account + example: key:value + type: string + nullable: true + type: array + AWSAccountType: + default: account + description: AWS Account resource type. + enum: + - account + example: account + type: string + x-enum-varnames: + - ACCOUNT + AWSAccountUpdateRequest: + description: AWS Account Update Request body + properties: + data: + $ref: '#/components/schemas/AWSAccountUpdateRequestData' + required: + - data + type: object + AWSAccountUpdateRequestAttributes: + 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 + AWSAccountUpdateRequestData: + description: AWS Account Update Request data + properties: + attributes: + $ref: '#/components/schemas/AWSAccountUpdateRequestAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - attributes + - type + type: object + AWSAccountsResponse: + description: AWS Accounts response body + properties: + data: + description: List of AWS Account Integration Configs + items: + $ref: '#/components/schemas/AWSAccountResponseData' + type: array + required: + - data + 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' + required: + - data + type: object + AWSLogsServicesResponseAttributes: + description: AWS Logs Services response body + properties: + logs_services: + description: List of AWS services that can send logs to Datadog + example: + - s3 + items: + example: s3 + type: string + type: array + required: + - logs_services + type: object + AWSLogsServicesResponseData: + description: AWS Logs Services response body + properties: + attributes: + $ref: '#/components/schemas/AWSLogsServicesResponseAttributes' + id: + default: logs_services + description: The `AWSLogsServicesResponseData` `id`. + example: logs_services + type: string + type: + $ref: '#/components/schemas/AWSLogsServicesResponseDataType' + required: + - id + - type + type: object + AWSLogsServicesResponseDataType: + default: logs_services + description: The `AWSLogsServicesResponseData` `type`. + enum: + - logs_services + example: logs_services + type: string + x-enum-varnames: + - LOGS_SERVICES + 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: + $ref: '#/components/schemas/AWSNamespacesResponseData' + required: + - data + type: object + AWSNamespacesResponseAttributes: + description: AWS Namespaces response body + properties: + namespaces: + description: AWS CloudWatch namespace + example: + - AWS/ApiGateway + items: + example: AWS/ApiGateway + type: string + type: array + required: + - namespaces + type: object + AWSNamespacesResponseData: + description: AWS Namespaces response body + properties: + attributes: + $ref: '#/components/schemas/AWSNamespacesResponseAttributes' + id: + default: namespaces + description: The `AWSNamespacesResponseData` `id`. + example: namespaces + type: string + type: + $ref: '#/components/schemas/AWSNamespacesResponseDataType' + required: + - id + - type + type: object + AWSNamespacesResponseDataType: + default: namespaces + description: The `AWSNamespacesResponseData` `type`. + enum: + - namespaces + example: namespaces + type: string + x-enum-varnames: + - NAMESPACES + AWSNewExternalIDResponse: + description: AWS External ID response body + properties: + data: + $ref: '#/components/schemas/AWSNewExternalIDResponseData' + required: + - data + type: object + AWSNewExternalIDResponseAttributes: + description: AWS External ID response body + properties: + external_id: + description: AWS IAM External ID for associated role + example: acb8f6b8a844443dbb726d07dcb1a870 + type: string + required: + - external_id + type: object + AWSNewExternalIDResponseData: + description: AWS External ID response body + properties: + attributes: + $ref: '#/components/schemas/AWSNewExternalIDResponseAttributes' + id: + default: external_id + description: The `AWSNewExternalIDResponseData` `id`. + example: external_id + type: string + type: + $ref: '#/components/schemas/AWSNewExternalIDResponseDataType' + required: + - id + - type + type: object + AWSNewExternalIDResponseDataType: + default: external_id + description: The `AWSNewExternalIDResponseData` `type`. + enum: + - external_id + example: external_id + type: string + x-enum-varnames: + - EXTERNAL_ID + 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 + 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: @@ -26567,6 +27104,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. @@ -31589,6 +32154,244 @@ 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: + - description: Optional query filter accounts by AWS Account ID + 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' + summary: List all AWS integrations + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + 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' + summary: Create an AWS integration + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configurations_manage + 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' + summary: Delete an AWS integration + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configurations_manage + 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' + summary: Get an AWS integration by config ID + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + 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/AWSAccountUpdateRequest' + 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' + summary: Update an AWS integration + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + 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/available_namespaces: + get: + description: Get a list of available 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: List available namespaces + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + 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: CreateNewAWSExternalID + 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' + summary: Generate a new external ID + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_edit + 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: ListAWSLogsServices + 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: Get list of AWS log ready services + tags: + - AWS Logs Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + 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/gcp/accounts: get: description: List all GCP STS-enabled service accounts configured in your Datadog @@ -42857,6 +43660,18 @@ 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: 'Configure your Datadog-AWS-Logs integration directly through Datadog + API. + + For more information, see the [AWS integration page](https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection).' + externalDocs: + url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection + name: AWS Logs 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..466a5f735375 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:00.419Z \ 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..ada4d8b1b2b8 --- /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: Mon, 28 Oct 2024 14:43:00 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":"83eacdb0-09e6-4e72-bf2e-b2fbcdf438b7","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"2803c423184c499dbd123d346e5bd16f"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-10-28T14:43:01.065460229Z","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-28T14:43:01.065463823Z","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: Mon, 28 Oct 2024 14:43:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/83eacdb0-09e6-4e72-bf2e-b2fbcdf438b7 + 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..225e608e0dd2 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:01.350Z \ 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..45acf4946209 --- /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: Mon, 28 Oct 2024 14:43:01 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..0dbdfb536010 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Create-account-config-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:01.458Z \ 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..162243419af5 --- /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: Mon, 28 Oct 2024 14:43:01 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":"fa9e70b4-5fbb-499d-ba36-b802512cbc83","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"7fca00b8e534405e990889d4960d23f6"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:02.014523417Z","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-28T14:43:02.014527511Z","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: Mon, 28 Oct 2024 14:43:01 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: Mon, 28 Oct 2024 14:43:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/fa9e70b4-5fbb-499d-ba36-b802512cbc83 + 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..279b77d56f62 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:02.940Z \ 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..be9c05d77acf --- /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: Mon, 28 Oct 2024 14:43:02 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..f5fe1a6f0b97 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:03.036Z \ 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..49a7bf456b44 --- /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: Mon, 28 Oct 2024 14:43:03 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":"ea195e91-95f9-4811-9161-cbcce608b8ed","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"cd09f429becf46babb7f30a4da51b5fb"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:03.638813736Z","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-28T14:43:03.638829687Z","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: Mon, 28 Oct 2024 14:43:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ea195e91-95f9-4811-9161-cbcce608b8ed + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 28 Oct 2024 14:43:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ea195e91-95f9-4811-9161-cbcce608b8ed + 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..b8c3c7fbd4d6 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Delete-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:04.053Z \ 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..c4b46045d4b4 --- /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: Mon, 28 Oct 2024 14:43:04 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":"615cc571-774b-4e40-bc94-ad3f178cbfc8","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"b4966eed30af4b1ba9f62a4a3e841cb8"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:04.618588959Z","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-28T14:43:04.618593611Z","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: Mon, 28 Oct 2024 14:43:04 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: Mon, 28 Oct 2024 14:43:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/615cc571-774b-4e40-bc94-ad3f178cbfc8 + 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..b9c80bdbbbfe --- /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-28T14:43:05.063Z \ 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..aea10cc384ed --- /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: Mon, 28 Oct 2024 14:43:05 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":"external_id","type":"external_id","attributes":{"external_id":"46c7ca9418564d478f52b94479b3aae2"}}}' + 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..ae44c8d586d8 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:05.156Z \ 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..f413a0236252 --- /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: Mon, 28 Oct 2024 14:43:05 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":"35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"34c9dbc0f2934cebb5d7a0690f3f333f"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:05.736496681Z","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-28T14:43:05.736509432Z","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: Mon, 28 Oct 2024 14:43:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"34c9dbc0f2934cebb5d7a0690f3f333f"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:05.736497Z","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-28T14:43:05.736509Z","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: Mon, 28 Oct 2024 14:43:05 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0 + 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..3602f01ba0a5 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:06.192Z \ 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..fa45908b9b3f --- /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: Mon, 28 Oct 2024 14:43:06 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..b4eaf08518d6 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Get-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:06.335Z \ 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..705a471c7319 --- /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: Mon, 28 Oct 2024 14:43:06 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..684ec896f950 --- /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-28T14:43:06.477Z \ 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..eac292a0f9d3 --- /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: Mon, 28 Oct 2024 14:43:06 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":"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-18T20:19:53.960435Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"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":[]}}}}]}' + 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-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen b/cassettes/features/v2/aws_integration/AWS-Integration-List-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen new file mode 100644 index 000000000000..cce7072482bc --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:06.671Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/AWS-Integration-List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml b/cassettes/features/v2/aws_integration/AWS-Integration-List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml new file mode 100644 index 000000000000..bcdec0a35359 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Mon, 28 Oct 2024 14:43:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/available_namespaces + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"namespaces","type":"namespaces","attributes":{"namespaces":["AWS/ApiGateway","AWS/AppRunner","AWS/AppStream","AWS/AppSync","AWS/ApplicationELB","AWS/Athena","AWS/AutoScaling","AWS/Backup","AWS/Bedrock","AWS/Billing","AWS/CertificateManager","AWS/ELB","AWS/CloudFront","AWS/CloudHSM","AWS/CloudSearch","AWS/CodeBuild","AWS/CodeWhisperer","AWS/Cognito","AWS/Config","AWS/Connect","AWS/DMS","AWS/DX","AWS/DocDB","AWS/DynamoDB","AWS/DAX","AWS/EC2","AWS/EC2/API","AWS/EC2/InfrastructurePerformance","AWS/EC2Spot","AWS/ElasticMapReduce","AWS/ElastiCache","AWS/ElasticBeanstalk","AWS/EBS","AWS/ECR","AWS/ECS","AWS/EFS","AWS/ElasticTranscoder","AWS/MediaConnect","AWS/MediaConvert","AWS/MediaLive","AWS/MediaPackage","AWS/MediaStore","AWS/MediaTailor","AWS/Events","AWS/FSx","AWS/GameLift","AWS/GlobalAccelerator","Glue","AWS/Inspector","AWS/IoT","AWS/KMS","AWS/Cassandra","AWS/Kinesis","AWS/KinesisAnalytics","AWS/Firehose","AWS/Lambda","AWS/Lex","AWS/AmazonMQ","AWS/ML","AWS/Kafka","AmazonMWAA","AWS/MemoryDB","AWS/NATGateway","AWS/Neptune","AWS/NetworkFirewall","AWS/NetworkELB","AWS/Network + Manager","AWS/NetworkMonitor","AWS/ES","AWS/AOSS","AWS/OpsWorks","AWS/Polly","AWS/PrivateLinkEndpoints","AWS/PrivateLinkServices","AWS/RDS","AWS/RDS/Proxy","AWS/Redshift","AWS/Rekognition","AWS/Route53","AWS/Route53Resolver","AWS/S3","AWS/S3/Storage-Lens","AWS/SageMaker","/aws/sagemaker/Endpoints","AWS/Sagemaker/LabelingJobs","AWS/Sagemaker/ModelBuildingPipeline","/aws/sagemaker/ProcessingJobs","/aws/sagemaker/TrainingJobs","/aws/sagemaker/TransformJobs","AWS/SageMaker/Workteam","AWS/ServiceQuotas","AWS/DDoSProtection","AWS/SES","AWS/SNS","AWS/SQS","AWS/SWF","AWS/States","AWS/StorageGateway","AWS/Textract","AWS/TransitGateway","AWS/Translate","AWS/TrustedAdvisor","AWS/VPN","WAF","AWS/WAFV2","AWS/WorkSpaces","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-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..c1c6a30de5a4 --- /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-28T14:43:06.777Z \ 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..80b60a3fe28e --- /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: Mon, 28 Oct 2024 14:43:06 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":"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..9053e7504704 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:06.862Z \ 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..bcdec0a35359 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-List-namespaces-returns-AWS-Namespaces-List-object-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Mon, 28 Oct 2024 14:43:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/available_namespaces + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"namespaces","type":"namespaces","attributes":{"namespaces":["AWS/ApiGateway","AWS/AppRunner","AWS/AppStream","AWS/AppSync","AWS/ApplicationELB","AWS/Athena","AWS/AutoScaling","AWS/Backup","AWS/Bedrock","AWS/Billing","AWS/CertificateManager","AWS/ELB","AWS/CloudFront","AWS/CloudHSM","AWS/CloudSearch","AWS/CodeBuild","AWS/CodeWhisperer","AWS/Cognito","AWS/Config","AWS/Connect","AWS/DMS","AWS/DX","AWS/DocDB","AWS/DynamoDB","AWS/DAX","AWS/EC2","AWS/EC2/API","AWS/EC2/InfrastructurePerformance","AWS/EC2Spot","AWS/ElasticMapReduce","AWS/ElastiCache","AWS/ElasticBeanstalk","AWS/EBS","AWS/ECR","AWS/ECS","AWS/EFS","AWS/ElasticTranscoder","AWS/MediaConnect","AWS/MediaConvert","AWS/MediaLive","AWS/MediaPackage","AWS/MediaStore","AWS/MediaTailor","AWS/Events","AWS/FSx","AWS/GameLift","AWS/GlobalAccelerator","Glue","AWS/Inspector","AWS/IoT","AWS/KMS","AWS/Cassandra","AWS/Kinesis","AWS/KinesisAnalytics","AWS/Firehose","AWS/Lambda","AWS/Lex","AWS/AmazonMQ","AWS/ML","AWS/Kafka","AmazonMWAA","AWS/MemoryDB","AWS/NATGateway","AWS/Neptune","AWS/NetworkFirewall","AWS/NetworkELB","AWS/Network + Manager","AWS/NetworkMonitor","AWS/ES","AWS/AOSS","AWS/OpsWorks","AWS/Polly","AWS/PrivateLinkEndpoints","AWS/PrivateLinkServices","AWS/RDS","AWS/RDS/Proxy","AWS/Redshift","AWS/Rekognition","AWS/Route53","AWS/Route53Resolver","AWS/S3","AWS/S3/Storage-Lens","AWS/SageMaker","/aws/sagemaker/Endpoints","AWS/Sagemaker/LabelingJobs","AWS/Sagemaker/ModelBuildingPipeline","/aws/sagemaker/ProcessingJobs","/aws/sagemaker/TrainingJobs","/aws/sagemaker/TransformJobs","AWS/SageMaker/Workteam","AWS/ServiceQuotas","AWS/DDoSProtection","AWS/SES","AWS/SNS","AWS/SQS","AWS/SWF","AWS/States","AWS/StorageGateway","AWS/Textract","AWS/TransitGateway","AWS/Translate","AWS/TrustedAdvisor","AWS/VPN","WAF","AWS/WAFV2","AWS/WorkSpaces","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..3736f4c8c57a --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:06.952Z \ 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..d4a9841ed07b --- /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: Mon, 28 Oct 2024 14:43:06 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":"28a2004c-84b4-4f07-a2a4-01c9ab6a021e","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"a55061deb44b4bd28f751f150cabf912"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:07.521247459Z","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-28T14:43:07.521251841Z","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: Mon, 28 Oct 2024 14:43:06 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/28a2004c-84b4-4f07-a2a4-01c9ab6a021e + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"28a2004c-84b4-4f07-a2a4-01c9ab6a021e","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"a55061deb44b4bd28f751f150cabf912"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:07.521247Z","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-28T14:43:07.787129993Z","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: Mon, 28 Oct 2024 14:43:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/28a2004c-84b4-4f07-a2a4-01c9ab6a021e + 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..e56f68336787 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:08.012Z \ 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..59c8c6c74382 --- /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: Mon, 28 Oct 2024 14:43:08 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":"84a5a2e9-80f6-4740-a478-c885ae8d4117","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"8e44f2912a454f59824ddcb767a6f6da"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-10-28T14:43:08.585257799Z","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-28T14:43:08.585261311Z","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: Mon, 28 Oct 2024 14:43:08 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/84a5a2e9-80f6-4740-a478-c885ae8d4117 + 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: Mon, 28 Oct 2024 14:43:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/84a5a2e9-80f6-4740-a478-c885ae8d4117 + 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..861698b97183 --- /dev/null +++ b/cassettes/features/v2/aws_integration/AWS-Integration-Patch-account-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-10-28T14:43:08.932Z \ 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..01929ca9c047 --- /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: Mon, 28 Oct 2024 14:43:08 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/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..8da9363a4aa0 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:46.341Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..6a70165cfbec --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml @@ -0,0 +1,40 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:46 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":"0696eb1f-06fa-40a6-a623-084a83f61623","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"32cd9dafa1d24205ba26a02d157cd16f"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-11-06T18:44:47.20569681Z","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-11-06T18:44:47.20570138Z","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: Wed, 06 Nov 2024 18:44:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/0696eb1f-06fa-40a6-a623-084a83f61623 + 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/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..4adb1638a7a7 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:47.513Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..bc7dcf77578c --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml @@ -0,0 +1,40 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:47 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: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5b07e0e7-013c-427e-977a-7adb94ff4b40","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-11-06T18:44:47.622908005Z","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-11-06T18:44:47.62291187Z","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: Wed, 06 Nov 2024 18:44:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/5b07e0e7-013c-427e-977a-7adb94ff4b40 + 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/Create-an-AWS-integration-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..26a03306f6ae --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:47.919Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..ec22e4d73b9c --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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-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/Create-an-AWS-integration-returns-Conflict-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Conflict-response.frozen new file mode 100644 index 000000000000..89901ede4c05 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:48.024Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Conflict-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Conflict-response.yml new file mode 100644 index 000000000000..aabb57d1eb65 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Conflict-response.yml @@ -0,0 +1,63 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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"]}}},"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":"7f221537-cb4f-47dc-8666-f77e5ca60750","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"8fce2f5d4975420794b61a5455bf78f2"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:48.579473724Z","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-11-06T18:44:48.579477654Z","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: Wed, 06 Nov 2024 18:44: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: Wed, 06 Nov 2024 18:44:48 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/7f221537-cb4f-47dc-8666-f77e5ca60750 + 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/Delete-an-AWS-integration-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..27a329cddf35 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:49.460Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..bf57fdbb4a71 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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/Delete-an-AWS-integration-returns-No-Content-response.frozen b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-No-Content-response.frozen new file mode 100644 index 000000000000..19dc73505b03 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:49.526Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-No-Content-response.yml b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-No-Content-response.yml new file mode 100644 index 000000000000..0ffae5bf9151 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-No-Content-response.yml @@ -0,0 +1,59 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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"]}}},"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":"e733f58b-b8d1-4d0c-b2f5-6438d314ca51","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"33e38eb9a16041fc8688ca9afcf82224"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:50.086633712Z","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-11-06T18:44:50.086637995Z","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: Wed, 06 Nov 2024 18:44:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/e733f58b-b8d1-4d0c-b2f5-6438d314ca51 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 06 Nov 2024 18:44:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/e733f58b-b8d1-4d0c-b2f5-6438d314ca51 + 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/Delete-an-AWS-integration-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..abe0e4a74aa8 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:50.507Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Not-Found-response.yml new file mode 100644 index 000000000000..b8378b0acae1 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-an-AWS-integration-returns-Not-Found-response.yml @@ -0,0 +1,59 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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"]}}},"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":"22e02b17-0d91-46d7-a228-69f7250a9c67","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"7d448990acf04682b29cb61691bf86bc"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:51.024047931Z","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-11-06T18:44:51.024054618Z","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: Wed, 06 Nov 2024 18:44: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: Wed, 06 Nov 2024 18:44:50 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/22e02b17-0d91-46d7-a228-69f7250a9c67 + 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/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.frozen b/cassettes/features/v2/aws_integration/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.frozen new file mode 100644 index 000000000000..6095c7802978 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:51.500Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.yml b/cassettes/features/v2/aws_integration/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.yml new file mode 100644 index 000000000000..febd3c128165 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Generate-a-new-external-ID-returns-AWS-External-ID-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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":"external_id","type":"external_id","attributes":{"external_id":"96fc79a77c474e4f863a3c227fb91fef"}}}' + 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/Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen b/cassettes/features/v2/aws_integration/Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen new file mode 100644 index 000000000000..37cfccb87df9 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Generate-new-external-ID-returns-AWS-External-ID-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:51.871Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Generate-new-external-ID-returns-AWS-External-ID-object-response.yml b/cassettes/features/v2/aws_integration/Generate-new-external-ID-returns-AWS-External-ID-object-response.yml new file mode 100644 index 000000000000..2ef1364a0dc0 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Generate-new-external-ID-returns-AWS-External-ID-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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":"78feee6b9c374776888068593fa8c0b9","type":"external_id","attributes":{"external_id":"78feee6b9c374776888068593fa8c0b9"}}}' + 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/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..3121171861ce --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:52.052Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..b737a26911a5 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-AWS-Account-object-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:52 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"]}}},"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":"db6c660f-0ee0-4479-b1e6-936e5faa7266","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"f4c8000f33f94d25bcec9afd6609bb11"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:52.646520994Z","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-11-06T18:44:52.646525244Z","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: Wed, 06 Nov 2024 18:44:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/db6c660f-0ee0-4479-b1e6-936e5faa7266 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"db6c660f-0ee0-4479-b1e6-936e5faa7266","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"f4c8000f33f94d25bcec9afd6609bb11"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:52.646521Z","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-11-06T18:44:52.646525Z","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: Wed, 06 Nov 2024 18:44:52 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/db6c660f-0ee0-4479-b1e6-936e5faa7266 + 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/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..8de2f0fbb4cf --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.120Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..3a9c6f12158b --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:53 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/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..2abc18523caf --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.215Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.yml new file mode 100644 index 000000000000..03c227db174d --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-an-AWS-integration-by-config-ID-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:53 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/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.frozen b/cassettes/features/v2/aws_integration/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.frozen new file mode 100644 index 000000000000..2932343225b2 --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.338Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.yml b/cassettes/features/v2/aws_integration/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.yml new file mode 100644 index 000000000000..174b3ff44f28 --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-all-AWS-integrations-returns-AWS-Accounts-List-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:53 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":"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-18T20:19:53.960435Z","resources_config":{"cloud_security_posture_management_collection":true,"extended_collection":true},"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":[]}}}}]}' + 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/List-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen b/cassettes/features/v2/aws_integration/List-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen new file mode 100644 index 000000000000..e1b33d2dbbcd --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-available-namespaces-returns-AWS-Namespaces-List-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.502Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml b/cassettes/features/v2/aws_integration/List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml new file mode 100644 index 000000000000..402892e7ed67 --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-available-namespaces-returns-AWS-Namespaces-List-object-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/available_namespaces + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"namespaces","type":"namespaces","attributes":{"namespaces":["AWS/ApiGateway","AWS/AppRunner","AWS/AppStream","AWS/AppSync","AWS/ApplicationELB","AWS/Athena","AWS/AutoScaling","AWS/Backup","AWS/Bedrock","AWS/Billing","AWS/Budgeting","AWS/CertificateManager","AWS/ELB","AWS/CloudFront","AWS/CloudHSM","AWS/CloudSearch","AWS/Logs","AWS/CodeBuild","AWS/CodeWhisperer","AWS/Cognito","AWS/Config","AWS/Connect","AWS/DMS","AWS/DX","AWS/DocDB","AWS/DynamoDB","AWS/DAX","AWS/EC2","AWS/EC2/API","AWS/EC2/InfrastructurePerformance","AWS/EC2Spot","AWS/ElasticMapReduce","AWS/ElastiCache","AWS/ElasticBeanstalk","AWS/EBS","AWS/ECR","AWS/ECS","AWS/EFS","AWS/ElasticInference","AWS/ElasticTranscoder","AWS/MediaConnect","AWS/MediaConvert","AWS/MediaLive","AWS/MediaPackage","AWS/MediaStore","AWS/MediaTailor","AWS/Events","AWS/FSx","AWS/GameLift","AWS/GlobalAccelerator","Glue","AWS/Inspector","AWS/IoT","AWS/KMS","AWS/Cassandra","AWS/Kinesis","AWS/KinesisAnalytics","AWS/Firehose","AWS/Lambda","AWS/Lex","AWS/AmazonMQ","AWS/ML","AWS/Kafka","AmazonMWAA","AWS/MemoryDB","AWS/NATGateway","AWS/Neptune","AWS/NetworkFirewall","AWS/NetworkELB","AWS/Network + Manager","AWS/NetworkMonitor","AWS/ES","AWS/AOSS","AWS/OpsWorks","AWS/Polly","AWS/PrivateLinkEndpoints","AWS/PrivateLinkServices","AWS/RDS","AWS/RDS/Proxy","AWS/Redshift","AWS/Rekognition","AWS/Route53","AWS/Route53Resolver","AWS/S3","AWS/S3/Storage-Lens","AWS/SageMaker","/aws/sagemaker/Endpoints","AWS/Sagemaker/LabelingJobs","AWS/Sagemaker/ModelBuildingPipeline","/aws/sagemaker/ProcessingJobs","/aws/sagemaker/TrainingJobs","/aws/sagemaker/TransformJobs","AWS/SageMaker/Workteam","AWS/ServiceQuotas","AWS/DDoSProtection","AWS/SES","AWS/SNS","AWS/SQS","AWS/SWF","AWS/States","AWS/StorageGateway","AWS/Textract","AWS/TransitGateway","AWS/Translate","AWS/TrustedAdvisor","AWS/Usage","AWS/VPN","WAF","AWS/WAFV2","AWS/WorkSpaces","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/List-log-services-returns-AWS-Logs-Services-List-object-response.frozen b/cassettes/features/v2/aws_integration/List-log-services-returns-AWS-Logs-Services-List-object-response.frozen new file mode 100644 index 000000000000..ec96db9bef6f --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-log-services-returns-AWS-Logs-Services-List-object-response.frozen @@ -0,0 +1 @@ +2024-11-04T20:55:55.328Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/List-log-services-returns-AWS-Logs-Services-List-object-response.yml b/cassettes/features/v2/aws_integration/List-log-services-returns-AWS-Logs-Services-List-object-response.yml new file mode 100644 index 000000000000..49b0149a56f3 --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-log-services-returns-AWS-Logs-Services-List-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 04 Nov 2024 20:55:55 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":"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/List-namespaces-returns-AWS-Namespaces-List-object-response.frozen b/cassettes/features/v2/aws_integration/List-namespaces-returns-AWS-Namespaces-List-object-response.frozen new file mode 100644 index 000000000000..f663dde1fade --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-namespaces-returns-AWS-Namespaces-List-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.574Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/List-namespaces-returns-AWS-Namespaces-List-object-response.yml b/cassettes/features/v2/aws_integration/List-namespaces-returns-AWS-Namespaces-List-object-response.yml new file mode 100644 index 000000000000..402892e7ed67 --- /dev/null +++ b/cassettes/features/v2/aws_integration/List-namespaces-returns-AWS-Namespaces-List-object-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/available_namespaces + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"namespaces","type":"namespaces","attributes":{"namespaces":["AWS/ApiGateway","AWS/AppRunner","AWS/AppStream","AWS/AppSync","AWS/ApplicationELB","AWS/Athena","AWS/AutoScaling","AWS/Backup","AWS/Bedrock","AWS/Billing","AWS/Budgeting","AWS/CertificateManager","AWS/ELB","AWS/CloudFront","AWS/CloudHSM","AWS/CloudSearch","AWS/Logs","AWS/CodeBuild","AWS/CodeWhisperer","AWS/Cognito","AWS/Config","AWS/Connect","AWS/DMS","AWS/DX","AWS/DocDB","AWS/DynamoDB","AWS/DAX","AWS/EC2","AWS/EC2/API","AWS/EC2/InfrastructurePerformance","AWS/EC2Spot","AWS/ElasticMapReduce","AWS/ElastiCache","AWS/ElasticBeanstalk","AWS/EBS","AWS/ECR","AWS/ECS","AWS/EFS","AWS/ElasticInference","AWS/ElasticTranscoder","AWS/MediaConnect","AWS/MediaConvert","AWS/MediaLive","AWS/MediaPackage","AWS/MediaStore","AWS/MediaTailor","AWS/Events","AWS/FSx","AWS/GameLift","AWS/GlobalAccelerator","Glue","AWS/Inspector","AWS/IoT","AWS/KMS","AWS/Cassandra","AWS/Kinesis","AWS/KinesisAnalytics","AWS/Firehose","AWS/Lambda","AWS/Lex","AWS/AmazonMQ","AWS/ML","AWS/Kafka","AmazonMWAA","AWS/MemoryDB","AWS/NATGateway","AWS/Neptune","AWS/NetworkFirewall","AWS/NetworkELB","AWS/Network + Manager","AWS/NetworkMonitor","AWS/ES","AWS/AOSS","AWS/OpsWorks","AWS/Polly","AWS/PrivateLinkEndpoints","AWS/PrivateLinkServices","AWS/RDS","AWS/RDS/Proxy","AWS/Redshift","AWS/Rekognition","AWS/Route53","AWS/Route53Resolver","AWS/S3","AWS/S3/Storage-Lens","AWS/SageMaker","/aws/sagemaker/Endpoints","AWS/Sagemaker/LabelingJobs","AWS/Sagemaker/ModelBuildingPipeline","/aws/sagemaker/ProcessingJobs","/aws/sagemaker/TrainingJobs","/aws/sagemaker/TransformJobs","AWS/SageMaker/Workteam","AWS/ServiceQuotas","AWS/DDoSProtection","AWS/SES","AWS/SNS","AWS/SQS","AWS/SWF","AWS/States","AWS/StorageGateway","AWS/Textract","AWS/TransitGateway","AWS/Translate","AWS/TrustedAdvisor","AWS/Usage","AWS/VPN","WAF","AWS/WAFV2","AWS/WorkSpaces","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/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen new file mode 100644 index 000000000000..7d9884c79350 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:53.669Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml new file mode 100644 index 000000000000..a1e1f41e2228 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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"]}}},"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":"06b62294-36d7-4bbe-a8b8-7c93736dc0ee","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"c16e1ceb4ac64293ba91f020191fa781"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:54.297075743Z","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-11-06T18:44:54.297079976Z","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: Wed, 06 Nov 2024 18:44: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/06b62294-36d7-4bbe-a8b8-7c93736dc0ee + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"06b62294-36d7-4bbe-a8b8-7c93736dc0ee","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"c16e1ceb4ac64293ba91f020191fa781"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:54.297076Z","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-11-06T18:44:54.489623544Z","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: Wed, 06 Nov 2024 18:44:53 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/06b62294-36d7-4bbe-a8b8-7c93736dc0ee + 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/Update-an-AWS-integration-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..a20f0bad4454 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:54.767Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..d769a3f330b0 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml @@ -0,0 +1,63 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44: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","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"]}}},"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":"6e045c0b-458a-4ec1-8654-6ac491320939","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"00d5e0f623574d388e9717154bcbf7f2"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2024-11-06T18:44:55.461251746Z","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-11-06T18:44:55.461256677Z","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: Wed, 06 Nov 2024 18:44:54 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/6e045c0b-458a-4ec1-8654-6ac491320939 + 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: Wed, 06 Nov 2024 18:44:54 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/6e045c0b-458a-4ec1-8654-6ac491320939 + 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/Update-an-AWS-integration-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..7d82ab53f41c --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2024-11-06T18:44:55.829Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml new file mode 100644 index 000000000000..a78f3268874d --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 18:44:55 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/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.frozen b/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.frozen new file mode 100644 index 000000000000..59066f4dee54 --- /dev/null +++ b/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.frozen @@ -0,0 +1 @@ +2024-11-06T15:58:53.184Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.yml b/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.yml new file mode 100644 index 000000000000..4362e2ae7095 --- /dev/null +++ b/cassettes/features/v2/aws_logs_integration/Get-list-of-AWS-log-ready-services-returns-AWS-Logs-Services-List-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 06 Nov 2024 15:58:53 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":"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/examples/v2/aws-integration/CreateAWSAccount.rb b/examples/v2/aws-integration/CreateAWSAccount.rb new file mode 100644 index 000000000000..80147052f0c0 --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccount.rb @@ -0,0 +1,54 @@ +# Create an AWS integration 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::AWSAuthConfigKeys.new({ + access_key_id: "AKIAIOSFODNN7EXAMPLE", + secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + }), + 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: DatadogAPIClient::V2::AWSAccountType::ACCOUNT, + }), +}) +p api_instance.create_aws_account(body) diff --git a/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb b/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb new file mode 100644 index 000000000000..bf6e73a7e729 --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb @@ -0,0 +1,53 @@ +# Create an AWS account 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: DatadogAPIClient::V2::AWSAccountType::ACCOUNT, + }), +}) +p api_instance.create_aws_account(body) diff --git a/examples/v2/aws-integration/CreateNewAWSExternalID.rb b/examples/v2/aws-integration/CreateNewAWSExternalID.rb new file mode 100644 index 000000000000..a94f39812db7 --- /dev/null +++ b/examples/v2/aws-integration/CreateNewAWSExternalID.rb @@ -0,0 +1,8 @@ +# Generate a new external ID returns "AWS External ID object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_new_aws_external_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.create_new_aws_external_id() diff --git a/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.rb b/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.rb new file mode 100644 index 000000000000..dfc32788b330 --- /dev/null +++ b/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.rb @@ -0,0 +1,8 @@ +# Generate new external ID returns "AWS External ID object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_new_aws_external_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.create_new_aws_external_id() diff --git a/examples/v2/aws-integration/DeleteAWSAccount.rb b/examples/v2/aws-integration/DeleteAWSAccount.rb new file mode 100644 index 000000000000..932ea0a47382 --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccount.rb @@ -0,0 +1,11 @@ +# Delete an AWS integration 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/GetAWSAccount.rb b/examples/v2/aws-integration/GetAWSAccount.rb new file mode 100644 index 000000000000..c1bcc43c0b99 --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccount.rb @@ -0,0 +1,11 @@ +# Get an AWS integration by config ID 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..e853da50b507 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSAccounts.rb @@ -0,0 +1,8 @@ +# List all AWS integrations 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/ListAWSNamespaces.rb b/examples/v2/aws-integration/ListAWSNamespaces.rb new file mode 100644 index 000000000000..8856f76b3017 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSNamespaces.rb @@ -0,0 +1,8 @@ +# List available namespaces returns "AWS Namespaces List object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_aws_namespaces".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.list_aws_namespaces() diff --git a/examples/v2/aws-integration/ListAWSNamespaces_3031307873.rb b/examples/v2/aws-integration/ListAWSNamespaces_3031307873.rb new file mode 100644 index 000000000000..f22d68203452 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSNamespaces_3031307873.rb @@ -0,0 +1,8 @@ +# List namespaces returns "AWS Namespaces List object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_aws_namespaces".to_sym] = true +end +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..705f1495d1e7 --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccount.rb @@ -0,0 +1,56 @@ +# Update an AWS integration 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::AWSAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::AWSAccountUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::AWSAccountUpdateRequestAttributes.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: DatadogAPIClient::V2::AWSAccountType::ACCOUNT, + }), +}) +p api_instance.update_aws_account(AWS_ACCOUNT_V2_DATA_ID, body) diff --git a/examples/v2/aws-logs-integration/ListAWSLogsServices.rb b/examples/v2/aws-logs-integration/ListAWSLogsServices.rb new file mode 100644 index 000000000000..a6fc3e4e62a6 --- /dev/null +++ b/examples/v2/aws-logs-integration/ListAWSLogsServices.rb @@ -0,0 +1,8 @@ +# Get list of AWS log ready services returns "AWS Logs Services List object" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_aws_logs_services".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AWSLogsIntegrationAPI.new +p api_instance.list_aws_logs_services() diff --git a/examples/v2/security-monitoring/CancelHistoricalJob.rb b/examples/v2/security-monitoring/CancelHistoricalJob.rb index df53e38ced96..977b9b53ec40 100644 --- a/examples/v2/security-monitoring/CancelHistoricalJob.rb +++ b/examples/v2/security-monitoring/CancelHistoricalJob.rb @@ -2,8 +2,8 @@ require "datadog_api_client" DatadogAPIClient.configure do |config| - config.unstable_operations["v2.cancel_historical_job".to_sym] = true config.unstable_operations["v2.run_historical_job".to_sym] = true + config.unstable_operations["v2.cancel_historical_job".to_sym] = true end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new diff --git a/examples/v2/security-monitoring/GetHistoricalJob.rb b/examples/v2/security-monitoring/GetHistoricalJob.rb index d9a1b76ec918..1a8a22450643 100644 --- a/examples/v2/security-monitoring/GetHistoricalJob.rb +++ b/examples/v2/security-monitoring/GetHistoricalJob.rb @@ -2,8 +2,8 @@ require "datadog_api_client" DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_historical_job".to_sym] = true config.unstable_operations["v2.run_historical_job".to_sym] = true + config.unstable_operations["v2.get_historical_job".to_sym] = true end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 401d50b1727d..0ff02c599183 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1324,6 +1324,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" => "AWSAccountUpdateRequest", + }, "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..3f47d837a7b1 --- /dev/null +++ b/features/v2/aws_integration.feature @@ -0,0 +1,158 @@ +@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: Create an AWS account 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: Create an AWS integration 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": {"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 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: Create an AWS integration 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: Create an AWS integration 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: Delete an AWS integration 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: Delete an AWS integration 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: Delete an AWS integration 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: Generate a new external ID returns "AWS External ID object" response + Given operation "CreateNewAWSExternalID" enabled + And new "CreateNewAWSExternalID" request + When the request is sent + Then the response status is 200 AWS External ID object + + @team:DataDog/aws-integrations + Scenario: Generate new external ID returns "AWS External ID object" response + Given operation "CreateNewAWSExternalID" enabled + And new "CreateNewAWSExternalID" request + When the request is sent + Then the response status is 200 AWS External ID object + + @team:DataDog/aws-integrations + Scenario: Get an AWS integration by config ID 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: Get an AWS integration by config ID 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: Get an AWS integration by config ID 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: List all AWS integrations 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: List available namespaces returns "AWS Namespaces List object" response + Given operation "ListAWSNamespaces" enabled + And new "ListAWSNamespaces" request + When the request is sent + Then the response status is 200 AWS Namespaces List object + + @team:DataDog/aws-integrations + Scenario: List namespaces returns "AWS Namespaces List object" response + Given operation "ListAWSNamespaces" enabled + And new "ListAWSNamespaces" request + When the request is sent + Then the response status is 200 AWS Namespaces List object + + @team:DataDog/aws-integrations + Scenario: Update an AWS integration 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: Update an AWS integration 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: Update an AWS integration 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/aws_logs_integration.feature b/features/v2/aws_logs_integration.feature new file mode 100644 index 000000000000..7dcfb894ae9d --- /dev/null +++ b/features/v2/aws_logs_integration.feature @@ -0,0 +1,16 @@ +@endpoint(aws-logs-integration) @endpoint(aws-logs-integration-v2) +Feature: AWS Logs Integration + Configure your Datadog-AWS-Logs integration directly through Datadog API. + For more information, see the [AWS integration + page](https://docs.datadoghq.com/integrations/amazon_web_services/#log- + collection). + + @team:DataDog/aws-integrations + Scenario: Get list of AWS log ready services returns "AWS Logs Services List object" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AWSLogsIntegration" API + And operation "ListAWSLogsServices" enabled + And new "ListAWSLogsServices" request + When the request is sent + Then the response status is 200 AWS Logs Services List object diff --git a/features/v2/given.json b/features/v2/given.json index 6271eb23f012..41cd8e0f22a3 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -212,6 +212,18 @@ "tag": "Incidents", "operationId": "CreateIncidentTodo" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\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 0e2a5942a9de..dcb4deb9a783 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -788,6 +788,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" + } + }, + "ListAWSNamespaces": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateNewAWSExternalID": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "ListAWSLogsServices": { + "tag": "AWS Logs 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 c543c45656e6..7752fa03cecb 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -222,6 +222,14 @@ def initialize "v2.update_incident_integration": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, + "v2.create_aws_account": false, + "v2.create_new_aws_external_id": false, + "v2.delete_aws_account": false, + "v2.get_aws_account": false, + "v2.list_aws_accounts": false, + "v2.list_aws_namespaces": false, + "v2.update_aws_account": false, + "v2.list_aws_logs_services": false, "v2.cancel_historical_job": false, "v2.convert_job_result_to_signal": false, "v2.delete_historical_job": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 390e2c5dfa33..06c27ed19b6b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -975,6 +975,21 @@ 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_response" => "AWSAccountResponse", + "v2.aws_account_response_attributes" => "AWSAccountResponseAttributes", + "v2.aws_account_response_data" => "AWSAccountResponseData", + "v2.aws_accounts_response" => "AWSAccountsResponse", + "v2.aws_account_type" => "AWSAccountType", + "v2.aws_account_update_request" => "AWSAccountUpdateRequest", + "v2.aws_account_update_request_attributes" => "AWSAccountUpdateRequestAttributes", + "v2.aws_account_update_request_data" => "AWSAccountUpdateRequestData", + "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", @@ -988,6 +1003,32 @@ 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_logs_services_response_data_type" => "AWSLogsServicesResponseDataType", + "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_namespaces_response_data_type" => "AWSNamespacesResponseDataType", + "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_new_external_id_response_data_type" => "AWSNewExternalIDResponseDataType", + "v2.aws_regions" => "AWSRegions", + "v2.aws_regions_include_all" => "AWSRegionsIncludeAll", + "v2.aws_regions_include_only" => "AWSRegionsIncludeOnly", + "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", @@ -2586,6 +2627,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", @@ -2622,6 +2666,8 @@ def overrides "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", "v2.audit_api" => "AuditAPI", "v2.authn_mappings_api" => "AuthNMappingsAPI", + "v2.aws_integration_api" => "AWSIntegrationAPI", + "v2.aws_logs_integration_api" => "AWSLogsIntegrationAPI", "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..7412deccf8d3 --- /dev/null +++ b/lib/datadog_api_client/v2/api/aws_integration_api.rb @@ -0,0 +1,519 @@ +=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 + + # Create an AWS integration. + # + # @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 + + # Create an AWS integration. + # + # 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 + + # Generate a new external ID. + # + # @see #create_new_aws_external_id_with_http_info + def create_new_aws_external_id(opts = {}) + data, _status_code, _headers = create_new_aws_external_id_with_http_info(opts) + data + end + + # Generate a 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 create_new_aws_external_id_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_new_aws_external_id".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_new_aws_external_id") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_new_aws_external_id")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.create_new_aws_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 => :create_new_aws_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#create_new_aws_external_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AWS integration. + # + # @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 + + # Delete an AWS integration. + # + # 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 + + # Get an AWS integration by config ID. + # + # @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 + + # Get an AWS integration by config ID. + # + # 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 + + # List all AWS integrations. + # + # @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 + + # List all AWS integrations. + # + # Get a list of AWS Account Integration Configs. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :aws_account_id Optional query filter accounts by 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 + + # List available 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 + + # List available namespaces. + # + # Get a list of available 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 = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_namespaces".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_namespaces") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_aws_namespaces")) + end + + 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/available_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 + + # Update an AWS integration. + # + # @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 + + # Update an AWS integration. + # + # Update an AWS Account Integration Config + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config + # @param body [AWSAccountUpdateRequest] + # @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/api/aws_logs_integration_api.rb b/lib/datadog_api_client/v2/api/aws_logs_integration_api.rb new file mode 100644 index 000000000000..1ab29b3d0d01 --- /dev/null +++ b/lib/datadog_api_client/v2/api/aws_logs_integration_api.rb @@ -0,0 +1,92 @@ +=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 AWSLogsIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get list of AWS log ready services. + # + # @see #list_aws_logs_services_with_http_info + def list_aws_logs_services(opts = {}) + data, _status_code, _headers = list_aws_logs_services_with_http_info(opts) + data + end + + # Get list of AWS log ready 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_logs_services_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_logs_services".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_logs_services") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_aws_logs_services")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSLogsIntegrationAPI.list_aws_logs_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_logs_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: AWSLogsIntegrationAPI#list_aws_logs_services\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..171d78d061b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_create_request.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 + # AWS Account Create Request body + class AWSAccountCreateRequest + include BaseGenericModel + + # AWS Account Create Request data + attr_reader :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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..513799fcfa75 --- /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' => :'AWSAccountType' + } + 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_response.rb b/lib/datadog_api_client/v2/models/aws_account_response.rb new file mode 100644 index 000000000000..1c32a951924e --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response.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 + # AWS Account response body + class AWSAccountResponse + include BaseGenericModel + + # AWS Account Response body + attr_reader :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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..c4c48fb02e5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb @@ -0,0 +1,233 @@ +=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_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 + + # 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 @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 && + 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..c8e6de3355ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_response_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 Response body + class AWSAccountResponseData + include BaseGenericModel + + # The AWS Account Integration Config + attr_accessor :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' => :'AWSAccountType' + } + 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 @id.nil? + return false if @type.nil? + true + 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_account_type.rb b/lib/datadog_api_client/v2/models/aws_account_type.rb new file mode 100644 index 000000000000..80debf77e414 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_type.rb @@ -0,0 +1,26 @@ +=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 resource type. + class AWSAccountType + include BaseEnumModel + + ACCOUNT = "account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_account_update_request.rb b/lib/datadog_api_client/v2/models/aws_account_update_request.rb new file mode 100644 index 000000000000..b4d94e40130c --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_update_request.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 + # AWS Account Update Request body + class AWSAccountUpdateRequest + include BaseGenericModel + + # AWS Account Update Request data + attr_reader :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' => :'AWSAccountUpdateRequestData' + } + 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::AWSAccountUpdateRequest` 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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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_update_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb new file mode 100644 index 000000000000..12e8e18b4904 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_update_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 AWSAccountUpdateRequestAttributes + 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::AWSAccountUpdateRequestAttributes` 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_update_request_data.rb b/lib/datadog_api_client/v2/models/aws_account_update_request_data.rb new file mode 100644 index 000000000000..309e72011571 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_account_update_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 Update Request data + class AWSAccountUpdateRequestData + 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' => :'AWSAccountUpdateRequestAttributes', + :'id' => :'String', + :'type' => :'AWSAccountType' + } + 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::AWSAccountUpdateRequestData` 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_accounts_response.rb b/lib/datadog_api_client/v2/models/aws_accounts_response.rb new file mode 100644 index 000000000000..e0b1d514ea00 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_accounts_response.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 Accounts response body + class AWSAccountsResponse + include BaseGenericModel + + # List of AWS Account Integration Configs + attr_reader :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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..56763831448f --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response.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 + # AWS Logs Services response body + class AWSLogsServicesResponse + include BaseGenericModel + + # AWS Logs Services response body + attr_reader :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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..66d9e3dda679 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response_attributes.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 AWSLogsServicesResponseAttributes + include BaseGenericModel + + # List of AWS services that can send logs to Datadog + attr_reader :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 + + # 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 @logs_services.nil? + true + end + + # Custom attribute writer method with validation + # @param logs_services [Object] Object to be assigned + # @!visibility private + def logs_services=(logs_services) + if logs_services.nil? + fail ArgumentError, 'invalid value for "logs_services", logs_services cannot be nil.' + end + @logs_services = logs_services + 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..04c1f9324c5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response_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 Logs Services response body + class AWSLogsServicesResponseData + include BaseGenericModel + + # AWS Logs Services response body + attr_accessor :attributes + + # The `AWSLogsServicesResponseData` `id`. + attr_reader :id + + # The `AWSLogsServicesResponseData` `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' => :'AWSLogsServicesResponseAttributes', + :'id' => :'String', + :'type' => :'AWSLogsServicesResponseDataType' + } + 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 + + # 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 @id.nil? + return false if @type.nil? + true + 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_logs_services_response_data_type.rb b/lib/datadog_api_client/v2/models/aws_logs_services_response_data_type.rb new file mode 100644 index 000000000000..ec662138669d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_logs_services_response_data_type.rb @@ -0,0 +1,26 @@ +=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 `AWSLogsServicesResponseData` `type`. + class AWSLogsServicesResponseDataType + include BaseEnumModel + + LOGS_SERVICES = "logs_services".freeze + 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..e354121f3cef --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response.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 + # AWS Namespaces response body + class AWSNamespacesResponse + include BaseGenericModel + + # AWS Namespaces response body + attr_reader :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' => :'AWSNamespacesResponseData' + } + 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') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..832b0f9d633d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response_attributes.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 AWSNamespacesResponseAttributes + include BaseGenericModel + + # AWS CloudWatch namespace + attr_reader :namespaces + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'namespaces' => :'namespaces' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'namespaces' => :'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::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?(:'namespaces') + if (value = attributes[:'namespaces']).is_a?(Array) + self.namespaces = 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 @namespaces.nil? + true + end + + # Custom attribute writer method with validation + # @param namespaces [Object] Object to be assigned + # @!visibility private + def namespaces=(namespaces) + if namespaces.nil? + fail ArgumentError, 'invalid value for "namespaces", namespaces cannot be nil.' + end + @namespaces = namespaces + 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 && + namespaces == o.namespaces + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [namespaces].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..c5efdcdd1af4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response_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 Namespaces response body + class AWSNamespacesResponseData + include BaseGenericModel + + # AWS Namespaces response body + attr_accessor :attributes + + # The `AWSNamespacesResponseData` `id`. + attr_reader :id + + # The `AWSNamespacesResponseData` `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' => :'AWSNamespacesResponseAttributes', + :'id' => :'String', + :'type' => :'AWSNamespacesResponseDataType' + } + 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 + + # 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 @id.nil? + return false if @type.nil? + true + 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_namespaces_response_data_type.rb b/lib/datadog_api_client/v2/models/aws_namespaces_response_data_type.rb new file mode 100644 index 000000000000..4864f033b22b --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_namespaces_response_data_type.rb @@ -0,0 +1,26 @@ +=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 `AWSNamespacesResponseData` `type`. + class AWSNamespacesResponseDataType + include BaseEnumModel + + NAMESPACES = "namespaces".freeze + 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..a27f68f5fc67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response.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 + # AWS External ID response body + class AWSNewExternalIDResponse + include BaseGenericModel + + # AWS External ID response body + attr_reader :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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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..e145f2c6e0e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response_attributes.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 + # AWS External ID response body + class AWSNewExternalIDResponseAttributes + include BaseGenericModel + + # AWS IAM External ID for associated role + attr_reader :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 + + # 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 @external_id.nil? + true + end + + # Custom attribute writer method with validation + # @param external_id [Object] Object to be assigned + # @!visibility private + def external_id=(external_id) + if external_id.nil? + fail ArgumentError, 'invalid value for "external_id", external_id cannot be nil.' + end + @external_id = external_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 && + 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..04daac1e7999 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response_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 External ID response body + class AWSNewExternalIDResponseData + include BaseGenericModel + + # AWS External ID response body + attr_accessor :attributes + + # The `AWSNewExternalIDResponseData` `id`. + attr_reader :id + + # The `AWSNewExternalIDResponseData` `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' => :'AWSNewExternalIDResponseAttributes', + :'id' => :'String', + :'type' => :'AWSNewExternalIDResponseDataType' + } + 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 + + # 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 @id.nil? + return false if @type.nil? + true + 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_new_external_id_response_data_type.rb b/lib/datadog_api_client/v2/models/aws_new_external_id_response_data_type.rb new file mode 100644 index 000000000000..840149c7ace9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_new_external_id_response_data_type.rb @@ -0,0 +1,26 @@ +=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 `AWSNewExternalIDResponseData` `type`. + class AWSNewExternalIDResponseDataType + include BaseEnumModel + + EXTERNAL_ID = "external_id".freeze + 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