---
title: Storage Management
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Storage Management
---

# 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.

## Enable Storage Management for a bucket{% #enable-storage-management-for-a-bucket %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                               |
| ----------------- | -------------------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/cloudinventoryservice/syncconfigs      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigs      |
| us2.ddog-gov.com  | PUT https://api.us2.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigs  |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs |

### Overview

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. This endpoint requires the `aws_configurations_manage` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                                       | Type   | Description                                                                                                                                                                          |
| ------------ | ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]                      | object | Storage Management configuration data for the create or update request.                                                                                                              |
| data         | attributes [*required*]                | object | Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`).                                                        |
| attributes   | aws                                         | object | AWS settings for the S3 bucket Storage Management reads inventory reports from.                                                                                                      |
| aws          | aws_account_id [*required*]            | string | AWS account ID that owns the inventory bucket.                                                                                                                                       |
| aws          | destination_bucket_name [*required*]   | string | Name of the S3 bucket containing inventory files.                                                                                                                                    |
| aws          | destination_bucket_region [*required*] | string | AWS Region of the inventory bucket.                                                                                                                                                  |
| aws          | destination_prefix                          | string | Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root.                                                               |
| attributes   | azure                                       | object | Azure settings for the storage account and container with inventory data.                                                                                                            |
| azure        | client_id [*required*]                 | string | Azure AD application (client) ID used for access.                                                                                                                                    |
| azure        | container [*required*]                 | string | Blob container name.                                                                                                                                                                 |
| azure        | resource_group [*required*]            | string | Resource group containing the storage account.                                                                                                                                       |
| azure        | storage_account [*required*]           | string | Storage account name.                                                                                                                                                                |
| azure        | subscription_id [*required*]           | string | Azure subscription ID.                                                                                                                                                               |
| azure        | tenant_id [*required*]                 | string | Azure AD tenant ID.                                                                                                                                                                  |
| attributes   | gcp                                         | object | GCP settings for buckets involved in inventory reporting.                                                                                                                            |
| gcp          | destination_bucket_name [*required*]   | string | GCS bucket name where Datadog reads inventory reports.                                                                                                                               |
| gcp          | project_id [*required*]                | string | GCP project ID for the inventory destination bucket.                                                                                                                                 |
| gcp          | service_account_email [*required*]     | string | Service account email used to read the destination bucket.                                                                                                                           |
| gcp          | source_bucket_name [*required*]        | string | GCS bucket name that inventory reports are generated for.                                                                                                                            |
| data         | id [*required*]                        | enum   | Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. Allowed enum values: `aws,gcp,azure` |
| data         | type [*required*]                      | enum   | Always `cloud_provider`. Allowed enum values: `cloud_provider`                                                                                                                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "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"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses.

| Parent field | Field                                        | Type   | Description                                                                                                                                                                                  |
| ------------ | -------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                       | object | Storage Management configuration data.                                                                                                                                                       |
| data         | attributes [*required*]                 | object | 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. |
| attributes   | aws_account_id [*required*]             | string | AWS account ID for the inventory bucket.                                                                                                                                                     |
| attributes   | aws_bucket_name [*required*]            | string | AWS S3 bucket name for inventory files.                                                                                                                                                      |
| attributes   | aws_region [*required*]                 | string | AWS Region for the inventory bucket.                                                                                                                                                         |
| attributes   | azure_client_id [*required*]            | string | Azure AD application (client) ID.                                                                                                                                                            |
| attributes   | azure_container_name [*required*]       | string | Azure blob container name.                                                                                                                                                                   |
| attributes   | azure_storage_account_name [*required*] | string | Azure storage account name.                                                                                                                                                                  |
| attributes   | azure_tenant_id [*required*]            | string | Azure AD tenant ID.                                                                                                                                                                          |
| attributes   | cloud_provider [*required*]             | enum   | Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. Allowed enum values: `aws,gcp,azure`         |
| attributes   | error [*required*]                      | string | Human-readable error detail when sync is unhealthy.                                                                                                                                          |
| attributes   | error_code [*required*]                 | string | Machine-readable error code when sync is unhealthy.                                                                                                                                          |
| attributes   | gcp_bucket_name [*required*]            | string | GCS bucket name for inventory files Datadog reads.                                                                                                                                           |
| attributes   | gcp_project_id [*required*]             | string | GCP project ID.                                                                                                                                                                              |
| attributes   | gcp_service_account_email [*required*]  | string | Service account email for bucket access.                                                                                                                                                     |
| attributes   | prefix [*required*]                     | string | Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root.                                                                              |
| data         | id [*required*]                         | string | Unique identifier for this Storage Management configuration.                                                                                                                                 |
| data         | type [*required*]                       | enum   | Always `sync_configs`. Allowed enum values: `sync_configs`                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "aws_account_id": "123456789012",
      "aws_bucket_name": "my-inventory-bucket",
      "aws_region": "us-east-1",
      "azure_client_id": "11111111-1111-1111-1111-111111111111",
      "azure_container_name": "inventory-container",
      "azure_storage_account_name": "mystorageaccount",
      "azure_tenant_id": "22222222-2222-2222-2222-222222222222",
      "cloud_provider": "aws",
      "error": "",
      "error_code": "",
      "gcp_bucket_name": "my-inventory-reports",
      "gcp_project_id": "my-gcp-project",
      "gcp_service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com",
      "prefix": "logs/"
    },
    "id": "abc123",
    "type": "sync_configs"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## AWS inventory bucket
# 
 \# Curl command curl -X PUT "https://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF 
                
##### 

```python
"""
Enable Storage Management for a bucket returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.storage_management_api import StorageManagementApi
from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId
from datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type import (
    CloudInventoryCloudProviderRequestType,
)
from datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes import (
    CloudInventorySyncConfigAWSRequestAttributes,
)
from datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes import (
    CloudInventorySyncConfigAzureRequestAttributes,
)
from datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes import (
    CloudInventorySyncConfigGCPRequestAttributes,
)
from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request import UpsertCloudInventorySyncConfigRequest
from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_attributes import (
    UpsertCloudInventorySyncConfigRequestAttributes,
)
from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data import (
    UpsertCloudInventorySyncConfigRequestData,
)

body = UpsertCloudInventorySyncConfigRequest(
    data=UpsertCloudInventorySyncConfigRequestData(
        attributes=UpsertCloudInventorySyncConfigRequestAttributes(
            aws=CloudInventorySyncConfigAWSRequestAttributes(
                aws_account_id="123456789012",
                destination_bucket_name="my-inventory-bucket",
                destination_bucket_region="us-east-1",
                destination_prefix="logs/",
            ),
            azure=CloudInventorySyncConfigAzureRequestAttributes(
                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=CloudInventorySyncConfigGCPRequestAttributes(
                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=CloudInventoryCloudProviderId.AWS,
        type=CloudInventoryCloudProviderRequestType.CLOUD_PROVIDER,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = StorageManagementApi(api_client)
    response = api_instance.upsert_sync_config(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Enable Storage Management for a bucket returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::StorageManagementAPI.new

body = DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequest.new({
  data: DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequestData.new({
    attributes: DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequestAttributes.new({
      aws: DatadogAPIClient::V2::CloudInventorySyncConfigAWSRequestAttributes.new({
        aws_account_id: "123456789012",
        destination_bucket_name: "my-inventory-bucket",
        destination_bucket_region: "us-east-1",
        destination_prefix: "logs/",
      }),
      azure: DatadogAPIClient::V2::CloudInventorySyncConfigAzureRequestAttributes.new({
        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: DatadogAPIClient::V2::CloudInventorySyncConfigGCPRequestAttributes.new({
        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: DatadogAPIClient::V2::CloudInventoryCloudProviderId::AWS,
    type: DatadogAPIClient::V2::CloudInventoryCloudProviderRequestType::CLOUD_PROVIDER,
  }),
})
p api_instance.upsert_sync_config(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Enable Storage Management for a bucket returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.UpsertCloudInventorySyncConfigRequest{
		Data: datadogV2.UpsertCloudInventorySyncConfigRequestData{
			Attributes: datadogV2.UpsertCloudInventorySyncConfigRequestAttributes{
				Aws: &datadogV2.CloudInventorySyncConfigAWSRequestAttributes{
					AwsAccountId:            "123456789012",
					DestinationBucketName:   "my-inventory-bucket",
					DestinationBucketRegion: "us-east-1",
					DestinationPrefix:       datadog.PtrString("logs/"),
				},
				Azure: &datadogV2.CloudInventorySyncConfigAzureRequestAttributes{
					ClientId:       "11111111-1111-1111-1111-111111111111",
					Container:      "inventory-container",
					ResourceGroup:  "my-resource-group",
					StorageAccount: "mystorageaccount",
					SubscriptionId: "33333333-3333-3333-3333-333333333333",
					TenantId:       "22222222-2222-2222-2222-222222222222",
				},
				Gcp: &datadogV2.CloudInventorySyncConfigGCPRequestAttributes{
					DestinationBucketName: "my-inventory-reports",
					ProjectId:             "my-gcp-project",
					ServiceAccountEmail:   "reader@my-gcp-project.iam.gserviceaccount.com",
					SourceBucketName:      "my-monitored-bucket",
				},
			},
			Id:   datadogV2.CLOUDINVENTORYCLOUDPROVIDERID_AWS,
			Type: datadogV2.CLOUDINVENTORYCLOUDPROVIDERREQUESTTYPE_CLOUD_PROVIDER,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewStorageManagementApi(apiClient)
	resp, r, err := api.UpsertSyncConfig(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `StorageManagementApi.UpsertSyncConfig`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `StorageManagementApi.UpsertSyncConfig`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Enable Storage Management for a bucket returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StorageManagementApi;
import com.datadog.api.client.v2.model.CloudInventoryCloudProviderId;
import com.datadog.api.client.v2.model.CloudInventoryCloudProviderRequestType;
import com.datadog.api.client.v2.model.CloudInventorySyncConfigAWSRequestAttributes;
import com.datadog.api.client.v2.model.CloudInventorySyncConfigAzureRequestAttributes;
import com.datadog.api.client.v2.model.CloudInventorySyncConfigGCPRequestAttributes;
import com.datadog.api.client.v2.model.CloudInventorySyncConfigResponse;
import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequest;
import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequestAttributes;
import com.datadog.api.client.v2.model.UpsertCloudInventorySyncConfigRequestData;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    StorageManagementApi apiInstance = new StorageManagementApi(defaultClient);

    UpsertCloudInventorySyncConfigRequest body =
        new UpsertCloudInventorySyncConfigRequest()
            .data(
                new UpsertCloudInventorySyncConfigRequestData()
                    .attributes(
                        new UpsertCloudInventorySyncConfigRequestAttributes()
                            .aws(
                                new CloudInventorySyncConfigAWSRequestAttributes()
                                    .awsAccountId("123456789012")
                                    .destinationBucketName("my-inventory-bucket")
                                    .destinationBucketRegion("us-east-1")
                                    .destinationPrefix("logs/"))
                            .azure(
                                new CloudInventorySyncConfigAzureRequestAttributes()
                                    .clientId("11111111-1111-1111-1111-111111111111")
                                    .container("inventory-container")
                                    .resourceGroup("my-resource-group")
                                    .storageAccount("mystorageaccount")
                                    .subscriptionId("33333333-3333-3333-3333-333333333333")
                                    .tenantId("22222222-2222-2222-2222-222222222222"))
                            .gcp(
                                new CloudInventorySyncConfigGCPRequestAttributes()
                                    .destinationBucketName("my-inventory-reports")
                                    .projectId("my-gcp-project")
                                    .serviceAccountEmail(
                                        "reader@my-gcp-project.iam.gserviceaccount.com")
                                    .sourceBucketName("my-monitored-bucket")))
                    .id(CloudInventoryCloudProviderId.AWS)
                    .type(CloudInventoryCloudProviderRequestType.CLOUD_PROVIDER));

    try {
      CloudInventorySyncConfigResponse result = apiInstance.upsertSyncConfig(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling StorageManagementApi#upsertSyncConfig");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Enable Storage Management for a bucket returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_storage_management::StorageManagementAPI;
use datadog_api_client::datadogV2::model::CloudInventoryCloudProviderId;
use datadog_api_client::datadogV2::model::CloudInventoryCloudProviderRequestType;
use datadog_api_client::datadogV2::model::CloudInventorySyncConfigAWSRequestAttributes;
use datadog_api_client::datadogV2::model::CloudInventorySyncConfigAzureRequestAttributes;
use datadog_api_client::datadogV2::model::CloudInventorySyncConfigGCPRequestAttributes;
use datadog_api_client::datadogV2::model::UpsertCloudInventorySyncConfigRequest;
use datadog_api_client::datadogV2::model::UpsertCloudInventorySyncConfigRequestAttributes;
use datadog_api_client::datadogV2::model::UpsertCloudInventorySyncConfigRequestData;

#[tokio::main]
async fn main() {
    let body =
        UpsertCloudInventorySyncConfigRequest::new(UpsertCloudInventorySyncConfigRequestData::new(
            UpsertCloudInventorySyncConfigRequestAttributes::new()
                .aws(
                    CloudInventorySyncConfigAWSRequestAttributes::new(
                        "123456789012".to_string(),
                        "my-inventory-bucket".to_string(),
                        "us-east-1".to_string(),
                    )
                    .destination_prefix("logs/".to_string()),
                )
                .azure(CloudInventorySyncConfigAzureRequestAttributes::new(
                    "11111111-1111-1111-1111-111111111111".to_string(),
                    "inventory-container".to_string(),
                    "my-resource-group".to_string(),
                    "mystorageaccount".to_string(),
                    "33333333-3333-3333-3333-333333333333".to_string(),
                    "22222222-2222-2222-2222-222222222222".to_string(),
                ))
                .gcp(CloudInventorySyncConfigGCPRequestAttributes::new(
                    "my-inventory-reports".to_string(),
                    "my-gcp-project".to_string(),
                    "reader@my-gcp-project.iam.gserviceaccount.com".to_string(),
                    "my-monitored-bucket".to_string(),
                )),
            CloudInventoryCloudProviderId::AWS,
            CloudInventoryCloudProviderRequestType::CLOUD_PROVIDER,
        ));
    let configuration = datadog::Configuration::new();
    let api = StorageManagementAPI::with_config(configuration);
    let resp = api.upsert_sync_config(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Enable Storage Management for a bucket returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.StorageManagementApi(configuration);

const params: v2.StorageManagementApiUpsertSyncConfigRequest = {
  body: {
    data: {
      attributes: {
        aws: {
          awsAccountId: "123456789012",
          destinationBucketName: "my-inventory-bucket",
          destinationBucketRegion: "us-east-1",
          destinationPrefix: "logs/",
        },
        azure: {
          clientId: "11111111-1111-1111-1111-111111111111",
          container: "inventory-container",
          resourceGroup: "my-resource-group",
          storageAccount: "mystorageaccount",
          subscriptionId: "33333333-3333-3333-3333-333333333333",
          tenantId: "22222222-2222-2222-2222-222222222222",
        },
        gcp: {
          destinationBucketName: "my-inventory-reports",
          projectId: "my-gcp-project",
          serviceAccountEmail: "reader@my-gcp-project.iam.gserviceaccount.com",
          sourceBucketName: "my-monitored-bucket",
        },
      },
      id: "aws",
      type: "cloud_provider",
    },
  },
};

apiInstance
  .upsertSyncConfig(params)
  .then((data: v2.CloudInventorySyncConfigResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}

## Delete a Storage Management configuration{% #delete-a-storage-management-configuration %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                       |
| ----------------- | ---------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/{id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/{id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/cloudinventoryservice/syncconfigs/{id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigs/{id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigs/{id}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/{id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/{id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/{id} |

### Overview

Delete a Storage Management configuration by its unique identifier. Deleting a configuration stops inventory file synchronization for the associated cloud account. This endpoint requires the `aws_configurations_manage` permission.

### Arguments

#### Path Parameters

| Name                 | Type   | Description                                                |
| -------------------- | ------ | ---------------------------------------------------------- |
| id [*required*] | string | Unique identifier of the Storage Management configuration. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export id="abc123" \# Curl command curl -X DELETE "https://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs/${id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
{% /tab %}
