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

Bucket operations - Versioning.

Link to this section Summary

Functions

GetBucketVersioning - gets the versioning state of a bucket.

GetBucketVersions (ListObjectVersions) - lists the versions of all objects and delete markers in a bucket.

PutBucketVersioning - configures the versioning state for 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

get(config, bucket)

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

GetBucketVersioning - gets the versioning state of a bucket.

examples

Examples

iex> Aliyun.Oss.Bucket.Versioning.get("some-bucket")
{:ok, %Aliyun.Oss.Client.Response{
  data: %{"VersioningConfiguration" => %{"Status" => "Enabled"}},
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}
Link to this function

list_object_versions(config, bucket, query_params \\ %{})

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

GetBucketVersions (ListObjectVersions) - lists the versions of all objects and delete markers in a bucket.

examples

Examples

iex> Aliyun.Oss.Bucket.Versioning.list_object_versions("some-bucket")
{:ok, %Aliyun.Oss.Client.Response{
  data: %{
    "ListVersionsResult" => %{
      "Delimiter" => nil,
      "IsTruncated" => true,
      "KeyMarker" => nil,
      "MaxKeys" => 100,
      "Name" => "zidcn-test",
      "NextKeyMarker" => "docs/test2.txt",
      "NextVersionIdMarker" => "null",
      "Prefix" => nil,
      "Version" => [
        # ...
      ],
      "VersionIdMarker" => nil,
    }
  },
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}
Link to this function

put(config, bucket, status)

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

PutBucketVersioning - configures the versioning state for a bucket.

examples

Examples

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