Aliyun.Oss.Bucket.Replication.put

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

put(bucket, config)

Specs

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

PutBucketReplication接口用于为存储空间(Bucket)指定跨区域复制规则。

Examples

iex> config_json = %{
  "ReplicationConfiguration" => %{
    "Rule" => %{
      "Action" => "ALL",
      "Destination" => %{
        "Bucket" => "replication-test",
        "Location" => "oss-cn-beijing",
        "TransferType" => "internal"
      },
      "HistoricalObjectReplication" => "disabled"
    }
  }
}
iex> Aliyun.Oss.Bucket.Replication.put("some-bucket", 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"?>
  <ReplicationConfiguration>
    <Rule>
      <Action>ALL</Action>
      <Destination>
          <Bucket>replication-test</Bucket>
          <Location>oss-cn-beijing</Location>
          <TransferType>internal</TransferType>
      </Destination>
      <HistoricalObjectReplication>disabled</HistoricalObjectReplication>
    </Rule>
  </ReplicationConfiguration>
]
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"},
    ...
  ]
}}