Aliyun.Oss.Bucket.Website.get

You're seeing just the function get, go back to Aliyun.Oss.Bucket.Website module for more information.

Specs

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

GetBucketWebsite 接口用于查看bucket的静态网站托管状态以及跳转规则。

Examples

iex> Aliyun.Oss.Bucket.Website.get("some-bucket")
{:ok, %Aliyun.Oss.Client.Response{
  data: %{
    "WebsiteConfiguration" => %{"IndexDocument" => %{"Suffix" => "index.html"}}
  },
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}

iex> Aliyun.Oss.Bucket.Website.get("unkown-bucket")
{:error,
  %Aliyun.Oss.Client.Error{
    status_code: 404,
    parsed_details: %{
      "BucketName" => "unkown-bucket",
      "Code" => "NoSuchBucket",
      "HostId" => "unkown-bucket.oss-cn-shenzhen.aliyuncs.com",
      "Message" => "The specified bucket does not exist.",
      "RequestId" => "5C0000000000000000000000"
    },
    body: "<?xml version="1.0" encoding="UTF-8"?>...</xml>"
  }
}