diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2dc5dce2c0ac..14c3f04e480a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12687,7 +12687,7 @@ components: - GCP - AZURE CloudInventoryCloudProviderRequestType: - description: JSON:API type for upsert sync configuration requests. + description: Always `cloud_provider`. enum: - cloud_provider example: cloud_provider @@ -12695,7 +12695,7 @@ components: x-enum-varnames: - CLOUD_PROVIDER CloudInventorySyncConfigAWSRequestAttributes: - description: AWS settings for the customer bucket that stores inventory reports. + description: AWS settings for the S3 bucket Storage Management reads inventory reports from. properties: aws_account_id: description: AWS account ID that owns the inventory bucket. @@ -12710,7 +12710,7 @@ components: example: us-east-1 type: string destination_prefix: - description: Optional object key prefix for inventory files. Use `/` or omit for the entire bucket. + description: Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root. example: logs/ type: string required: @@ -12719,7 +12719,7 @@ components: - destination_bucket_region type: object CloudInventorySyncConfigAttributes: - description: Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert. + description: Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration. properties: aws_account_id: description: AWS account ID for the inventory bucket. @@ -12774,7 +12774,7 @@ components: example: reader@my-gcp-project.iam.gserviceaccount.com type: string prefix: - description: Object key prefix or `/` when the entire bucket is synced. + description: Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root. example: logs/ readOnly: true type: string @@ -12855,7 +12855,7 @@ components: - service_account_email type: object CloudInventorySyncConfigResourceType: - description: JSON:API type for sync configuration resources. + description: Always `sync_configs`. enum: - sync_configs example: sync_configs @@ -12863,7 +12863,7 @@ components: x-enum-varnames: - SYNC_CONFIGS CloudInventorySyncConfigResponse: - description: Response containing the upserted sync configuration. Additional read-only fields appear on list and get. + description: Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses. properties: data: $ref: "#/components/schemas/CloudInventorySyncConfigResponseData" @@ -12871,12 +12871,12 @@ components: - data type: object CloudInventorySyncConfigResponseData: - description: JSON:API data object for a sync configuration. + description: Storage Management configuration data. properties: attributes: $ref: "#/components/schemas/CloudInventorySyncConfigAttributes" id: - description: Unique identifier for the recurring sync configuration. + description: Unique identifier for this Storage Management configuration. example: abc123 type: string type: @@ -81161,7 +81161,7 @@ components: type: object UpsertCloudInventorySyncConfigRequestAttributes: description: |- - Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`). + Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`). properties: aws: $ref: "#/components/schemas/CloudInventorySyncConfigAWSRequestAttributes" @@ -81171,7 +81171,7 @@ components: $ref: "#/components/schemas/CloudInventorySyncConfigGCPRequestAttributes" type: object UpsertCloudInventorySyncConfigRequestData: - description: JSON:API data envelope for an upsert sync configuration request. + description: Storage Management configuration data for the create or update request. properties: attributes: $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestAttributes" @@ -93941,8 +93941,7 @@ paths: /api/v2/cloudinventoryservice/syncconfigs: put: description: |- - Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id` - and provider-specific settings under `data.attributes`. This endpoint uses an upsert model. + Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set `data.id` to the cloud provider (`aws`, `gcp`, or `azure`) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration. operationId: UpsertSyncConfig requestBody: content: @@ -93990,17 +93989,14 @@ paths: $ref: "#/components/responses/ForbiddenResponse" "429": $ref: "#/components/responses/TooManyRequestsResponse" - summary: Create or update a sync configuration + summary: Enable Storage Management for a bucket tags: - - Cloud Inventory Sync Configs + - Storage Management x-codegen-request-body-name: body "x-permission": operator: OR permissions: - aws_configurations_manage - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/code-coverage/branch/summary: post: description: |- @@ -145604,9 +145600,6 @@ tags: - description: |- The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management - - description: |- - Configure cloud inventory file synchronization from your cloud storage to Datadog. - name: Cloud Inventory Sync Configs - description: |- The Cloud Network Monitoring API allows you to fetch aggregated connections and DNS traffic with their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) and [DNS Monitoring page](https://docs.datadoghq.com/network_monitoring/dns/) for more information. name: Cloud Network Monitoring @@ -145988,6 +145981,9 @@ tags: name: Static Analysis - description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages + - description: |- + Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored. + name: Storage Management - description: |- Synthetic tests use simulated requests and actions so you can monitor the availability and performance of systems and applications. Datadog supports the following types of synthetic tests: - [API tests](https://docs.datadoghq.com/synthetics/api_tests/) diff --git a/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.rb b/examples/v2/storage-management/UpsertSyncConfig.rb similarity index 86% rename from examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.rb rename to examples/v2/storage-management/UpsertSyncConfig.rb index 700ae04df0e9..2a2e9bc631ad 100644 --- a/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.rb +++ b/examples/v2/storage-management/UpsertSyncConfig.rb @@ -1,10 +1,7 @@ -# Create or update a sync configuration returns "OK" response +# Enable Storage Management for a bucket returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.upsert_sync_config".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CloudInventorySyncConfigsAPI.new +api_instance = DatadogAPIClient::V2::StorageManagementAPI.new body = DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequest.new({ data: DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequestData.new({ diff --git a/features/v2/cloud_inventory_sync_configs.feature b/features/v2/storage_management.feature similarity index 70% rename from features/v2/cloud_inventory_sync_configs.feature rename to features/v2/storage_management.feature index 32a7d292efb2..cde4a4e98760 100644 --- a/features/v2/cloud_inventory_sync_configs.feature +++ b/features/v2/storage_management.feature @@ -1,22 +1,22 @@ -@endpoint(cloud-inventory-sync-configs) @endpoint(cloud-inventory-sync-configs-v2) -Feature: Cloud Inventory Sync Configs - Configure cloud inventory file synchronization from your cloud storage to - Datadog. +@endpoint(storage-management) @endpoint(storage-management-v2) +Feature: Storage Management + Enable Storage Management for S3 buckets, GCS buckets, and Azure + containers. Each configuration registers the destination that holds + inventory reports for the storage being monitored. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system - And an instance of "CloudInventorySyncConfigs" API - And operation "UpsertSyncConfig" enabled + And an instance of "StorageManagement" API And new "UpsertSyncConfig" request And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}} @generated @skip @team:DataDog/storage-management - Scenario: Create or update a sync configuration returns "Bad Request" response + Scenario: Enable Storage Management for a bucket returns "Bad Request" response When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/storage-management - Scenario: Create or update a sync configuration returns "OK" response + Scenario: Enable Storage Management for a bucket returns "OK" response When the request is sent Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index d5a8323e2702..086a6e562d79 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1236,7 +1236,7 @@ } }, "UpsertSyncConfig": { - "tag": "Cloud Inventory Sync Configs", + "tag": "Storage Management", "undo": { "type": "idempotent" } diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index eb82106f5652..f30c088a932f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -290,7 +290,6 @@ def initialize "v2.mute_security_findings": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, - "v2.upsert_sync_config": false, "v2.get_code_coverage_branch_summary": false, "v2.get_code_coverage_commit_summary": false, "v2.create_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e9bb9ea6abc5..1e54c1107b63 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6396,7 +6396,6 @@ def overrides "v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI", "v2.cloud_authentication_api" => "CloudAuthenticationAPI", "v2.cloud_cost_management_api" => "CloudCostManagementAPI", - "v2.cloud_inventory_sync_configs_api" => "CloudInventorySyncConfigsAPI", "v2.cloud_network_monitoring_api" => "CloudNetworkMonitoringAPI", "v2.cloudflare_integration_api" => "CloudflareIntegrationAPI", "v2.code_coverage_api" => "CodeCoverageAPI", @@ -6477,6 +6476,7 @@ def overrides "v2.spans_metrics_api" => "SpansMetricsAPI", "v2.static_analysis_api" => "StaticAnalysisAPI", "v2.status_pages_api" => "StatusPagesAPI", + "v2.storage_management_api" => "StorageManagementAPI", "v2.synthetics_api" => "SyntheticsAPI", "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", diff --git a/lib/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.rb b/lib/datadog_api_client/v2/api/storage_management_api.rb similarity index 73% rename from lib/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.rb rename to lib/datadog_api_client/v2/api/storage_management_api.rb index 771f3d93a0c5..880da1e683b2 100644 --- a/lib/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.rb +++ b/lib/datadog_api_client/v2/api/storage_management_api.rb @@ -16,14 +16,14 @@ require 'cgi' module DatadogAPIClient::V2 - class CloudInventorySyncConfigsAPI + class StorageManagementAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end - # Create or update a sync configuration. + # Enable Storage Management for a bucket. # # @see #upsert_sync_config_with_http_info def upsert_sync_config(body, opts = {}) @@ -31,28 +31,21 @@ def upsert_sync_config(body, opts = {}) data end - # Create or update a sync configuration. + # Enable Storage Management for a bucket. # - # Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id` - # and provider-specific settings under `data.attributes`. This endpoint uses an upsert model. + # Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set `data.id` to the cloud provider (`aws`, `gcp`, or `azure`) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration. # # @param body [UpsertCloudInventorySyncConfigRequest] # @param opts [Hash] the optional parameters # @return [Array<(CloudInventorySyncConfigResponse, Integer, Hash)>] CloudInventorySyncConfigResponse data, response status code and response headers def upsert_sync_config_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.upsert_sync_config".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_sync_config") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_sync_config")) - end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudInventorySyncConfigsAPI.upsert_sync_config ...' + @api_client.config.logger.debug 'Calling API: StorageManagementAPI.upsert_sync_config ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling CloudInventorySyncConfigsAPI.upsert_sync_config" + fail ArgumentError, "Missing the required parameter 'body' when calling StorageManagementAPI.upsert_sync_config" end # resource path local_var_path = '/api/v2/cloudinventoryservice/syncconfigs' @@ -92,7 +85,7 @@ def upsert_sync_config_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudInventorySyncConfigsAPI#upsert_sync_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StorageManagementAPI#upsert_sync_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_cloud_provider_request_type.rb b/lib/datadog_api_client/v2/models/cloud_inventory_cloud_provider_request_type.rb index 6bef2aea0b1a..9e4b36523cea 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_cloud_provider_request_type.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_cloud_provider_request_type.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API type for upsert sync configuration requests. + # Always `cloud_provider`. class CloudInventoryCloudProviderRequestType include BaseEnumModel diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_attributes.rb b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_attributes.rb index 86bd6760df1b..be04b6c83915 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_attributes.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_attributes.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert. + # Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration. class CloudInventorySyncConfigAttributes include BaseGenericModel @@ -60,7 +60,7 @@ class CloudInventorySyncConfigAttributes # Service account email for bucket access. attr_reader :gcp_service_account_email - # Object key prefix or `/` when the entire bucket is synced. + # Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root. attr_reader :prefix attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_aws_request_attributes.rb b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_aws_request_attributes.rb index a700757f895f..615e6ac8dd84 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_aws_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_aws_request_attributes.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # AWS settings for the customer bucket that stores inventory reports. + # AWS settings for the S3 bucket Storage Management reads inventory reports from. class CloudInventorySyncConfigAWSRequestAttributes include BaseGenericModel @@ -30,7 +30,7 @@ class CloudInventorySyncConfigAWSRequestAttributes # AWS Region of the inventory bucket. attr_reader :destination_bucket_region - # Optional object key prefix for inventory files. Use `/` or omit for the entire bucket. + # Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root. attr_accessor :destination_prefix attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_resource_type.rb b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_resource_type.rb index 8f88efa14af9..189d6c51e441 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_resource_type.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_resource_type.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API type for sync configuration resources. + # Always `sync_configs`. class CloudInventorySyncConfigResourceType include BaseEnumModel diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response.rb b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response.rb index a76533c38942..aed345cf13bf 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response containing the upserted sync configuration. Additional read-only fields appear on list and get. + # Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses. class CloudInventorySyncConfigResponse include BaseGenericModel - # JSON:API data object for a sync configuration. + # Storage Management configuration data. attr_reader :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response_data.rb b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response_data.rb index a6292364ca33..3a6ee25a2a60 100644 --- a/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response_data.rb +++ b/lib/datadog_api_client/v2/models/cloud_inventory_sync_config_response_data.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API data object for a sync configuration. + # Storage Management configuration data. class CloudInventorySyncConfigResponseData include BaseGenericModel - # Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert. + # Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration. attr_reader :attributes - # Unique identifier for the recurring sync configuration. + # Unique identifier for this Storage Management configuration. attr_reader :id - # JSON:API type for sync configuration resources. + # Always `sync_configs`. attr_reader :type attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request.rb b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request.rb index 2fd11caea873..ad8317b8b102 100644 --- a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request.rb +++ b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class UpsertCloudInventorySyncConfigRequest include BaseGenericModel - # JSON:API data envelope for an upsert sync configuration request. + # Storage Management configuration data for the create or update request. attr_reader :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_attributes.rb b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_attributes.rb index b4bc28430ba5..d04b7b3102c1 100644 --- a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_attributes.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`). + # Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`). class UpsertCloudInventorySyncConfigRequestAttributes include BaseGenericModel - # AWS settings for the customer bucket that stores inventory reports. + # AWS settings for the S3 bucket Storage Management reads inventory reports from. attr_accessor :aws # Azure settings for the storage account and container with inventory data. diff --git a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_data.rb b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_data.rb index 7053b673971f..07d204243872 100644 --- a/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_data.rb +++ b/lib/datadog_api_client/v2/models/upsert_cloud_inventory_sync_config_request_data.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API data envelope for an upsert sync configuration request. + # Storage Management configuration data for the create or update request. class UpsertCloudInventorySyncConfigRequestData include BaseGenericModel - # Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`). + # Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`). attr_reader :attributes # Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. attr_reader :id - # JSON:API type for upsert sync configuration requests. + # Always `cloud_provider`. attr_reader :type attr_accessor :additional_properties