diff --git a/.apigentools-info b/.apigentools-info index 8d02612800..27e7e55bb2 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:28.312845", - "spec_repo_commit": "fec20f97" + "regenerated": "2025-05-21 15:19:40.737427", + "spec_repo_commit": "3fbcf458" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-20 07:21:28.331470", - "spec_repo_commit": "fec20f97" + "regenerated": "2025-05-21 15:19:40.754248", + "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 79fc922a62..49114744e7 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 105b7ea3a8..5bee8741fd 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -312,6 +312,13 @@ datadog\_api\_client.v2.api.observability\_pipelines\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.oci\_integration\_api module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.oci_integration_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.okta\_integration\_api module --------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 771d6e755a..f48c0af96a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -942,6 +942,13 @@ datadog\_api\_client.v2.model.audit\_logs\_warning module :members: :show-inheritance: +datadog\_api\_client.v2.model.auth\_credentials module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.auth_credentials + :members: + :show-inheritance: + datadog\_api\_client.v2.model.authn\_mapping module --------------------------------------------------- @@ -3798,6 +3805,34 @@ datadog\_api\_client.v2.model.create\_rule\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_tenancy\_config module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_tenancy_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_tenancy\_config\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_tenancy_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_tenancy\_config\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_tenancy_config_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_tenancy\_config\_data\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_tenancy_config_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_workflow\_request module -------------------------------------------------------------- @@ -11253,6 +11288,20 @@ datadog\_api\_client.v2.model.observability\_pipeline\_tls module :members: :show-inheritance: +datadog\_api\_client.v2.model.oci\_logs\_config module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.oci_logs_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.oci\_metrics\_config module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.oci_metrics_config + :members: + :show-inheritance: + datadog\_api\_client.v2.model.okta\_account module -------------------------------------------------- @@ -12051,6 +12100,13 @@ datadog\_api\_client.v2.model.readiness\_gate\_threshold\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.regions\_config module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.regions_config + :members: + :show-inheritance: + datadog\_api\_client.v2.model.relation\_type module --------------------------------------------------- @@ -16601,6 +16657,41 @@ datadog\_api\_client.v2.model.teams\_response\_meta\_pagination module :members: :show-inheritance: +datadog\_api\_client.v2.model.tenancy\_config module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.tenancy_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.tenancy\_config\_data module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.tenancy_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.tenancy\_config\_data\_attributes module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.tenancy_config_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.tenancy\_config\_data\_type module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.tenancy_config_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.tenancy\_config\_list module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.tenancy_config_list + :members: + :show-inheritance: + datadog\_api\_client.v2.model.time\_restriction module ------------------------------------------------------ @@ -16909,6 +17000,34 @@ datadog\_api\_client.v2.model.update\_rule\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_tenancy\_config module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_tenancy_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_tenancy\_config\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_tenancy_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_tenancy\_config\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_tenancy_config_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_tenancy\_config\_data\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_tenancy_config_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_workflow\_request module -------------------------------------------------------------- diff --git a/examples/v2/oci-integration/CreateTenancyConfig.py b/examples/v2/oci-integration/CreateTenancyConfig.py new file mode 100644 index 0000000000..be62006178 --- /dev/null +++ b/examples/v2/oci-integration/CreateTenancyConfig.py @@ -0,0 +1,57 @@ +""" +Create tenancy config returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi +from datadog_api_client.v2.model.auth_credentials import AuthCredentials +from datadog_api_client.v2.model.create_tenancy_config import CreateTenancyConfig +from datadog_api_client.v2.model.create_tenancy_config_data import CreateTenancyConfigData +from datadog_api_client.v2.model.create_tenancy_config_data_attributes import CreateTenancyConfigDataAttributes +from datadog_api_client.v2.model.create_tenancy_config_data_type import CreateTenancyConfigDataType +from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig +from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + +body = CreateTenancyConfig( + data=CreateTenancyConfigData( + attributes=CreateTenancyConfigDataAttributes( + auth_credentials=AuthCredentials( + 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=OCILogsConfig( + compartment_tag_filters=[ + "datadog:true", + "env:prod", + ], + enabled=True, + enabled_services=[ + "oacnativeproduction", + ], + ), + metrics_config=OCIMetricsConfig( + 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=CreateTenancyConfigDataType.OCI_TENANCY, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + response = api_instance.create_tenancy_config(body=body) + + print(response) diff --git a/examples/v2/oci-integration/DeleteTenancyConfig.py b/examples/v2/oci-integration/DeleteTenancyConfig.py new file mode 100644 index 0000000000..6b60cf4ef7 --- /dev/null +++ b/examples/v2/oci-integration/DeleteTenancyConfig.py @@ -0,0 +1,17 @@ +""" +Delete tenancy config returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = environ["OCI_TENANCY_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + api_instance.delete_tenancy_config( + tenancy_ocid=OCI_TENANCY_DATA_ID, + ) diff --git a/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.py b/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.py new file mode 100644 index 0000000000..eb54b47bbf --- /dev/null +++ b/examples/v2/oci-integration/DeleteTenancyConfig_1134763094.py @@ -0,0 +1,13 @@ +""" +Delete tenancy config for non-existing tenancy returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + api_instance.delete_tenancy_config( + tenancy_ocid="ocid1.tenancy.fake", + ) diff --git a/examples/v2/oci-integration/GetTenancyConfig.py b/examples/v2/oci-integration/GetTenancyConfig.py new file mode 100644 index 0000000000..32cb48a470 --- /dev/null +++ b/examples/v2/oci-integration/GetTenancyConfig.py @@ -0,0 +1,19 @@ +""" +Get tenancy config returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = environ["OCI_TENANCY_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + response = api_instance.get_tenancy_config( + tenancy_ocid=OCI_TENANCY_DATA_ID, + ) + + print(response) diff --git a/examples/v2/oci-integration/GetTenancyConfigs.py b/examples/v2/oci-integration/GetTenancyConfigs.py new file mode 100644 index 0000000000..d2798638cc --- /dev/null +++ b/examples/v2/oci-integration/GetTenancyConfigs.py @@ -0,0 +1,13 @@ +""" +Get tenancy configs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + response = api_instance.get_tenancy_configs() + + print(response) diff --git a/examples/v2/oci-integration/UpdateTenancyConfig.py b/examples/v2/oci-integration/UpdateTenancyConfig.py new file mode 100644 index 0000000000..0954f6afad --- /dev/null +++ b/examples/v2/oci-integration/UpdateTenancyConfig.py @@ -0,0 +1,42 @@ +""" +Update tenancy config returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi +from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig +from datadog_api_client.v2.model.update_tenancy_config import UpdateTenancyConfig +from datadog_api_client.v2.model.update_tenancy_config_data import UpdateTenancyConfigData +from datadog_api_client.v2.model.update_tenancy_config_data_attributes import UpdateTenancyConfigDataAttributes +from datadog_api_client.v2.model.update_tenancy_config_data_type import UpdateTenancyConfigDataType + +# there is a valid "oci_tenancy" resource in the system +OCI_TENANCY_DATA_ID = environ["OCI_TENANCY_DATA_ID"] + +body = UpdateTenancyConfig( + data=UpdateTenancyConfigData( + attributes=UpdateTenancyConfigDataAttributes( + home_region="us-sanjose-1", + metrics_config=OCIMetricsConfig( + 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=UpdateTenancyConfigDataType.OCI_TENANCY, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OCIIntegrationApi(api_client) + response = api_instance.update_tenancy_config(tenancy_ocid=OCI_TENANCY_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/oci_integration_api.py b/src/datadog_api_client/v2/api/oci_integration_api.py new file mode 100644 index 0000000000..41f72f8fd7 --- /dev/null +++ b/src/datadog_api_client/v2/api/oci_integration_api.py @@ -0,0 +1,216 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.tenancy_config_list import TenancyConfigList +from datadog_api_client.v2.model.tenancy_config import TenancyConfig +from datadog_api_client.v2.model.create_tenancy_config import CreateTenancyConfig +from datadog_api_client.v2.model.update_tenancy_config import UpdateTenancyConfig + + +class OCIIntegrationApi: + """ + Configure your Datadog-OCI integration directly through the Datadog API. + For more information, see the `OCI integration page `_. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_tenancy_config_endpoint = _Endpoint( + settings={ + "response_type": (TenancyConfig,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/oci/tenancies", + "operation_id": "create_tenancy_config", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateTenancyConfig,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_tenancy_config_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/oci/tenancies/{tenancy_ocid}", + "operation_id": "delete_tenancy_config", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "tenancy_ocid": { + "required": True, + "openapi_types": (str,), + "attribute": "tenancy_ocid", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_tenancy_config_endpoint = _Endpoint( + settings={ + "response_type": (TenancyConfig,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/oci/tenancies/{tenancy_ocid}", + "operation_id": "get_tenancy_config", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "tenancy_ocid": { + "required": True, + "openapi_types": (str,), + "attribute": "tenancy_ocid", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_tenancy_configs_endpoint = _Endpoint( + settings={ + "response_type": (TenancyConfigList,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/oci/tenancies", + "operation_id": "get_tenancy_configs", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_tenancy_config_endpoint = _Endpoint( + settings={ + "response_type": (TenancyConfig,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/oci/tenancies/{tenancy_ocid}", + "operation_id": "update_tenancy_config", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "tenancy_ocid": { + "required": True, + "openapi_types": (str,), + "attribute": "tenancy_ocid", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateTenancyConfig,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_tenancy_config( + self, + body: CreateTenancyConfig, + ) -> TenancyConfig: + """Create tenancy config. + + Create a new tenancy config. + + :type body: CreateTenancyConfig + :rtype: TenancyConfig + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_tenancy_config_endpoint.call_with_http_info(**kwargs) + + def delete_tenancy_config( + self, + tenancy_ocid: str, + ) -> None: + """Delete tenancy config. + + Delete an existing tenancy config. + + :param tenancy_ocid: Unique tenancy OCID of the OCI integration config. + :type tenancy_ocid: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["tenancy_ocid"] = tenancy_ocid + + return self._delete_tenancy_config_endpoint.call_with_http_info(**kwargs) + + def get_tenancy_config( + self, + tenancy_ocid: str, + ) -> TenancyConfig: + """Get tenancy config. + + Get a single tenancy config object. + + :param tenancy_ocid: Unique tenancy OCID of the OCI integration config. + :type tenancy_ocid: str + :rtype: TenancyConfig + """ + kwargs: Dict[str, Any] = {} + kwargs["tenancy_ocid"] = tenancy_ocid + + return self._get_tenancy_config_endpoint.call_with_http_info(**kwargs) + + def get_tenancy_configs( + self, + ) -> TenancyConfigList: + """Get tenancy configs. + + List all tenancy integrations. + + :rtype: TenancyConfigList + """ + kwargs: Dict[str, Any] = {} + return self._get_tenancy_configs_endpoint.call_with_http_info(**kwargs) + + def update_tenancy_config( + self, + tenancy_ocid: str, + body: UpdateTenancyConfig, + ) -> TenancyConfig: + """Update tenancy config. + + Update an existing tenancy config. + + :param tenancy_ocid: Unique tenancy OCID of the OCI integration config. + :type tenancy_ocid: str + :type body: UpdateTenancyConfig + :rtype: TenancyConfig + """ + kwargs: Dict[str, Any] = {} + kwargs["tenancy_ocid"] = tenancy_ocid + + kwargs["body"] = body + + return self._update_tenancy_config_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 241e856db3..2c0423a6ea 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -41,6 +41,7 @@ from datadog_api_client.v2.api.microsoft_teams_integration_api import MicrosoftTeamsIntegrationApi from datadog_api_client.v2.api.monitors_api import MonitorsApi from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi +from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi from datadog_api_client.v2.api.okta_integration_api import OktaIntegrationApi from datadog_api_client.v2.api.on_call_api import OnCallApi @@ -114,6 +115,7 @@ "MicrosoftTeamsIntegrationApi", "MonitorsApi", "NetworkDeviceMonitoringApi", + "OCIIntegrationApi", "ObservabilityPipelinesApi", "OktaIntegrationApi", "OnCallApi", diff --git a/src/datadog_api_client/v2/model/auth_credentials.py b/src/datadog_api_client/v2/model/auth_credentials.py new file mode 100644 index 0000000000..3ca1248961 --- /dev/null +++ b/src/datadog_api_client/v2/model/auth_credentials.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AuthCredentials(ModelNormal): + @cached_property + def openapi_types(_): + return { + "fingerprint": (str,), + "private_key": (str,), + } + + attribute_map = { + "fingerprint": "fingerprint", + "private_key": "private_key", + } + + def __init__(self_, fingerprint: str, private_key: str, **kwargs): + """ + The auth credentials of the user. Consists of a public key fingerprint and private key. + + :param fingerprint: The public key fingerprint. + :type fingerprint: str + + :param private_key: The ``RSA`` private key in ``PEM`` format. + :type private_key: str + """ + super().__init__(kwargs) + + self_.fingerprint = fingerprint + self_.private_key = private_key diff --git a/src/datadog_api_client/v2/model/create_tenancy_config.py b/src/datadog_api_client/v2/model/create_tenancy_config.py new file mode 100644 index 0000000000..3bd531efa6 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_tenancy_config.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_tenancy_config_data import CreateTenancyConfigData + + +class CreateTenancyConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_tenancy_config_data import CreateTenancyConfigData + + return { + "data": (CreateTenancyConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateTenancyConfigData, UnsetType] = unset, **kwargs): + """ + The definition of ``CreateTenancyConfig`` object. + + :param data: The definition of ``CreateTenancyConfigData`` object. + :type data: CreateTenancyConfigData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_tenancy_config_data.py b/src/datadog_api_client/v2/model/create_tenancy_config_data.py new file mode 100644 index 0000000000..5dcd40d185 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_tenancy_config_data.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_tenancy_config_data_attributes import CreateTenancyConfigDataAttributes + from datadog_api_client.v2.model.create_tenancy_config_data_type import CreateTenancyConfigDataType + + +class CreateTenancyConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_tenancy_config_data_attributes import CreateTenancyConfigDataAttributes + from datadog_api_client.v2.model.create_tenancy_config_data_type import CreateTenancyConfigDataType + + return { + "attributes": (CreateTenancyConfigDataAttributes,), + "id": (str,), + "type": (CreateTenancyConfigDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: CreateTenancyConfigDataType, + attributes: Union[CreateTenancyConfigDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateTenancyConfigData`` object. + + :param attributes: The definition of ``CreateTenancyConfigDataAttributes`` object. + :type attributes: CreateTenancyConfigDataAttributes, optional + + :param id: The OCID of the tenancy to be integrated. + :type id: str + + :param type: OCI tenancy resource type. + :type type: CreateTenancyConfigDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_tenancy_config_data_attributes.py b/src/datadog_api_client/v2/model/create_tenancy_config_data_attributes.py new file mode 100644 index 0000000000..a06a003f42 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_tenancy_config_data_attributes.py @@ -0,0 +1,122 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.auth_credentials import AuthCredentials + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + +class CreateTenancyConfigDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.auth_credentials import AuthCredentials + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + return { + "auth_credentials": (AuthCredentials,), + "config_version": (int,), + "dd_compartment_id": (str,), + "dd_stack_id": (str,), + "home_region": (str,), + "logs_config": (OCILogsConfig,), + "metrics_config": (OCIMetricsConfig,), + "regions_config": (RegionsConfig,), + "resource_collection_enabled": (bool,), + "user_ocid": (str,), + } + + 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", + } + + def __init__( + self_, + auth_credentials: AuthCredentials, + home_region: str, + user_ocid: str, + config_version: Union[int, UnsetType] = unset, + dd_compartment_id: Union[str, UnsetType] = unset, + dd_stack_id: Union[str, UnsetType] = unset, + logs_config: Union[OCILogsConfig, UnsetType] = unset, + metrics_config: Union[OCIMetricsConfig, UnsetType] = unset, + regions_config: Union[RegionsConfig, UnsetType] = unset, + resource_collection_enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateTenancyConfigDataAttributes`` object. + + :param auth_credentials: The auth credentials of the user. Consists of a public key fingerprint and private key. + :type auth_credentials: AuthCredentials + + :param config_version: The config version. It is not recommended to add or change this value, as it is determined internally. + :type config_version: int, optional + + :param dd_compartment_id: The OCID of the compartment containing Datadog managed resources. + :type dd_compartment_id: str, optional + + :param dd_stack_id: The OCID of the resource manager stack for creating Datadog managed resources. + :type dd_stack_id: str, optional + + :param home_region: The home region of the tenancy to be integrated. + :type home_region: str + + :param logs_config: The definition of ``OCILogsConfig`` object. + :type logs_config: OCILogsConfig, optional + + :param metrics_config: The definition of ``OCIMetricsConfig`` object. + :type metrics_config: OCIMetricsConfig, optional + + :param regions_config: The definition of ``RegionsConfig`` object. + :type regions_config: RegionsConfig, optional + + :param resource_collection_enabled: Enable or disable resource collection. + :type resource_collection_enabled: bool, optional + + :param user_ocid: The OCID of the user needed to authenticate and collect data. + :type user_ocid: str + """ + if config_version is not unset: + kwargs["config_version"] = config_version + if dd_compartment_id is not unset: + kwargs["dd_compartment_id"] = dd_compartment_id + if dd_stack_id is not unset: + kwargs["dd_stack_id"] = dd_stack_id + if logs_config is not unset: + kwargs["logs_config"] = logs_config + if metrics_config is not unset: + kwargs["metrics_config"] = metrics_config + if regions_config is not unset: + kwargs["regions_config"] = regions_config + if resource_collection_enabled is not unset: + kwargs["resource_collection_enabled"] = resource_collection_enabled + super().__init__(kwargs) + + self_.auth_credentials = auth_credentials + self_.home_region = home_region + self_.user_ocid = user_ocid diff --git a/src/datadog_api_client/v2/model/create_tenancy_config_data_type.py b/src/datadog_api_client/v2/model/create_tenancy_config_data_type.py new file mode 100644 index 0000000000..db6ccef0fd --- /dev/null +++ b/src/datadog_api_client/v2/model/create_tenancy_config_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CreateTenancyConfigDataType(ModelSimple): + """ + OCI tenancy resource type. + + :param value: If omitted defaults to "oci_tenancy". Must be one of ["oci_tenancy"]. + :type value: str + """ + + allowed_values = { + "oci_tenancy", + } + OCI_TENANCY: ClassVar["CreateTenancyConfigDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateTenancyConfigDataType.OCI_TENANCY = CreateTenancyConfigDataType("oci_tenancy") diff --git a/src/datadog_api_client/v2/model/oci_logs_config.py b/src/datadog_api_client/v2/model/oci_logs_config.py new file mode 100644 index 0000000000..0ab98667e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_logs_config.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class OCILogsConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "compartment_tag_filters": ([str],), + "enabled": (bool,), + "enabled_services": ([str],), + } + + attribute_map = { + "compartment_tag_filters": "compartment_tag_filters", + "enabled": "enabled", + "enabled_services": "enabled_services", + } + + def __init__( + self_, + compartment_tag_filters: Union[List[str], UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + enabled_services: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``OCILogsConfig`` object. + + :param compartment_tag_filters: The compartment tag filters to apply to log collection. Each value represents a Datadog tag in the format key:value. + :type compartment_tag_filters: [str], optional + + :param enabled: Enable or disable log collection. Disabled by default. + :type enabled: bool, optional + + :param enabled_services: The list of services to enable for log collection. + :type enabled_services: [str], optional + """ + if compartment_tag_filters is not unset: + kwargs["compartment_tag_filters"] = compartment_tag_filters + if enabled is not unset: + kwargs["enabled"] = enabled + if enabled_services is not unset: + kwargs["enabled_services"] = enabled_services + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/oci_metrics_config.py b/src/datadog_api_client/v2/model/oci_metrics_config.py new file mode 100644 index 0000000000..e93c796edc --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_metrics_config.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class OCIMetricsConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "compartment_tag_filters": ([str],), + "enabled": (bool,), + "excluded_services": ([str],), + } + + attribute_map = { + "compartment_tag_filters": "compartment_tag_filters", + "enabled": "enabled", + "excluded_services": "excluded_services", + } + + def __init__( + self_, + compartment_tag_filters: Union[List[str], UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + excluded_services: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``OCIMetricsConfig`` object. + + :param compartment_tag_filters: The compartment tag filters to apply to metric collection. Each value represents a Datadog tag in the format key:value. + :type compartment_tag_filters: [str], optional + + :param enabled: Enable or disable metric collection. Enabled by default for all services. + :type enabled: bool, optional + + :param excluded_services: The list of services to exclude from metric collection. + :type excluded_services: [str], optional + """ + if compartment_tag_filters is not unset: + kwargs["compartment_tag_filters"] = compartment_tag_filters + if enabled is not unset: + kwargs["enabled"] = enabled + if excluded_services is not unset: + kwargs["excluded_services"] = excluded_services + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/regions_config.py b/src/datadog_api_client/v2/model/regions_config.py new file mode 100644 index 0000000000..546b2d82b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/regions_config.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RegionsConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "available": ([str],), + "disabled": ([str],), + "enabled": ([str],), + } + + attribute_map = { + "available": "available", + "disabled": "disabled", + "enabled": "enabled", + } + + def __init__( + self_, + available: Union[List[str], UnsetType] = unset, + disabled: Union[List[str], UnsetType] = unset, + enabled: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``RegionsConfig`` object. + + :param available: The list of regions currently subscribed to . + :type available: [str], optional + + :param disabled: The list of disabled regions. + :type disabled: [str], optional + + :param enabled: The list of enabled regions. + :type enabled: [str], optional + """ + if available is not unset: + kwargs["available"] = available + if disabled is not unset: + kwargs["disabled"] = disabled + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tenancy_config.py b/src/datadog_api_client/v2/model/tenancy_config.py new file mode 100644 index 0000000000..40ad2a9fe3 --- /dev/null +++ b/src/datadog_api_client/v2/model/tenancy_config.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tenancy_config_data import TenancyConfigData + + +class TenancyConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tenancy_config_data import TenancyConfigData + + return { + "data": (TenancyConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[TenancyConfigData, UnsetType] = unset, **kwargs): + """ + The definition of ``TenancyConfig`` object. + + :param data: The definition of ``TenancyConfigData`` object. + :type data: TenancyConfigData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tenancy_config_data.py b/src/datadog_api_client/v2/model/tenancy_config_data.py new file mode 100644 index 0000000000..f6fe599546 --- /dev/null +++ b/src/datadog_api_client/v2/model/tenancy_config_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tenancy_config_data_attributes import TenancyConfigDataAttributes + from datadog_api_client.v2.model.tenancy_config_data_type import TenancyConfigDataType + + +class TenancyConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tenancy_config_data_attributes import TenancyConfigDataAttributes + from datadog_api_client.v2.model.tenancy_config_data_type import TenancyConfigDataType + + return { + "attributes": (TenancyConfigDataAttributes,), + "id": (str,), + "type": (TenancyConfigDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: TenancyConfigDataType, + attributes: Union[TenancyConfigDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``TenancyConfigData`` object. + + :param attributes: The definition of ``TenancyConfigDataAttributes`` object. + :type attributes: TenancyConfigDataAttributes, optional + + :param id: The OCID of the tenancy config. + :type id: str, optional + + :param type: OCI tenancy resource type. + :type type: TenancyConfigDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/tenancy_config_data_attributes.py b/src/datadog_api_client/v2/model/tenancy_config_data_attributes.py new file mode 100644 index 0000000000..5b3c9238fc --- /dev/null +++ b/src/datadog_api_client/v2/model/tenancy_config_data_attributes.py @@ -0,0 +1,130 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + +class TenancyConfigDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + return { + "config_version": (int,), + "cost_collection_enabled": (bool,), + "dd_compartment_id": (str,), + "dd_stack_id": (str,), + "home_region": (str,), + "logs_config": (OCILogsConfig,), + "metrics_config": (OCIMetricsConfig,), + "regions_config": (RegionsConfig,), + "resource_collection_enabled": (bool,), + "tenancy_name": (str,), + "user_ocid": (str,), + } + + 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", + } + + def __init__( + self_, + config_version: Union[int, UnsetType] = unset, + cost_collection_enabled: Union[bool, UnsetType] = unset, + dd_compartment_id: Union[str, UnsetType] = unset, + dd_stack_id: Union[str, UnsetType] = unset, + home_region: Union[str, UnsetType] = unset, + logs_config: Union[OCILogsConfig, UnsetType] = unset, + metrics_config: Union[OCIMetricsConfig, UnsetType] = unset, + regions_config: Union[RegionsConfig, UnsetType] = unset, + resource_collection_enabled: Union[bool, UnsetType] = unset, + tenancy_name: Union[str, UnsetType] = unset, + user_ocid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``TenancyConfigDataAttributes`` object. + + :param config_version: The config version. It is not recommended to add or change this value, as it is determined internally. + :type config_version: int, optional + + :param cost_collection_enabled: Enable or disable cost collection. + :type cost_collection_enabled: bool, optional + + :param dd_compartment_id: The OCID of the compartment containing Datadog managed resources. + :type dd_compartment_id: str, optional + + :param dd_stack_id: The OCID of the resource manager stack for creating Datadog managed resources. + :type dd_stack_id: str, optional + + :param home_region: The home region of the tenancy to be integrated. + :type home_region: str, optional + + :param logs_config: The definition of ``OCILogsConfig`` object. + :type logs_config: OCILogsConfig, optional + + :param metrics_config: The definition of ``OCIMetricsConfig`` object. + :type metrics_config: OCIMetricsConfig, optional + + :param regions_config: The definition of ``RegionsConfig`` object. + :type regions_config: RegionsConfig, optional + + :param resource_collection_enabled: Enable or disable resource collection. + :type resource_collection_enabled: bool, optional + + :param tenancy_name: The attribute's tenancy_name. + :type tenancy_name: str, optional + + :param user_ocid: The OCID of the user needed to authenticate and collect data. + :type user_ocid: str, optional + """ + if config_version is not unset: + kwargs["config_version"] = config_version + if cost_collection_enabled is not unset: + kwargs["cost_collection_enabled"] = cost_collection_enabled + if dd_compartment_id is not unset: + kwargs["dd_compartment_id"] = dd_compartment_id + if dd_stack_id is not unset: + kwargs["dd_stack_id"] = dd_stack_id + if home_region is not unset: + kwargs["home_region"] = home_region + if logs_config is not unset: + kwargs["logs_config"] = logs_config + if metrics_config is not unset: + kwargs["metrics_config"] = metrics_config + if regions_config is not unset: + kwargs["regions_config"] = regions_config + if resource_collection_enabled is not unset: + kwargs["resource_collection_enabled"] = resource_collection_enabled + if tenancy_name is not unset: + kwargs["tenancy_name"] = tenancy_name + if user_ocid is not unset: + kwargs["user_ocid"] = user_ocid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tenancy_config_data_type.py b/src/datadog_api_client/v2/model/tenancy_config_data_type.py new file mode 100644 index 0000000000..9aba31ff43 --- /dev/null +++ b/src/datadog_api_client/v2/model/tenancy_config_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TenancyConfigDataType(ModelSimple): + """ + OCI tenancy resource type. + + :param value: If omitted defaults to "oci_tenancy". Must be one of ["oci_tenancy"]. + :type value: str + """ + + allowed_values = { + "oci_tenancy", + } + OCI_TENANCY: ClassVar["TenancyConfigDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TenancyConfigDataType.OCI_TENANCY = TenancyConfigDataType("oci_tenancy") diff --git a/src/datadog_api_client/v2/model/tenancy_config_list.py b/src/datadog_api_client/v2/model/tenancy_config_list.py new file mode 100644 index 0000000000..2421f3fb48 --- /dev/null +++ b/src/datadog_api_client/v2/model/tenancy_config_list.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tenancy_config_data import TenancyConfigData + + +class TenancyConfigList(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tenancy_config_data import TenancyConfigData + + return { + "data": ([TenancyConfigData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[TenancyConfigData], **kwargs): + """ + The definition of ``TenancyConfigList`` object. + + :param data: The ``TenancyConfigList`` data. + :type data: [TenancyConfigData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_tenancy_config.py b/src/datadog_api_client/v2/model/update_tenancy_config.py new file mode 100644 index 0000000000..660c4ea3da --- /dev/null +++ b/src/datadog_api_client/v2/model/update_tenancy_config.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_tenancy_config_data import UpdateTenancyConfigData + + +class UpdateTenancyConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_tenancy_config_data import UpdateTenancyConfigData + + return { + "data": (UpdateTenancyConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UpdateTenancyConfigData, UnsetType] = unset, **kwargs): + """ + The definition of ``UpdateTenancyConfig`` object. + + :param data: The definition of ``UpdateTenancyConfigData`` object. + :type data: UpdateTenancyConfigData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_tenancy_config_data.py b/src/datadog_api_client/v2/model/update_tenancy_config_data.py new file mode 100644 index 0000000000..2b96b10ae4 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_tenancy_config_data.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_tenancy_config_data_attributes import UpdateTenancyConfigDataAttributes + from datadog_api_client.v2.model.update_tenancy_config_data_type import UpdateTenancyConfigDataType + + +class UpdateTenancyConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_tenancy_config_data_attributes import UpdateTenancyConfigDataAttributes + from datadog_api_client.v2.model.update_tenancy_config_data_type import UpdateTenancyConfigDataType + + return { + "attributes": (UpdateTenancyConfigDataAttributes,), + "id": (str,), + "type": (UpdateTenancyConfigDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: UpdateTenancyConfigDataType, + attributes: Union[UpdateTenancyConfigDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``UpdateTenancyConfigData`` object. + + :param attributes: The definition of ``UpdateTenancyConfigDataAttributes`` object. + :type attributes: UpdateTenancyConfigDataAttributes, optional + + :param id: The OCID of the tenancy to be integrated. + :type id: str + + :param type: OCI tenancy resource type. + :type type: UpdateTenancyConfigDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_tenancy_config_data_attributes.py b/src/datadog_api_client/v2/model/update_tenancy_config_data_attributes.py new file mode 100644 index 0000000000..0a0cc3e919 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_tenancy_config_data_attributes.py @@ -0,0 +1,100 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.auth_credentials import AuthCredentials + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + +class UpdateTenancyConfigDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.auth_credentials import AuthCredentials + from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig + from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig + from datadog_api_client.v2.model.regions_config import RegionsConfig + + return { + "auth_credentials": (AuthCredentials,), + "home_region": (str,), + "logs_config": (OCILogsConfig,), + "metrics_config": (OCIMetricsConfig,), + "regions_config": (RegionsConfig,), + "resource_collection_enabled": (bool,), + "user_ocid": (str,), + } + + 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", + } + + def __init__( + self_, + auth_credentials: Union[AuthCredentials, UnsetType] = unset, + home_region: Union[str, UnsetType] = unset, + logs_config: Union[OCILogsConfig, UnsetType] = unset, + metrics_config: Union[OCIMetricsConfig, UnsetType] = unset, + regions_config: Union[RegionsConfig, UnsetType] = unset, + resource_collection_enabled: Union[bool, UnsetType] = unset, + user_ocid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``UpdateTenancyConfigDataAttributes`` object. + + :param auth_credentials: The auth credentials of the user. Consists of a public key fingerprint and private key. + :type auth_credentials: AuthCredentials, optional + + :param home_region: The home region of the tenancy to be integrated. + :type home_region: str, optional + + :param logs_config: The definition of ``OCILogsConfig`` object. + :type logs_config: OCILogsConfig, optional + + :param metrics_config: The definition of ``OCIMetricsConfig`` object. + :type metrics_config: OCIMetricsConfig, optional + + :param regions_config: The definition of ``RegionsConfig`` object. + :type regions_config: RegionsConfig, optional + + :param resource_collection_enabled: Enable or disable resource collection. + :type resource_collection_enabled: bool, optional + + :param user_ocid: The OCID of the user needed to authenticate and collect data. + :type user_ocid: str, optional + """ + if auth_credentials is not unset: + kwargs["auth_credentials"] = auth_credentials + if home_region is not unset: + kwargs["home_region"] = home_region + if logs_config is not unset: + kwargs["logs_config"] = logs_config + if metrics_config is not unset: + kwargs["metrics_config"] = metrics_config + if regions_config is not unset: + kwargs["regions_config"] = regions_config + if resource_collection_enabled is not unset: + kwargs["resource_collection_enabled"] = resource_collection_enabled + if user_ocid is not unset: + kwargs["user_ocid"] = user_ocid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_tenancy_config_data_type.py b/src/datadog_api_client/v2/model/update_tenancy_config_data_type.py new file mode 100644 index 0000000000..c1db2c354d --- /dev/null +++ b/src/datadog_api_client/v2/model/update_tenancy_config_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpdateTenancyConfigDataType(ModelSimple): + """ + OCI tenancy resource type. + + :param value: If omitted defaults to "oci_tenancy". Must be one of ["oci_tenancy"]. + :type value: str + """ + + allowed_values = { + "oci_tenancy", + } + OCI_TENANCY: ClassVar["UpdateTenancyConfigDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateTenancyConfigDataType.OCI_TENANCY = UpdateTenancyConfigDataType("oci_tenancy") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2bc305ca9f..f04cc8cb9e 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -252,6 +252,7 @@ from datadog_api_client.v2.model.audit_logs_search_events_request import AuditLogsSearchEventsRequest from datadog_api_client.v2.model.audit_logs_sort import AuditLogsSort from datadog_api_client.v2.model.audit_logs_warning import AuditLogsWarning +from datadog_api_client.v2.model.auth_credentials import AuthCredentials from datadog_api_client.v2.model.authn_mapping import AuthNMapping from datadog_api_client.v2.model.authn_mapping_attributes import AuthNMappingAttributes from datadog_api_client.v2.model.authn_mapping_create_attributes import AuthNMappingCreateAttributes @@ -706,6 +707,10 @@ from datadog_api_client.v2.model.create_rule_request_data import CreateRuleRequestData from datadog_api_client.v2.model.create_rule_response import CreateRuleResponse from datadog_api_client.v2.model.create_rule_response_data import CreateRuleResponseData +from datadog_api_client.v2.model.create_tenancy_config import CreateTenancyConfig +from datadog_api_client.v2.model.create_tenancy_config_data import CreateTenancyConfigData +from datadog_api_client.v2.model.create_tenancy_config_data_attributes import CreateTenancyConfigDataAttributes +from datadog_api_client.v2.model.create_tenancy_config_data_type import CreateTenancyConfigDataType from datadog_api_client.v2.model.create_workflow_request import CreateWorkflowRequest from datadog_api_client.v2.model.create_workflow_response import CreateWorkflowResponse from datadog_api_client.v2.model.creator import Creator @@ -1841,6 +1846,8 @@ from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData +from datadog_api_client.v2.model.oci_logs_config import OCILogsConfig +from datadog_api_client.v2.model.oci_metrics_config import OCIMetricsConfig from datadog_api_client.v2.model.observability_pipeline import ObservabilityPipeline from datadog_api_client.v2.model.observability_pipeline_add_env_vars_processor import ( ObservabilityPipelineAddEnvVarsProcessor, @@ -2470,6 +2477,7 @@ from datadog_api_client.v2.model.rum_warning import RUMWarning from datadog_api_client.v2.model.readiness_gate import ReadinessGate from datadog_api_client.v2.model.readiness_gate_threshold_type import ReadinessGateThresholdType +from datadog_api_client.v2.model.regions_config import RegionsConfig from datadog_api_client.v2.model.relation_type import RelationType from datadog_api_client.v2.model.relationship_item import RelationshipItem from datadog_api_client.v2.model.relationship_to_incident_attachment import RelationshipToIncidentAttachment @@ -3258,6 +3266,11 @@ from datadog_api_client.v2.model.teams_response_links import TeamsResponseLinks from datadog_api_client.v2.model.teams_response_meta import TeamsResponseMeta from datadog_api_client.v2.model.teams_response_meta_pagination import TeamsResponseMetaPagination +from datadog_api_client.v2.model.tenancy_config import TenancyConfig +from datadog_api_client.v2.model.tenancy_config_data import TenancyConfigData +from datadog_api_client.v2.model.tenancy_config_data_attributes import TenancyConfigDataAttributes +from datadog_api_client.v2.model.tenancy_config_data_type import TenancyConfigDataType +from datadog_api_client.v2.model.tenancy_config_list import TenancyConfigList from datadog_api_client.v2.model.time_restriction import TimeRestriction from datadog_api_client.v2.model.time_restrictions import TimeRestrictions from datadog_api_client.v2.model.timeseries_formula_query_request import TimeseriesFormulaQueryRequest @@ -3310,6 +3323,10 @@ from datadog_api_client.v2.model.update_rule_request_data import UpdateRuleRequestData from datadog_api_client.v2.model.update_rule_response import UpdateRuleResponse from datadog_api_client.v2.model.update_rule_response_data import UpdateRuleResponseData +from datadog_api_client.v2.model.update_tenancy_config import UpdateTenancyConfig +from datadog_api_client.v2.model.update_tenancy_config_data import UpdateTenancyConfigData +from datadog_api_client.v2.model.update_tenancy_config_data_attributes import UpdateTenancyConfigDataAttributes +from datadog_api_client.v2.model.update_tenancy_config_data_type import UpdateTenancyConfigDataType from datadog_api_client.v2.model.update_workflow_request import UpdateWorkflowRequest from datadog_api_client.v2.model.update_workflow_response import UpdateWorkflowResponse from datadog_api_client.v2.model.upsert_catalog_entity_request import UpsertCatalogEntityRequest @@ -3605,6 +3622,7 @@ "AuditLogsSearchEventsRequest", "AuditLogsSort", "AuditLogsWarning", + "AuthCredentials", "AuthNMapping", "AuthNMappingAttributes", "AuthNMappingCreateAttributes", @@ -3969,6 +3987,10 @@ "CreateRuleRequestData", "CreateRuleResponse", "CreateRuleResponseData", + "CreateTenancyConfig", + "CreateTenancyConfigData", + "CreateTenancyConfigDataAttributes", + "CreateTenancyConfigDataType", "CreateWorkflowRequest", "CreateWorkflowResponse", "Creator", @@ -4856,6 +4878,8 @@ "NullableRelationshipToUserData", "NullableUserRelationship", "NullableUserRelationshipData", + "OCILogsConfig", + "OCIMetricsConfig", "ObservabilityPipeline", "ObservabilityPipelineAddEnvVarsProcessor", "ObservabilityPipelineAddEnvVarsProcessorType", @@ -5195,6 +5219,7 @@ "RUMWarning", "ReadinessGate", "ReadinessGateThresholdType", + "RegionsConfig", "RelationType", "RelationshipItem", "RelationshipToIncidentAttachment", @@ -5803,6 +5828,11 @@ "TeamsResponseLinks", "TeamsResponseMeta", "TeamsResponseMetaPagination", + "TenancyConfig", + "TenancyConfigData", + "TenancyConfigDataAttributes", + "TenancyConfigDataType", + "TenancyConfigList", "TimeRestriction", "TimeRestrictions", "TimeseriesFormulaQueryRequest", @@ -5847,6 +5877,10 @@ "UpdateRuleRequestData", "UpdateRuleResponse", "UpdateRuleResponseData", + "UpdateTenancyConfig", + "UpdateTenancyConfigData", + "UpdateTenancyConfigDataAttributes", + "UpdateTenancyConfigDataType", "UpdateWorkflowRequest", "UpdateWorkflowResponse", "UpsertCatalogEntityRequest", diff --git a/tests/v2/cassettes/test_scenarios/test_create_tenancy_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_tenancy_config_returns_bad_request_response.frozen new file mode 100644 index 0000000000..28c6be7459 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_create_tenancy_config_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_tenancy_config_returns_bad_request_response.yaml new file mode 100644 index 0000000000..53806a4f98 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_tenancy_config_returns_bad_request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"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: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + private key"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_tenancy_config_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_tenancy_config_returns_no_content_response.frozen new file mode 100644 index 0000000000..60d7de8434 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_delete_tenancy_config_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_tenancy_config_returns_no_content_response.yaml new file mode 100644 index 0000000000..5f5e6a01a6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_tenancy_config_returns_no_content_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..5ff2a7bec6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..c1ef7f8306 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.fake + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_ok_response.frozen new file mode 100644 index 0000000000..5d4e974e17 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_ok_response.yaml new file mode 100644 index 0000000000..af4e453dc4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_tenancy_config_returns_ok_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_tenancy_configs_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_tenancy_configs_returns_ok_response.frozen new file mode 100644 index 0000000000..ad760cc0c4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_get_tenancy_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_tenancy_configs_returns_ok_response.yaml new file mode 100644 index 0000000000..9980fc4b05 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_tenancy_configs_returns_ok_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies + response: + body: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_bad_request_response.frozen new file mode 100644 index 0000000000..36a8dba634 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_bad_request_response.yaml new file mode 100644 index 0000000000..ae72ae3353 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_bad_request_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..329e73041a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..b13fa62753 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"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: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"tenancy not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_ok_response.frozen new file mode 100644 index 0000000000..5f8f6ecb86 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_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/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_ok_response.yaml new file mode 100644 index 0000000000..5d83643c4f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_tenancy_config_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/oci/tenancies/ocid1.tenancy.test + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 696fef088c..7b381db87b 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/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/tests/v2/features/oci_integration.feature b/tests/v2/features/oci_integration.feature new file mode 100644 index 0000000000..d3c1beffb0 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 6f0ee3848a..4616e6f625 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/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": {