diff --git a/.apigentools-info b/.apigentools-info index 0b7e982a99fc..2effab50efc7 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-20 07:21:24.854718", - "spec_repo_commit": "fec20f97" + "regenerated": "2025-05-21 15:19:46.487840", + "spec_repo_commit": "3fbcf458" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-20 07:21:24.871057", - "spec_repo_commit": "fec20f97" + "regenerated": "2025-05-21 15:19:46.506116", + "spec_repo_commit": "3fbcf458" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 79fc922a6202..49114744e740 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -836,6 +836,13 @@ components: required: true schema: type: string + TenancyOCIDPathParameter: + description: Unique tenancy OCID of the OCI integration config. + in: path + name: tenancy_ocid + required: true + schema: + type: string UserID: description: The ID of the user. in: path @@ -3662,6 +3669,23 @@ components: from the other indexes type: string type: object + AuthCredentials: + description: The auth credentials of the user. Consists of a public key fingerprint + and private key. + properties: + fingerprint: + description: The public key fingerprint. + example: c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1 + type: string + private_key: + description: The `RSA` private key in `PEM` format. + example: '----BEGIN PRIVATE KEY-----MIIEvgIBADANBgkqhkiG9w0BAQEFAA----END + PRIVATE KEY-----' + type: string + required: + - fingerprint + - private_key + type: object AuthNMapping: description: The AuthN Mapping object returned by API. properties: @@ -9627,6 +9651,107 @@ components: type: $ref: '#/components/schemas/RuleType' type: object + CreateTenancyConfig: + description: The definition of `CreateTenancyConfig` object. + example: + data: + attributes: + auth_credentials: + fingerprint: a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1 + private_key: '-----BEGIN PRIVATE KEY----- + + o9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub + + /aU4/sNo2f8epM9l7QGiCtY= + + -----END PRIVATE KEY-----' + config_version: 2 + home_region: us-ashburn-1 + logs_config: + compartment_tag_filters: + - datadog:true + - env:prod + enabled: true + enabled_services: + - oacnativeproduction + metrics_config: + compartment_tag_filters: + - datadog:true + - env:prod + enabled: true + excluded_services: + - oci_compute + resource_collection_enabled: true + user_ocid: ocid1.user.test + id: ocid1.tenancy.dummy_value + type: oci_tenancy + properties: + data: + $ref: '#/components/schemas/CreateTenancyConfigData' + type: object + CreateTenancyConfigData: + description: The definition of `CreateTenancyConfigData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateTenancyConfigDataAttributes' + id: + description: The OCID of the tenancy to be integrated. + example: ocid1.tenancy.test + type: string + type: + $ref: '#/components/schemas/CreateTenancyConfigDataType' + required: + - type + - id + type: object + CreateTenancyConfigDataAttributes: + description: The definition of `CreateTenancyConfigDataAttributes` object. + properties: + auth_credentials: + $ref: '#/components/schemas/AuthCredentials' + config_version: + description: The config version. It is not recommended to add or change + this value, as it is determined internally. + format: int64 + type: integer + dd_compartment_id: + description: The OCID of the compartment containing Datadog managed resources. + type: string + dd_stack_id: + description: The OCID of the resource manager stack for creating Datadog + managed resources. + type: string + home_region: + description: The home region of the tenancy to be integrated. + example: us-ashburn-1 + type: string + logs_config: + $ref: '#/components/schemas/OCILogsConfig' + metrics_config: + $ref: '#/components/schemas/OCIMetricsConfig' + regions_config: + $ref: '#/components/schemas/RegionsConfig' + resource_collection_enabled: + description: Enable or disable resource collection. + type: boolean + user_ocid: + description: The OCID of the user needed to authenticate and collect data. + example: ocid1.user.test + type: string + required: + - auth_credentials + - home_region + - user_ocid + type: object + CreateTenancyConfigDataType: + default: oci_tenancy + description: OCI tenancy resource type. + enum: + - oci_tenancy + example: oci_tenancy + type: string + x-enum-varnames: + - OCI_TENANCY CreateWorkflowRequest: description: A request object for creating a new workflow. example: @@ -23246,6 +23371,43 @@ components: - id - type type: object + OCILogsConfig: + description: The definition of `OCILogsConfig` object. + properties: + compartment_tag_filters: + description: The compartment tag filters to apply to log collection. Each + value represents a Datadog tag in the format key:value. + items: + type: string + type: array + enabled: + description: Enable or disable log collection. Disabled by default. + type: boolean + enabled_services: + description: The list of services to enable for log collection. + items: + type: string + type: array + type: object + OCIMetricsConfig: + description: The definition of `OCIMetricsConfig` object. + properties: + compartment_tag_filters: + description: The compartment tag filters to apply to metric collection. + Each value represents a Datadog tag in the format key:value. + items: + type: string + type: array + enabled: + description: Enable or disable metric collection. Enabled by default for + all services. + type: boolean + excluded_services: + description: The list of services to exclude from metric collection. + items: + type: string + type: array + type: object ObservabilityPipeline: description: Top-level schema representing a pipeline. properties: @@ -28773,6 +28935,25 @@ components: x-enum-varnames: - ANY - ALL + RegionsConfig: + description: The definition of `RegionsConfig` object. + properties: + available: + description: The list of regions currently subscribed to . + items: + type: string + type: array + disabled: + description: The list of disabled regions. + items: + type: string + type: array + enabled: + description: The list of enabled regions. + items: + type: string + type: array + type: object RelationType: description: Supported relation types. enum: @@ -38229,6 +38410,124 @@ components: description: Offset type. type: string type: object + TenancyConfig: + description: The definition of `TenancyConfig` object. + example: + data: + attributes: + cost_collection_enabled: false + home_region: us-ashburn-1 + logs_config: + compartment_tag_filters: + - compartment.test + enabled: true + enabled_services: + - compute + metrics_config: + compartment_tag_filters: + - compartment.test + enabled: true + excluded_services: + - compute + resource_collection_enabled: true + user_ocid: ocid1.user.test + id: ocid1.tenancy.test + type: oci_tenancy + properties: + data: + $ref: '#/components/schemas/TenancyConfigData' + type: object + TenancyConfigData: + description: The definition of `TenancyConfigData` object. + properties: + attributes: + $ref: '#/components/schemas/TenancyConfigDataAttributes' + id: + description: The OCID of the tenancy config. + type: string + type: + $ref: '#/components/schemas/TenancyConfigDataType' + required: + - type + type: object + TenancyConfigDataAttributes: + description: The definition of `TenancyConfigDataAttributes` object. + properties: + config_version: + description: The config version. It is not recommended to add or change + this value, as it is determined internally. + format: int64 + type: integer + cost_collection_enabled: + description: Enable or disable cost collection. + type: boolean + dd_compartment_id: + description: The OCID of the compartment containing Datadog managed resources. + type: string + dd_stack_id: + description: The OCID of the resource manager stack for creating Datadog + managed resources. + type: string + home_region: + description: The home region of the tenancy to be integrated. + type: string + logs_config: + $ref: '#/components/schemas/OCILogsConfig' + metrics_config: + $ref: '#/components/schemas/OCIMetricsConfig' + regions_config: + $ref: '#/components/schemas/RegionsConfig' + resource_collection_enabled: + description: Enable or disable resource collection. + type: boolean + tenancy_name: + description: The attribute's tenancy_name. + type: string + user_ocid: + description: The OCID of the user needed to authenticate and collect data. + type: string + type: object + TenancyConfigDataType: + default: oci_tenancy + description: OCI tenancy resource type. + enum: + - oci_tenancy + example: oci_tenancy + type: string + x-enum-varnames: + - OCI_TENANCY + TenancyConfigList: + description: The definition of `TenancyConfigList` object. + example: + data: + - attributes: + config_version: 2 + home_region: us-ashburn-1 + logs_config: + compartment_tag_filters: + - compartment.test + enabled: true + enabled_services: + - compute + metrics_config: + compartment_tag_filters: + - compartment.test + enabled: true + excluded_services: + - compute + resource_collection_enabled: true + user_ocid: ocid1.user.test + id: ocid1.tenancy.test + type: oci_tenancy + properties: + data: + description: The `TenancyConfigList` data. + items: + $ref: '#/components/schemas/TenancyConfigData' + type: array + required: + - data + type: object TimeAggregation: description: 'Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. @@ -38851,6 +39150,79 @@ components: type: $ref: '#/components/schemas/RuleType' type: object + UpdateTenancyConfig: + description: The definition of `UpdateTenancyConfig` object. + example: + data: + attributes: + home_region: us-ashburn-1 + logs_config: + compartment_tag_filters: + - datadog:true + - env:prod + enabled: true + enabled_services: + - objectstorage + metrics_config: + compartment_tag_filters: + - datadog:true + - env:prod + enabled: true + excluded_services: + - oci_compute + resource_collection_enabled: true + user_ocid: ocid1.user.test + id: ocid1.tenancy.dummy_value + type: oci_tenancy + properties: + data: + $ref: '#/components/schemas/UpdateTenancyConfigData' + type: object + UpdateTenancyConfigData: + description: The definition of `UpdateTenancyConfigData` object. + properties: + attributes: + $ref: '#/components/schemas/UpdateTenancyConfigDataAttributes' + id: + description: The OCID of the tenancy to be integrated. + example: ocid1.tenancy.test + type: string + type: + $ref: '#/components/schemas/UpdateTenancyConfigDataType' + required: + - type + - id + type: object + UpdateTenancyConfigDataAttributes: + description: The definition of `UpdateTenancyConfigDataAttributes` object. + properties: + auth_credentials: + $ref: '#/components/schemas/AuthCredentials' + home_region: + description: The home region of the tenancy to be integrated. + type: string + logs_config: + $ref: '#/components/schemas/OCILogsConfig' + metrics_config: + $ref: '#/components/schemas/OCIMetricsConfig' + regions_config: + $ref: '#/components/schemas/RegionsConfig' + resource_collection_enabled: + description: Enable or disable resource collection. + type: boolean + user_ocid: + description: The OCID of the user needed to authenticate and collect data. + type: string + type: object + UpdateTenancyConfigDataType: + default: oci_tenancy + description: OCI tenancy resource type. + enum: + - oci_tenancy + example: oci_tenancy + type: string + x-enum-varnames: + - OCI_TENANCY UpdateWorkflowRequest: description: A request object for updating an existing workflow. example: @@ -47664,6 +48036,139 @@ paths: tags: - Microsoft Teams Integration x-codegen-request-body-name: body + /api/v2/integration/oci/tenancies: + get: + description: List all tenancy integrations. + operationId: GetTenancyConfigs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TenancyConfigList' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get tenancy configs + tags: + - OCI Integration + x-permission: + operator: AND + permissions: + - oci_configuration_read + post: + description: Create a new tenancy config. + operationId: CreateTenancyConfig + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTenancyConfig' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TenancyConfig' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create tenancy config + tags: + - OCI Integration + x-permission: + operator: AND + permissions: + - oci_configurations_manage + /api/v2/integration/oci/tenancies/{tenancy_ocid}: + delete: + description: Delete an existing tenancy config. + operationId: DeleteTenancyConfig + parameters: + - $ref: '#/components/parameters/TenancyOCIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete tenancy config + tags: + - OCI Integration + x-permission: + operator: AND + permissions: + - oci_configurations_manage + get: + description: Get a single tenancy config object. + operationId: GetTenancyConfig + parameters: + - $ref: '#/components/parameters/TenancyOCIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TenancyConfig' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get tenancy config + tags: + - OCI Integration + x-permission: + operator: AND + permissions: + - oci_configuration_read + patch: + description: Update an existing tenancy config. + operationId: UpdateTenancyConfig + parameters: + - $ref: '#/components/parameters/TenancyOCIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTenancyConfig' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TenancyConfig' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update tenancy config + tags: + - OCI Integration + x-permission: + operator: AND + permissions: + - oci_configuration_edit /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. @@ -62035,6 +62540,11 @@ tags: and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring +- description: 'Configure your Datadog-OCI integration directly through the Datadog + API. + + For more information, see the [OCI integration page](https://docs.datadoghq.com/integrations/oracle_cloud_infrastructure/).' + name: OCI Integration - description: Observability Pipelines allows you to collect and process logs within your own infrastructure, and then route them to downstream integrations. externalDocs: diff --git a/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..28c6be745909 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-08T15:48:41.992Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.yml b/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..6c0ecbf11223 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Create-tenancy-config-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 08 May 2025 15:48:41 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEv\n-----END PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oacnativeproduction"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oci_compute"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.dummy_value","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + private key"}]}' + 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/oci_integration/Delete-tenancy-config-returns-No-Content-response.frozen b/cassettes/features/v2/oci_integration/Delete-tenancy-config-returns-No-Content-response.frozen new file mode 100644 index 000000000000..60d7de843491 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Delete-tenancy-config-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:06.021Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Delete-tenancy-config-returns-No-Content-response.yml b/cassettes/features/v2/oci_integration/Delete-tenancy-config-returns-No-Content-response.yml new file mode 100644 index 000000000000..30b8f78e5e06 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Delete-tenancy-config-returns-No-Content-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END + PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oci_compute"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-ashburn-1","user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 May 2025 20:00:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 07 May 2025 20:00:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + 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/oci_integration/Get-tenancy-config-returns-Not-Found-response.frozen b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..5ff2a7bec63b --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:07.060Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-Not-Found-response.yml b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..a2795d188611 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.fake + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + 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/oci_integration/Get-tenancy-config-returns-OK-response.frozen b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-OK-response.frozen new file mode 100644 index 000000000000..5d4e974e175e --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:07.257Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-OK-response.yml b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-OK-response.yml new file mode 100644 index 000000000000..138b7e13a5cd --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-config-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END + PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oci_compute"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-ashburn-1","user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"config_version":2,"cost_collection_enabled":false,"home_region":"us-ashburn-1","logs_config":{"enabled":true,"compartment_tag_filters":["datadog:true","env:prod"],"enabled_services":["oci_compute"]},"metrics_config":{"enabled":true,"compartment_tag_filters":["datadog:true","env:prod"],"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + 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/oci_integration/Get-tenancy-configs-returns-OK-response.frozen b/cassettes/features/v2/oci_integration/Get-tenancy-configs-returns-OK-response.frozen new file mode 100644 index 000000000000..ad760cc0c42c --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-configs-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:07.843Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Get-tenancy-configs-returns-OK-response.yml b/cassettes/features/v2/oci_integration/Get-tenancy-configs-returns-OK-response.yml new file mode 100644 index 000000000000..353e1287b611 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Get-tenancy-configs-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END + PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oci_compute"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-ashburn-1","user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"config_version":2,"cost_collection_enabled":false,"home_region":"us-ashburn-1","logs_config":{"enabled":true,"compartment_tag_filters":["datadog:true","env:prod"],"enabled_services":["oci_compute"]},"metrics_config":{"enabled":true,"compartment_tag_filters":["datadog:true","env:prod"],"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 07 May 2025 20:00:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + 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/oci_integration/Update-tenancy-config-returns-Bad-Request-response.frozen b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..36a8dba6343c --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:08.400Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Bad-Request-response.yml b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..bae98c9d6ad0 --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Bad-Request-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:08 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END + PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oci_compute"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-ashburn-1","user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 May 2025 20:00:08 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["objectstorage"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oci_compute"]},"resource_collection_enabled":true,"user_ocid":"user.test"},"id":"ocid1.tenancy.dummy_value","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"user_ocid\" failed startswith validation"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Wed, 07 May 2025 20:00:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + 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/oci_integration/Update-tenancy-config-returns-Not-Found-response.frozen b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..329e73041a8e --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:00:09.002Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Not-Found-response.yml b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..3846ea53b55d --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:00:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["objectstorage"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oci_compute"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.fake","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.fake + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + 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/oci_integration/Update-tenancy-config-returns-OK-response.frozen b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-OK-response.frozen new file mode 100644 index 000000000000..5f8f6ecb86ac --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-07T20:23:20.166Z \ No newline at end of file diff --git a/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-OK-response.yml b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-OK-response.yml new file mode 100644 index 000000000000..c06a272ee3dd --- /dev/null +++ b/cassettes/features/v2/oci_integration/Update-tenancy-config-returns-OK-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Wed, 07 May 2025 20:23:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"auth_credentials":{"fingerprint":"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1","private_key":"-----BEGIN + PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END + PRIVATE KEY-----\n"},"config_version":2,"home_region":"us-ashburn-1","logs_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"enabled_services":["oci_compute"]},"metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":true,"excluded_services":["oacnativeproduction"]},"resource_collection_enabled":true,"user_ocid":"ocid1.user.test"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-ashburn-1","user_ocid":"ocid1.user.test"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 May 2025 20:23:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"home_region":"us-sanjose-1","metrics_config":{"compartment_tag_filters":["datadog:true","env:prod"],"enabled":false,"excluded_services":[]},"resource_collection_enabled":false,"user_ocid":"ocid1.user.test_updated"},"id":"ocid1.tenancy.test","type":"oci_tenancy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ocid1.tenancy.test","type":"oci_tenancy","attributes":{"home_region":"us-sanjose-1","user_ocid":"ocid1.user.test_updated"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 07 May 2025 20:23:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/oci-integration/CreateTenancyConfig.rb b/examples/v2/oci-integration/CreateTenancyConfig.rb new file mode 100644 index 000000000000..92a642d1bec9 --- /dev/null +++ b/examples/v2/oci-integration/CreateTenancyConfig.rb @@ -0,0 +1,42 @@ +# Create tenancy config returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new + +body = DatadogAPIClient::V2::CreateTenancyConfig.new({ + data: DatadogAPIClient::V2::CreateTenancyConfigData.new({ + attributes: DatadogAPIClient::V2::CreateTenancyConfigDataAttributes.new({ + auth_credentials: DatadogAPIClient::V2::AuthCredentials.new({ + fingerprint: "a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1", + private_key: '-----BEGIN PRIVATE KEY-----\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END PRIVATE KEY-----', + }), + config_version: 2, + home_region: "us-ashburn-1", + logs_config: DatadogAPIClient::V2::OCILogsConfig.new({ + compartment_tag_filters: [ + "datadog:true", + "env:prod", + ], + enabled: true, + enabled_services: [ + "oacnativeproduction", + ], + }), + metrics_config: DatadogAPIClient::V2::OCIMetricsConfig.new({ + compartment_tag_filters: [ + "datadog:true", + "env:prod", + ], + enabled: true, + excluded_services: [ + "oci_compute", + ], + }), + resource_collection_enabled: true, + user_ocid: "ocid1.user.test", + }), + id: "ocid1.tenancy.dummy_value", + type: DatadogAPIClient::V2::CreateTenancyConfigDataType::OCI_TENANCY, + }), +}) +p api_instance.create_tenancy_config(body) diff --git a/examples/v2/oci-integration/DeleteTenancyConfig.rb b/examples/v2/oci-integration/DeleteTenancyConfig.rb new file mode 100644 index 000000000000..e88a322f1b55 --- /dev/null +++ b/examples/v2/oci-integration/DeleteTenancyConfig.rb @@ -0,0 +1,8 @@ +# Delete tenancy config returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = ENV["OCI_TENANCY_DATA_ID"] +api_instance.delete_tenancy_config(OCI_TENANCY_DATA_ID) diff --git a/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.rb b/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.rb new file mode 100644 index 000000000000..06013c276dfb --- /dev/null +++ b/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.rb @@ -0,0 +1,5 @@ +# Delete tenancy config for non-existing tenancy returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new +api_instance.delete_tenancy_config("ocid1.tenancy.fake") diff --git a/examples/v2/oci-integration/GetTenancyConfig.rb b/examples/v2/oci-integration/GetTenancyConfig.rb new file mode 100644 index 000000000000..b0d46740b18a --- /dev/null +++ b/examples/v2/oci-integration/GetTenancyConfig.rb @@ -0,0 +1,8 @@ +# Get tenancy config returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = ENV["OCI_TENANCY_DATA_ID"] +p api_instance.get_tenancy_config(OCI_TENANCY_DATA_ID) diff --git a/examples/v2/oci-integration/GetTenancyConfigs.rb b/examples/v2/oci-integration/GetTenancyConfigs.rb new file mode 100644 index 000000000000..680f29c5bd71 --- /dev/null +++ b/examples/v2/oci-integration/GetTenancyConfigs.rb @@ -0,0 +1,5 @@ +# Get tenancy configs returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new +p api_instance.get_tenancy_configs() diff --git a/examples/v2/oci-integration/UpdateTenancyConfig.rb b/examples/v2/oci-integration/UpdateTenancyConfig.rb new file mode 100644 index 000000000000..36092abc4f35 --- /dev/null +++ b/examples/v2/oci-integration/UpdateTenancyConfig.rb @@ -0,0 +1,28 @@ +# Update tenancy config returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OCIIntegrationAPI.new + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = ENV["OCI_TENANCY_DATA_ID"] + +body = DatadogAPIClient::V2::UpdateTenancyConfig.new({ + data: DatadogAPIClient::V2::UpdateTenancyConfigData.new({ + attributes: DatadogAPIClient::V2::UpdateTenancyConfigDataAttributes.new({ + home_region: "us-sanjose-1", + metrics_config: DatadogAPIClient::V2::OCIMetricsConfig.new({ + compartment_tag_filters: [ + "datadog:true", + "env:prod", + ], + enabled: false, + excluded_services: [], + }), + resource_collection_enabled: false, + user_ocid: "ocid1.user.test_updated", + }), + id: OCI_TENANCY_DATA_ID, + type: DatadogAPIClient::V2::UpdateTenancyConfigDataType::OCI_TENANCY, + }), +}) +p api_instance.update_tenancy_config(OCI_TENANCY_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 6dfc8612f2dd..b73bf0bdfaed 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1745,6 +1745,19 @@ "handle_id" => "String", "body" => "MicrosoftTeamsUpdateWorkflowsWebhookHandleRequest", }, + "v2.CreateTenancyConfig" => { + "body" => "CreateTenancyConfig", + }, + "v2.DeleteTenancyConfig" => { + "tenancy_ocid" => "String", + }, + "v2.GetTenancyConfig" => { + "tenancy_ocid" => "String", + }, + "v2.UpdateTenancyConfig" => { + "tenancy_ocid" => "String", + "body" => "UpdateTenancyConfig", + }, "v2.CreateOpsgenieService" => { "body" => "OpsgenieServiceCreateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index 696fef088cf8..7b381db87b25 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -312,6 +312,18 @@ "tag": "Microsoft Teams Integration", "operationId": "CreateWorkflowsWebhookHandle" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"auth_credentials\": {\n \"fingerprint\": \"c8:e5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmMo2jwJXWTt0y\\nk+X6biZycflZSwOAP/iNeAZPTWwhYxj9pxDvd5OfiIe+o/7eupk/3q+fRsSaztPn\\nJwI/JnbQz5IT5miLi/apIozg870FFxjrgRxSGjo7BNH0dLKITc5nLDLBnOEzxR2Y\\nk9+0dFaiNlcodFULlg75trqbILRSc6jn9Tp9G8C5e9cj+LYQuUu2JwIqhCJqcNcU\\nt+lRL5odBJhZ85KlugKyUg6LN3VQIdOpTtPBMXYA1oBgDCbe5Rw5yzgnd0KtSFf3\\nGOmLfR95gQshLfbGavLOTh9ioaOj/2hT9HrsEe1VWgX3m1WibqKiPc4OA4BGGToN\\n9tzN/t89AgMBAAECggEAVFKD4JherXwX6Ih3f6cRZLGFBJP1s8VBM225LdUnTo07\\n6b4w7n6p7KBV1xjXwGPGS0yNqG88YxsbEkWNc0Ltt6YJBIW7d0nNHSVFewDPX1zH\\nrP01xEZAUx9v8uqehl+LoHchTXBuJlkVWgt0zdbU+bo+YG0dlSJOeM4IQZrHQqlQ\\ne4PNk73rot9NSqiKQFXUroaoVPTkUHb3idpLX60K3MgIBoAm4DpJ6cMItb4hyHv5\\npNZhHQbr9Eciz2tj+OhQTYKCrAd0gJgl0tC+6L3kzkmiYE3ceGphqWfI9bX52Y96\\nwpgAtYi6o8wTykgRLabLc6vSQ9RegWEh7P8iSAvAlQKBgQDX5wJhYeWDdG4uPqLC\\nX3EtnR3y5zYgOd7cVtMr1DIvXa4I8PSIOC4Wnb/5A1S03dJ2e8GJ/qSbl5R2fsDr\\nXhjIm/KeBPI9p2dVZM8fPoWppR3SgDaHY5qxAED111DnEZuTMl5BO87QZXurTSiF\\nfbGsWaVqdVieRAQ3b5DEkC9TSwKBgQDFEFgui7iyPhQaQafsjnVbWyrWF821xjTG\\nb6Bo4FO97c9pw/tbkpfM+dcOU4SsZL8HjwGBUhUsDsVOX7m/sWRjZqNM5t/VR+52\\n9ygIPEjNyh0b3aARgn8AQ8n+RZvl1Z2A32KCO3MFzhpVKnv2sdSc1TNHQkuJH/rq\\neUAm3El6lwKBgQCK8w+jIOAXRB2NAZ66PbaXRqD5rTg2cUguwmpRsNVDiqTw+DJI\\nYO+4enoMhspDROeofWlHqGzD/j/8KwN59ys4ILV6YXCNoWltmd17HD/luHCDAyUU\\n6VOrSqCEF7jnnXtktmvWy+kEUevPiW7kyspIQ8GjzDXmVZvpGZIwDyOGFQKBgGtS\\nl3PiDFimjnQuRbIDc86pPA8VL6dLpvpbWNVFNtY9abSEU6RvldTATGs0+RCaXZ9U\\nNtGjTnyMHtCsOZE4nx+zikQbiNOzNR/9QwQZMN1Csc+3R7HBjEEsqhmc92aYjArf\\nndqnXeFPee/gD1svRkeTpTWt2U146UJBfrqrRilJAoGAQp7FtEtps5I9xK92AVpD\\nHj2p1JNKzLCRtWQ8j4jthKqR0iTQ9SwQyjiAvcKc7HdMaG11gmr5XbmKAzelVC+f\\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\\n/aU4/sNo2f8epM9l7QGiCtY=\\n-----END PRIVATE KEY-----\\n\"\n },\n \"config_version\": 2,\n \"home_region\": \"us-ashburn-1\",\n \"logs_config\": {\n \"compartment_tag_filters\": [\n \"datadog:true\",\n \"env:prod\"\n ],\n \"enabled\": true,\n \"enabled_services\": [\"oci_compute\"]\n },\n \"metrics_config\": {\n \"compartment_tag_filters\": [\n \"datadog:true\",\n \"env:prod\"\n ],\n \"enabled\": true,\n \"excluded_services\": [\"oacnativeproduction\"]\n },\n \"resource_collection_enabled\": true,\n \"user_ocid\": \"ocid1.user.test\"\n },\n \"id\": \"ocid1.tenancy.test\",\n \"type\": \"oci_tenancy\"\n }\n}\n" + } + ], + "step": "there is a valid \"oci_tenancy\" resource in the system", + "key": "oci_tenancy", + "tag": "OCI Integration", + "operationId": "CreateTenancyConfig" + }, { "parameters": [ { diff --git a/features/v2/oci_integration.feature b/features/v2/oci_integration.feature new file mode 100644 index 000000000000..d3c1beffb0dd --- /dev/null +++ b/features/v2/oci_integration.feature @@ -0,0 +1,106 @@ +@endpoint(oci-integration) @endpoint(oci-integration-v2) +Feature: OCI Integration + Configure your Datadog-OCI integration directly through the Datadog API. + For more information, see the [OCI integration page](https://docs.datadogh + q.com/integrations/oracle_cloud_infrastructure/). + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OCIIntegration" API + + @team:DataDog/emerging-cloud-integrations + Scenario: Create tenancy config returns "Bad Request" response + Given new "CreateTenancyConfig" request + And body with value {"data": {"attributes": {"auth_credentials": {"fingerprint": "a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEv\n-----END PRIVATE KEY-----\n"}, "config_version": 2, "home_region": "us-ashburn-1", "logs_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "enabled_services": ["oacnativeproduction"]}, "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "excluded_services": ["oci_compute"]}, "resource_collection_enabled": true, "user_ocid": "ocid1.user.test"}, "id": "ocid1.tenancy.dummy_value", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/emerging-cloud-integrations + Scenario: Create tenancy config returns "Conflict" response + Given new "CreateTenancyConfig" request + And body with value {"data": {"attributes": {"auth_credentials": {"fingerprint": "a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1", "private_key": "-----BEGIN PRIVATE KEY-----\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END PRIVATE KEY-----"}, "config_version": 2, "home_region": "us-ashburn-1", "logs_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "enabled_services": ["oacnativeproduction"]}, "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "excluded_services": ["oci_compute"]}, "resource_collection_enabled": true, "user_ocid": "ocid1.user.test"}, "id": "ocid1.tenancy.dummy_value", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/emerging-cloud-integrations + Scenario: Create tenancy config returns "Created" response + Given new "CreateTenancyConfig" request + And body with value {"data": {"attributes": {"auth_credentials": {"fingerprint": "a7:b5:54:f2:da:a2:d7:b0:ed:f4:79:47:93:64:12:b1", "private_key": "-----BEGIN PRIVATE KEY-----\no9kEwoumo8yHVn5Ztp4F2cxaD6+MzSJ/I6WesPyePUD7sPeorXByg1UNOXyzqDub\n/aU4/sNo2f8epM9l7QGiCtY=\n-----END PRIVATE KEY-----"}, "config_version": 2, "home_region": "us-ashburn-1", "logs_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "enabled_services": ["oacnativeproduction"]}, "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "excluded_services": ["oci_compute"]}, "resource_collection_enabled": true, "user_ocid": "ocid1.user.test"}, "id": "ocid1.tenancy.dummy_value", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 201 Created + + @skip @team:DataDog/emerging-cloud-integrations + Scenario: Delete tenancy config for non-existing tenancy returns "No Content" response + Given new "DeleteTenancyConfig" request + And request contains "tenancy_ocid" parameter with value "ocid1.tenancy.fake" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/emerging-cloud-integrations + Scenario: Delete tenancy config returns "No Content" response + Given there is a valid "oci_tenancy" resource in the system + And new "DeleteTenancyConfig" request + And request contains "tenancy_ocid" parameter from "oci_tenancy.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/emerging-cloud-integrations + Scenario: Delete tenancy config returns "Not Found" response + Given new "DeleteTenancyConfig" request + And request contains "tenancy_ocid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/emerging-cloud-integrations + Scenario: Get tenancy config returns "Not Found" response + Given new "GetTenancyConfig" request + And request contains "tenancy_ocid" parameter with value "ocid1.tenancy.fake" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/emerging-cloud-integrations + Scenario: Get tenancy config returns "OK" response + Given there is a valid "oci_tenancy" resource in the system + And new "GetTenancyConfig" request + And request contains "tenancy_ocid" parameter from "oci_tenancy.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{oci_tenancy.data.id}}" + + @team:DataDog/emerging-cloud-integrations + Scenario: Get tenancy configs returns "OK" response + Given there is a valid "oci_tenancy" resource in the system + And new "GetTenancyConfigs" request + When the request is sent + Then the response status is 200 OK + And the response "data[0].id" is equal to "{{oci_tenancy.data.id}}" + + @team:DataDog/emerging-cloud-integrations + Scenario: Update tenancy config returns "Bad Request" response + Given there is a valid "oci_tenancy" resource in the system + And new "UpdateTenancyConfig" request + And request contains "tenancy_ocid" parameter from "oci_tenancy.data.id" + And body with value {"data": {"attributes": {"home_region": "us-ashburn-1", "logs_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "enabled_services": ["objectstorage"]}, "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "excluded_services": ["oci_compute"]}, "resource_collection_enabled": true, "user_ocid": "user.test"}, "id": "ocid1.tenancy.dummy_value", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/emerging-cloud-integrations + Scenario: Update tenancy config returns "Not Found" response + Given new "UpdateTenancyConfig" request + And request contains "tenancy_ocid" parameter with value "ocid1.tenancy.fake" + And body with value {"data": {"attributes": {"home_region": "us-ashburn-1", "logs_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "enabled_services": ["objectstorage"]}, "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": true, "excluded_services": ["oci_compute"]}, "resource_collection_enabled": true, "user_ocid": "ocid1.user.test"}, "id": "ocid1.tenancy.fake", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/emerging-cloud-integrations + Scenario: Update tenancy config returns "OK" response + Given there is a valid "oci_tenancy" resource in the system + And new "UpdateTenancyConfig" request + And request contains "tenancy_ocid" parameter from "oci_tenancy.data.id" + And body with value {"data": {"attributes": {"home_region": "us-sanjose-1", "metrics_config": {"compartment_tag_filters": ["datadog:true", "env:prod"], "enabled": false, "excluded_services": []}, "resource_collection_enabled": false, "user_ocid": "ocid1.user.test_updated"}, "id": "{{oci_tenancy.data.id}}", "type": "oci_tenancy"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{oci_tenancy.data.id}}" + And the response "data.attributes.user_ocid" is equal to "{{oci_tenancy.data.attributes.user_ocid}}_updated" + And the response "data.attributes.home_region" is equal to "us-sanjose-1" diff --git a/features/v2/undo.json b/features/v2/undo.json index 6f0ee3848a72..4616e6f62513 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1234,6 +1234,43 @@ "type": "idempotent" } }, + "GetTenancyConfigs": { + "tag": "OCI Integration", + "undo": { + "type": "safe" + } + }, + "CreateTenancyConfig": { + "tag": "OCI Integration", + "undo": { + "operationId": "DeleteTenancyConfig", + "parameters": [ + { + "name": "tenancy_ocid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteTenancyConfig": { + "tag": "OCI Integration", + "undo": { + "type": "idempotent" + } + }, + "GetTenancyConfig": { + "tag": "OCI Integration", + "undo": { + "type": "safe" + } + }, + "UpdateTenancyConfig": { + "tag": "OCI Integration", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 068027e45533..2689678db02a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1059,6 +1059,7 @@ def overrides "v2.audit_logs_search_events_request" => "AuditLogsSearchEventsRequest", "v2.audit_logs_sort" => "AuditLogsSort", "v2.audit_logs_warning" => "AuditLogsWarning", + "v2.auth_credentials" => "AuthCredentials", "v2.authn_mapping" => "AuthNMapping", "v2.authn_mapping_attributes" => "AuthNMappingAttributes", "v2.authn_mapping_create_attributes" => "AuthNMappingCreateAttributes", @@ -1463,6 +1464,10 @@ def overrides "v2.create_rule_request_data" => "CreateRuleRequestData", "v2.create_rule_response" => "CreateRuleResponse", "v2.create_rule_response_data" => "CreateRuleResponseData", + "v2.create_tenancy_config" => "CreateTenancyConfig", + "v2.create_tenancy_config_data" => "CreateTenancyConfigData", + "v2.create_tenancy_config_data_attributes" => "CreateTenancyConfigDataAttributes", + "v2.create_tenancy_config_data_type" => "CreateTenancyConfigDataType", "v2.create_workflow_request" => "CreateWorkflowRequest", "v2.create_workflow_response" => "CreateWorkflowResponse", "v2.creator" => "Creator", @@ -2520,6 +2525,8 @@ def overrides "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", "v2.observability_pipeline_tls" => "ObservabilityPipelineTls", + "v2.oci_logs_config" => "OCILogsConfig", + "v2.oci_metrics_config" => "OCIMetricsConfig", "v2.okta_account" => "OktaAccount", "v2.okta_account_attributes" => "OktaAccountAttributes", "v2.okta_account_request" => "OktaAccountRequest", @@ -2634,6 +2641,7 @@ def overrides "v2.query_sort_order" => "QuerySortOrder", "v2.readiness_gate" => "ReadinessGate", "v2.readiness_gate_threshold_type" => "ReadinessGateThresholdType", + "v2.regions_config" => "RegionsConfig", "v2.relationship_item" => "RelationshipItem", "v2.relationship_to_incident_attachment" => "RelationshipToIncidentAttachment", "v2.relationship_to_incident_attachment_data" => "RelationshipToIncidentAttachmentData", @@ -3282,6 +3290,11 @@ def overrides "v2.team_update_attributes" => "TeamUpdateAttributes", "v2.team_update_relationships" => "TeamUpdateRelationships", "v2.team_update_request" => "TeamUpdateRequest", + "v2.tenancy_config" => "TenancyConfig", + "v2.tenancy_config_data" => "TenancyConfigData", + "v2.tenancy_config_data_attributes" => "TenancyConfigDataAttributes", + "v2.tenancy_config_data_type" => "TenancyConfigDataType", + "v2.tenancy_config_list" => "TenancyConfigList", "v2.time_restriction" => "TimeRestriction", "v2.time_restrictions" => "TimeRestrictions", "v2.timeseries_formula_query_request" => "TimeseriesFormulaQueryRequest", @@ -3321,6 +3334,10 @@ def overrides "v2.update_rule_request_data" => "UpdateRuleRequestData", "v2.update_rule_response" => "UpdateRuleResponse", "v2.update_rule_response_data" => "UpdateRuleResponseData", + "v2.update_tenancy_config" => "UpdateTenancyConfig", + "v2.update_tenancy_config_data" => "UpdateTenancyConfigData", + "v2.update_tenancy_config_data_attributes" => "UpdateTenancyConfigDataAttributes", + "v2.update_tenancy_config_data_type" => "UpdateTenancyConfigDataType", "v2.update_workflow_request" => "UpdateWorkflowRequest", "v2.update_workflow_response" => "UpdateWorkflowResponse", "v2.upsert_catalog_entity_request" => "UpsertCatalogEntityRequest", @@ -3502,6 +3519,7 @@ def overrides "v2.monitors_api" => "MonitorsAPI", "v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI", "v2.observability_pipelines_api" => "ObservabilityPipelinesAPI", + "v2.oci_integration_api" => "OCIIntegrationAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", "v2.on_call_api" => "OnCallAPI", "v2.on_call_paging_api" => "OnCallPagingAPI", diff --git a/lib/datadog_api_client/v2/api/oci_integration_api.rb b/lib/datadog_api_client/v2/api/oci_integration_api.rb new file mode 100644 index 000000000000..de45fda3d31d --- /dev/null +++ b/lib/datadog_api_client/v2/api/oci_integration_api.rb @@ -0,0 +1,355 @@ +=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 OCIIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create tenancy config. + # + # @see #create_tenancy_config_with_http_info + def create_tenancy_config(body, opts = {}) + data, _status_code, _headers = create_tenancy_config_with_http_info(body, opts) + data + end + + # Create tenancy config. + # + # Create a new tenancy config. + # + # @param body [CreateTenancyConfig] + # @param opts [Hash] the optional parameters + # @return [Array<(TenancyConfig, Integer, Hash)>] TenancyConfig data, response status code and response headers + def create_tenancy_config_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OCIIntegrationAPI.create_tenancy_config ...' + 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 OCIIntegrationAPI.create_tenancy_config" + end + # resource path + local_var_path = '/api/v2/integration/oci/tenancies' + + # 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] || 'TenancyConfig' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_tenancy_config, + :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: OCIIntegrationAPI#create_tenancy_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete tenancy config. + # + # @see #delete_tenancy_config_with_http_info + def delete_tenancy_config(tenancy_ocid, opts = {}) + delete_tenancy_config_with_http_info(tenancy_ocid, opts) + nil + end + + # Delete tenancy config. + # + # Delete an existing tenancy config. + # + # @param tenancy_ocid [String] Unique tenancy OCID of the OCI integration config. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_tenancy_config_with_http_info(tenancy_ocid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OCIIntegrationAPI.delete_tenancy_config ...' + end + # verify the required parameter 'tenancy_ocid' is set + if @api_client.config.client_side_validation && tenancy_ocid.nil? + fail ArgumentError, "Missing the required parameter 'tenancy_ocid' when calling OCIIntegrationAPI.delete_tenancy_config" + end + # resource path + local_var_path = '/api/v2/integration/oci/tenancies/{tenancy_ocid}'.sub('{tenancy_ocid}', CGI.escape(tenancy_ocid.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_tenancy_config, + :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: OCIIntegrationAPI#delete_tenancy_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get tenancy config. + # + # @see #get_tenancy_config_with_http_info + def get_tenancy_config(tenancy_ocid, opts = {}) + data, _status_code, _headers = get_tenancy_config_with_http_info(tenancy_ocid, opts) + data + end + + # Get tenancy config. + # + # Get a single tenancy config object. + # + # @param tenancy_ocid [String] Unique tenancy OCID of the OCI integration config. + # @param opts [Hash] the optional parameters + # @return [Array<(TenancyConfig, Integer, Hash)>] TenancyConfig data, response status code and response headers + def get_tenancy_config_with_http_info(tenancy_ocid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OCIIntegrationAPI.get_tenancy_config ...' + end + # verify the required parameter 'tenancy_ocid' is set + if @api_client.config.client_side_validation && tenancy_ocid.nil? + fail ArgumentError, "Missing the required parameter 'tenancy_ocid' when calling OCIIntegrationAPI.get_tenancy_config" + end + # resource path + local_var_path = '/api/v2/integration/oci/tenancies/{tenancy_ocid}'.sub('{tenancy_ocid}', CGI.escape(tenancy_ocid.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] || 'TenancyConfig' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_tenancy_config, + :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: OCIIntegrationAPI#get_tenancy_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get tenancy configs. + # + # @see #get_tenancy_configs_with_http_info + def get_tenancy_configs(opts = {}) + data, _status_code, _headers = get_tenancy_configs_with_http_info(opts) + data + end + + # Get tenancy configs. + # + # List all tenancy integrations. + # + # @param opts [Hash] the optional parameters + # @return [Array<(TenancyConfigList, Integer, Hash)>] TenancyConfigList data, response status code and response headers + def get_tenancy_configs_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OCIIntegrationAPI.get_tenancy_configs ...' + end + # resource path + local_var_path = '/api/v2/integration/oci/tenancies' + + # 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] || 'TenancyConfigList' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_tenancy_configs, + :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: OCIIntegrationAPI#get_tenancy_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update tenancy config. + # + # @see #update_tenancy_config_with_http_info + def update_tenancy_config(tenancy_ocid, body, opts = {}) + data, _status_code, _headers = update_tenancy_config_with_http_info(tenancy_ocid, body, opts) + data + end + + # Update tenancy config. + # + # Update an existing tenancy config. + # + # @param tenancy_ocid [String] Unique tenancy OCID of the OCI integration config. + # @param body [UpdateTenancyConfig] + # @param opts [Hash] the optional parameters + # @return [Array<(TenancyConfig, Integer, Hash)>] TenancyConfig data, response status code and response headers + def update_tenancy_config_with_http_info(tenancy_ocid, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OCIIntegrationAPI.update_tenancy_config ...' + end + # verify the required parameter 'tenancy_ocid' is set + if @api_client.config.client_side_validation && tenancy_ocid.nil? + fail ArgumentError, "Missing the required parameter 'tenancy_ocid' when calling OCIIntegrationAPI.update_tenancy_config" + 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 OCIIntegrationAPI.update_tenancy_config" + end + # resource path + local_var_path = '/api/v2/integration/oci/tenancies/{tenancy_ocid}'.sub('{tenancy_ocid}', CGI.escape(tenancy_ocid.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] || 'TenancyConfig' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_tenancy_config, + :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: OCIIntegrationAPI#update_tenancy_config\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/auth_credentials.rb b/lib/datadog_api_client/v2/models/auth_credentials.rb new file mode 100644 index 000000000000..51de87af72b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/auth_credentials.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 + # The auth credentials of the user. Consists of a public key fingerprint and private key. + class AuthCredentials + include BaseGenericModel + + # The public key fingerprint. + attr_reader :fingerprint + + # The `RSA` private key in `PEM` format. + attr_reader :private_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fingerprint' => :'fingerprint', + :'private_key' => :'private_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fingerprint' => :'String', + :'private_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::AuthCredentials` 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?(:'fingerprint') + self.fingerprint = attributes[:'fingerprint'] + end + + if attributes.key?(:'private_key') + self.private_key = attributes[:'private_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 @fingerprint.nil? + return false if @private_key.nil? + true + end + + # Custom attribute writer method with validation + # @param fingerprint [Object] Object to be assigned + # @!visibility private + def fingerprint=(fingerprint) + if fingerprint.nil? + fail ArgumentError, 'invalid value for "fingerprint", fingerprint cannot be nil.' + end + @fingerprint = fingerprint + end + + # Custom attribute writer method with validation + # @param private_key [Object] Object to be assigned + # @!visibility private + def private_key=(private_key) + if private_key.nil? + fail ArgumentError, 'invalid value for "private_key", private_key cannot be nil.' + end + @private_key = private_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 && + fingerprint == o.fingerprint && + private_key == o.private_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fingerprint, private_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_tenancy_config.rb b/lib/datadog_api_client/v2/models/create_tenancy_config.rb new file mode 100644 index 000000000000..72b96af892e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_tenancy_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 + # The definition of `CreateTenancyConfig` object. + class CreateTenancyConfig + include BaseGenericModel + + # The definition of `CreateTenancyConfigData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateTenancyConfigData' + } + 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::CreateTenancyConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_tenancy_config_data.rb b/lib/datadog_api_client/v2/models/create_tenancy_config_data.rb new file mode 100644 index 000000000000..2aaa7d5275eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_tenancy_config_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 + # The definition of `CreateTenancyConfigData` object. + class CreateTenancyConfigData + include BaseGenericModel + + # The definition of `CreateTenancyConfigDataAttributes` object. + attr_accessor :attributes + + # The OCID of the tenancy to be integrated. + attr_reader :id + + # OCI tenancy 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' => :'CreateTenancyConfigDataAttributes', + :'id' => :'String', + :'type' => :'CreateTenancyConfigDataType' + } + 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::CreateTenancyConfigData` 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_tenancy_config_data_attributes.rb b/lib/datadog_api_client/v2/models/create_tenancy_config_data_attributes.rb new file mode 100644 index 000000000000..8fa23fc76b20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_tenancy_config_data_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 definition of `CreateTenancyConfigDataAttributes` object. + class CreateTenancyConfigDataAttributes + include BaseGenericModel + + # The auth credentials of the user. Consists of a public key fingerprint and private key. + attr_reader :auth_credentials + + # The config version. It is not recommended to add or change this value, as it is determined internally. + attr_accessor :config_version + + # The OCID of the compartment containing Datadog managed resources. + attr_accessor :dd_compartment_id + + # The OCID of the resource manager stack for creating Datadog managed resources. + attr_accessor :dd_stack_id + + # The home region of the tenancy to be integrated. + attr_reader :home_region + + # The definition of `OCILogsConfig` object. + attr_accessor :logs_config + + # The definition of `OCIMetricsConfig` object. + attr_accessor :metrics_config + + # The definition of `RegionsConfig` object. + attr_accessor :regions_config + + # Enable or disable resource collection. + attr_accessor :resource_collection_enabled + + # The OCID of the user needed to authenticate and collect data. + attr_reader :user_ocid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth_credentials' => :'auth_credentials', + :'config_version' => :'config_version', + :'dd_compartment_id' => :'dd_compartment_id', + :'dd_stack_id' => :'dd_stack_id', + :'home_region' => :'home_region', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'regions_config' => :'regions_config', + :'resource_collection_enabled' => :'resource_collection_enabled', + :'user_ocid' => :'user_ocid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth_credentials' => :'AuthCredentials', + :'config_version' => :'Integer', + :'dd_compartment_id' => :'String', + :'dd_stack_id' => :'String', + :'home_region' => :'String', + :'logs_config' => :'OCILogsConfig', + :'metrics_config' => :'OCIMetricsConfig', + :'regions_config' => :'RegionsConfig', + :'resource_collection_enabled' => :'Boolean', + :'user_ocid' => :'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::CreateTenancyConfigDataAttributes` 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?(:'auth_credentials') + self.auth_credentials = attributes[:'auth_credentials'] + end + + if attributes.key?(:'config_version') + self.config_version = attributes[:'config_version'] + end + + if attributes.key?(:'dd_compartment_id') + self.dd_compartment_id = attributes[:'dd_compartment_id'] + end + + if attributes.key?(:'dd_stack_id') + self.dd_stack_id = attributes[:'dd_stack_id'] + end + + if attributes.key?(:'home_region') + self.home_region = attributes[:'home_region'] + 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?(:'regions_config') + self.regions_config = attributes[:'regions_config'] + end + + if attributes.key?(:'resource_collection_enabled') + self.resource_collection_enabled = attributes[:'resource_collection_enabled'] + end + + if attributes.key?(:'user_ocid') + self.user_ocid = attributes[:'user_ocid'] + 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_credentials.nil? + return false if @home_region.nil? + return false if @user_ocid.nil? + true + end + + # Custom attribute writer method with validation + # @param auth_credentials [Object] Object to be assigned + # @!visibility private + def auth_credentials=(auth_credentials) + if auth_credentials.nil? + fail ArgumentError, 'invalid value for "auth_credentials", auth_credentials cannot be nil.' + end + @auth_credentials = auth_credentials + end + + # Custom attribute writer method with validation + # @param home_region [Object] Object to be assigned + # @!visibility private + def home_region=(home_region) + if home_region.nil? + fail ArgumentError, 'invalid value for "home_region", home_region cannot be nil.' + end + @home_region = home_region + end + + # Custom attribute writer method with validation + # @param user_ocid [Object] Object to be assigned + # @!visibility private + def user_ocid=(user_ocid) + if user_ocid.nil? + fail ArgumentError, 'invalid value for "user_ocid", user_ocid cannot be nil.' + end + @user_ocid = user_ocid + 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 && + auth_credentials == o.auth_credentials && + config_version == o.config_version && + dd_compartment_id == o.dd_compartment_id && + dd_stack_id == o.dd_stack_id && + home_region == o.home_region && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + regions_config == o.regions_config && + resource_collection_enabled == o.resource_collection_enabled && + user_ocid == o.user_ocid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth_credentials, config_version, dd_compartment_id, dd_stack_id, home_region, logs_config, metrics_config, regions_config, resource_collection_enabled, user_ocid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_tenancy_config_data_type.rb b/lib/datadog_api_client/v2/models/create_tenancy_config_data_type.rb new file mode 100644 index 000000000000..5c46f1498c7a --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_tenancy_config_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 + # OCI tenancy resource type. + class CreateTenancyConfigDataType + include BaseEnumModel + + OCI_TENANCY = "oci_tenancy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/oci_logs_config.rb b/lib/datadog_api_client/v2/models/oci_logs_config.rb new file mode 100644 index 000000000000..c3e9b07edf8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/oci_logs_config.rb @@ -0,0 +1,129 @@ +=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 definition of `OCILogsConfig` object. + class OCILogsConfig + include BaseGenericModel + + # The compartment tag filters to apply to log collection. Each value represents a Datadog tag in the format key:value. + attr_accessor :compartment_tag_filters + + # Enable or disable log collection. Disabled by default. + attr_accessor :enabled + + # The list of services to enable for log collection. + attr_accessor :enabled_services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compartment_tag_filters' => :'compartment_tag_filters', + :'enabled' => :'enabled', + :'enabled_services' => :'enabled_services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compartment_tag_filters' => :'Array', + :'enabled' => :'Boolean', + :'enabled_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::OCILogsConfig` 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?(:'compartment_tag_filters') + if (value = attributes[:'compartment_tag_filters']).is_a?(Array) + self.compartment_tag_filters = value + end + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'enabled_services') + if (value = attributes[:'enabled_services']).is_a?(Array) + self.enabled_services = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + compartment_tag_filters == o.compartment_tag_filters && + enabled == o.enabled && + enabled_services == o.enabled_services && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compartment_tag_filters, enabled, enabled_services, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/oci_metrics_config.rb b/lib/datadog_api_client/v2/models/oci_metrics_config.rb new file mode 100644 index 000000000000..84140ab6e1d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/oci_metrics_config.rb @@ -0,0 +1,129 @@ +=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 definition of `OCIMetricsConfig` object. + class OCIMetricsConfig + include BaseGenericModel + + # The compartment tag filters to apply to metric collection. Each value represents a Datadog tag in the format key:value. + attr_accessor :compartment_tag_filters + + # Enable or disable metric collection. Enabled by default for all services. + attr_accessor :enabled + + # The list of services to exclude from metric collection. + attr_accessor :excluded_services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compartment_tag_filters' => :'compartment_tag_filters', + :'enabled' => :'enabled', + :'excluded_services' => :'excluded_services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compartment_tag_filters' => :'Array', + :'enabled' => :'Boolean', + :'excluded_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::OCIMetricsConfig` 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?(:'compartment_tag_filters') + if (value = attributes[:'compartment_tag_filters']).is_a?(Array) + self.compartment_tag_filters = value + end + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'excluded_services') + if (value = attributes[:'excluded_services']).is_a?(Array) + self.excluded_services = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + compartment_tag_filters == o.compartment_tag_filters && + enabled == o.enabled && + excluded_services == o.excluded_services && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compartment_tag_filters, enabled, excluded_services, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/regions_config.rb b/lib/datadog_api_client/v2/models/regions_config.rb new file mode 100644 index 000000000000..d7b8704f769d --- /dev/null +++ b/lib/datadog_api_client/v2/models/regions_config.rb @@ -0,0 +1,131 @@ +=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 definition of `RegionsConfig` object. + class RegionsConfig + include BaseGenericModel + + # The list of regions currently subscribed to . + attr_accessor :available + + # The list of disabled regions. + attr_accessor :disabled + + # The list of enabled regions. + attr_accessor :enabled + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'available' => :'available', + :'disabled' => :'disabled', + :'enabled' => :'enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'available' => :'Array', + :'disabled' => :'Array', + :'enabled' => :'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::RegionsConfig` 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?(:'available') + if (value = attributes[:'available']).is_a?(Array) + self.available = value + end + end + + if attributes.key?(:'disabled') + if (value = attributes[:'disabled']).is_a?(Array) + self.disabled = value + end + end + + if attributes.key?(:'enabled') + if (value = attributes[:'enabled']).is_a?(Array) + self.enabled = 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 && + available == o.available && + disabled == o.disabled && + enabled == o.enabled && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [available, disabled, enabled, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tenancy_config.rb b/lib/datadog_api_client/v2/models/tenancy_config.rb new file mode 100644 index 000000000000..110015e600b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tenancy_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 + # The definition of `TenancyConfig` object. + class TenancyConfig + include BaseGenericModel + + # The definition of `TenancyConfigData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TenancyConfigData' + } + 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::TenancyConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tenancy_config_data.rb b/lib/datadog_api_client/v2/models/tenancy_config_data.rb new file mode 100644 index 000000000000..a2383820f6f2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tenancy_config_data.rb @@ -0,0 +1,143 @@ +=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 definition of `TenancyConfigData` object. + class TenancyConfigData + include BaseGenericModel + + # The definition of `TenancyConfigDataAttributes` object. + attr_accessor :attributes + + # The OCID of the tenancy config. + attr_accessor :id + + # OCI tenancy 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' => :'TenancyConfigDataAttributes', + :'id' => :'String', + :'type' => :'TenancyConfigDataType' + } + 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::TenancyConfigData` 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 @type.nil? + true + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tenancy_config_data_attributes.rb b/lib/datadog_api_client/v2/models/tenancy_config_data_attributes.rb new file mode 100644 index 000000000000..17f0ff0a06e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tenancy_config_data_attributes.rb @@ -0,0 +1,205 @@ +=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 definition of `TenancyConfigDataAttributes` object. + class TenancyConfigDataAttributes + include BaseGenericModel + + # The config version. It is not recommended to add or change this value, as it is determined internally. + attr_accessor :config_version + + # Enable or disable cost collection. + attr_accessor :cost_collection_enabled + + # The OCID of the compartment containing Datadog managed resources. + attr_accessor :dd_compartment_id + + # The OCID of the resource manager stack for creating Datadog managed resources. + attr_accessor :dd_stack_id + + # The home region of the tenancy to be integrated. + attr_accessor :home_region + + # The definition of `OCILogsConfig` object. + attr_accessor :logs_config + + # The definition of `OCIMetricsConfig` object. + attr_accessor :metrics_config + + # The definition of `RegionsConfig` object. + attr_accessor :regions_config + + # Enable or disable resource collection. + attr_accessor :resource_collection_enabled + + # The attribute's tenancy_name. + attr_accessor :tenancy_name + + # The OCID of the user needed to authenticate and collect data. + attr_accessor :user_ocid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config_version' => :'config_version', + :'cost_collection_enabled' => :'cost_collection_enabled', + :'dd_compartment_id' => :'dd_compartment_id', + :'dd_stack_id' => :'dd_stack_id', + :'home_region' => :'home_region', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'regions_config' => :'regions_config', + :'resource_collection_enabled' => :'resource_collection_enabled', + :'tenancy_name' => :'tenancy_name', + :'user_ocid' => :'user_ocid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config_version' => :'Integer', + :'cost_collection_enabled' => :'Boolean', + :'dd_compartment_id' => :'String', + :'dd_stack_id' => :'String', + :'home_region' => :'String', + :'logs_config' => :'OCILogsConfig', + :'metrics_config' => :'OCIMetricsConfig', + :'regions_config' => :'RegionsConfig', + :'resource_collection_enabled' => :'Boolean', + :'tenancy_name' => :'String', + :'user_ocid' => :'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::TenancyConfigDataAttributes` 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?(:'config_version') + self.config_version = attributes[:'config_version'] + end + + if attributes.key?(:'cost_collection_enabled') + self.cost_collection_enabled = attributes[:'cost_collection_enabled'] + end + + if attributes.key?(:'dd_compartment_id') + self.dd_compartment_id = attributes[:'dd_compartment_id'] + end + + if attributes.key?(:'dd_stack_id') + self.dd_stack_id = attributes[:'dd_stack_id'] + end + + if attributes.key?(:'home_region') + self.home_region = attributes[:'home_region'] + 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?(:'regions_config') + self.regions_config = attributes[:'regions_config'] + end + + if attributes.key?(:'resource_collection_enabled') + self.resource_collection_enabled = attributes[:'resource_collection_enabled'] + end + + if attributes.key?(:'tenancy_name') + self.tenancy_name = attributes[:'tenancy_name'] + end + + if attributes.key?(:'user_ocid') + self.user_ocid = attributes[:'user_ocid'] + 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 && + config_version == o.config_version && + cost_collection_enabled == o.cost_collection_enabled && + dd_compartment_id == o.dd_compartment_id && + dd_stack_id == o.dd_stack_id && + home_region == o.home_region && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + regions_config == o.regions_config && + resource_collection_enabled == o.resource_collection_enabled && + tenancy_name == o.tenancy_name && + user_ocid == o.user_ocid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config_version, cost_collection_enabled, dd_compartment_id, dd_stack_id, home_region, logs_config, metrics_config, regions_config, resource_collection_enabled, tenancy_name, user_ocid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tenancy_config_data_type.rb b/lib/datadog_api_client/v2/models/tenancy_config_data_type.rb new file mode 100644 index 000000000000..5bc89dfb6e55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tenancy_config_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 + # OCI tenancy resource type. + class TenancyConfigDataType + include BaseEnumModel + + OCI_TENANCY = "oci_tenancy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/tenancy_config_list.rb b/lib/datadog_api_client/v2/models/tenancy_config_list.rb new file mode 100644 index 000000000000..93d00087b007 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tenancy_config_list.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 + # The definition of `TenancyConfigList` object. + class TenancyConfigList + include BaseGenericModel + + # The `TenancyConfigList` 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' => :'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::TenancyConfigList` 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_tenancy_config.rb b/lib/datadog_api_client/v2/models/update_tenancy_config.rb new file mode 100644 index 000000000000..611f8a196773 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_tenancy_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 + # The definition of `UpdateTenancyConfig` object. + class UpdateTenancyConfig + include BaseGenericModel + + # The definition of `UpdateTenancyConfigData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateTenancyConfigData' + } + 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::UpdateTenancyConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_tenancy_config_data.rb b/lib/datadog_api_client/v2/models/update_tenancy_config_data.rb new file mode 100644 index 000000000000..24d4996a49e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_tenancy_config_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 + # The definition of `UpdateTenancyConfigData` object. + class UpdateTenancyConfigData + include BaseGenericModel + + # The definition of `UpdateTenancyConfigDataAttributes` object. + attr_accessor :attributes + + # The OCID of the tenancy to be integrated. + attr_reader :id + + # OCI tenancy 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' => :'UpdateTenancyConfigDataAttributes', + :'id' => :'String', + :'type' => :'UpdateTenancyConfigDataType' + } + 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::UpdateTenancyConfigData` 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_tenancy_config_data_attributes.rb b/lib/datadog_api_client/v2/models/update_tenancy_config_data_attributes.rb new file mode 100644 index 000000000000..b8bf0549cd67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_tenancy_config_data_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `UpdateTenancyConfigDataAttributes` object. + class UpdateTenancyConfigDataAttributes + include BaseGenericModel + + # The auth credentials of the user. Consists of a public key fingerprint and private key. + attr_accessor :auth_credentials + + # The home region of the tenancy to be integrated. + attr_accessor :home_region + + # The definition of `OCILogsConfig` object. + attr_accessor :logs_config + + # The definition of `OCIMetricsConfig` object. + attr_accessor :metrics_config + + # The definition of `RegionsConfig` object. + attr_accessor :regions_config + + # Enable or disable resource collection. + attr_accessor :resource_collection_enabled + + # The OCID of the user needed to authenticate and collect data. + attr_accessor :user_ocid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth_credentials' => :'auth_credentials', + :'home_region' => :'home_region', + :'logs_config' => :'logs_config', + :'metrics_config' => :'metrics_config', + :'regions_config' => :'regions_config', + :'resource_collection_enabled' => :'resource_collection_enabled', + :'user_ocid' => :'user_ocid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth_credentials' => :'AuthCredentials', + :'home_region' => :'String', + :'logs_config' => :'OCILogsConfig', + :'metrics_config' => :'OCIMetricsConfig', + :'regions_config' => :'RegionsConfig', + :'resource_collection_enabled' => :'Boolean', + :'user_ocid' => :'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::UpdateTenancyConfigDataAttributes` 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?(:'auth_credentials') + self.auth_credentials = attributes[:'auth_credentials'] + end + + if attributes.key?(:'home_region') + self.home_region = attributes[:'home_region'] + 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?(:'regions_config') + self.regions_config = attributes[:'regions_config'] + end + + if attributes.key?(:'resource_collection_enabled') + self.resource_collection_enabled = attributes[:'resource_collection_enabled'] + end + + if attributes.key?(:'user_ocid') + self.user_ocid = attributes[:'user_ocid'] + 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 && + auth_credentials == o.auth_credentials && + home_region == o.home_region && + logs_config == o.logs_config && + metrics_config == o.metrics_config && + regions_config == o.regions_config && + resource_collection_enabled == o.resource_collection_enabled && + user_ocid == o.user_ocid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth_credentials, home_region, logs_config, metrics_config, regions_config, resource_collection_enabled, user_ocid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_tenancy_config_data_type.rb b/lib/datadog_api_client/v2/models/update_tenancy_config_data_type.rb new file mode 100644 index 000000000000..ec1165ed0997 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_tenancy_config_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 + # OCI tenancy resource type. + class UpdateTenancyConfigDataType + include BaseEnumModel + + OCI_TENANCY = "oci_tenancy".freeze + end +end