Aliyun.Oss.Bucket.Inventory.put

You're seeing just the function put, go back to Aliyun.Oss.Bucket.Inventory module for more information.
Link to this function

put(bucket, inventory_id, config)

Specs

put(String.t(), String.t(), String.t() | map()) ::
  {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}

PutBucketInventory接口用于为某个存储空间(Bucket)配置清单(Inventory)规则。

Examples

iex> config_json = %{
  "InventoryConfiguration" => %{
    "Destination" => %{
      "OSSBucketDestination" => %{
        "AccountId" => "100000000000000",
        "Bucket" => "acs:oss:::bucket_0001",
        "Encryption" => %{"SSE-KMS" => %{"KeyId" => "keyId"}},
        "Format" => "CSV",
        "Prefix" => "prefix1",
        "RoleArn" => "acs:ram::100000000000000:role/AliyunOSSRole"
      }
    },
    "Filter" => %{"Prefix" => "Pics"},
    "Id" => "56594298207FB304438516F9",
    "IncludedObjectVersions" => "All",
    "IsEnabled" => "true",
    "OptionalFields" => %{
      "Field" => ["Size", "LastModifiedDate", "ETag", "StorageClass",
      "IsMultipartUploaded", "EncryptionStatus"]
    },
    "Schedule" => %{"Frequency" => "Daily"}
  }
}
iex> Aliyun.Oss.Bucket.Inventory.put("some-bucket", "inventory_id", config_json)
{:ok, %Aliyun.Oss.Client.Response{
  data: "",
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}
iex> config_xml = ~S[
    <?xml version="1.0" encoding="UTF-8"?>
    <InventoryConfiguration>
      <Id>56594298207FB304438516F9</Id>
      <IsEnabled>true</IsEnabled>
      ...
    </InventoryConfiguration>
]
iex> Aliyun.Oss.Bucket.Inventory.put("some-bucket", "inventory_id", config_xml)
{:ok, %Aliyun.Oss.Client.Response{
  data: "",
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}