Aliyun.Oss.Bucket.Tags (aliyun_oss v2.0.0)

Bucket operations - Tags.

Link to this section Summary

Functions

DeleteBucketTags - deletes tags configured for a bucket.

GetBucketTags - gets the tags configured for a bucket.

PutBucketTags - adds tags to a bucket or modifies the tags of a bucket.

Link to this section Types

@type error() ::
  %Aliyun.Oss.Client.Error{
    body: String.t(),
    parsed_details: map(),
    status_code: integer()
  }
  | atom()

Link to this section Functions

Link to this function

delete(config, bucket)

@spec delete(Aliyun.Oss.Config.t(), String.t()) ::
  {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}

DeleteBucketTags - deletes tags configured for a bucket.

examples

Examples

iex> Aliyun.Oss.Bucket.Tags.delete("some-bucket")
{:ok,
%Aliyun.Oss.Client.Response{
  data: "",
  headers: [
    {"Server", "AliyunOSS"},
    {"Date", "Fri, 11 Jan 2019 05:19:45 GMT"},
    ...
  ]
}}
iex> Aliyun.Oss.Bucket.Tags.delete("unknown-bucket")
{:error,
%Aliyun.Oss.Client.Error{
  parsed_details: %{
    "BucketName" => "unknown-bucket",
    "Code" => "NoSuchBucket",
    "HostId" => "unknown-bucket.oss-cn-shenzhen.aliyuncs.com",
    "Message" => "The specified bucket does not exist.",
    "RequestId" => "5C38283EC84D1C4471F2F48A"
  },
  body: "<?xml version="1.0" encoding="UTF-8"?>...</xml>",
  status_code: 404
}}
Link to this function

get(config, bucket)

@spec get(Aliyun.Oss.Config.t(), String.t()) ::
  {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}

GetBucketTags - gets the tags configured for a bucket.

examples

Examples

iex> Aliyun.Oss.Bucket.Tagging.get("some-bucket")
{:ok, %Aliyun.Oss.Client.Response{
    data: %{"Tagging" => %{"TagSet" => [%{"Key" => "key", "Value" => "value"}]}},
    headers: [
      {"Server", "AliyunOSS"},
      {"Date", "Fri, 01 Mar 2019 06:26:07 GMT"},
      ...
    ]
  }
}
Link to this function

put(config, bucket, tags)

@spec put(Aliyun.Oss.Config.t(), String.t(), [{String.t(), String.t()}, ...]) ::
  {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}

PutBucketTags - adds tags to a bucket or modifies the tags of a bucket.

examples

Examples

iex> Aliyun.Oss.Bucket.Tags.put("some-bucket", [{"key1", "value1"}, {:key2, "value2}])
{:ok, %Aliyun.Oss.Client.Response{
    data: "",
    headers: [
      {"Server", "AliyunOSS"},
      {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
      ...
    ]
  }
}