Aliyun.Oss.Bucket.Encryption (aliyun_oss v2.0.0)
Bucket operations - Encryption.
Link to this section Summary
Functions
DeleteBucketEncryption - deletes encryption rules configured for a bucket.
GetBucketEncryption - gets the encryption rules configured for a bucket.
PutBucketEncryption - configures encryption rules for a bucket.
Link to this section Types
Link to this type
error()
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()}
DeleteBucketEncryption - deletes encryption rules configured for a bucket.
examples
Examples
iex> Aliyun.Oss.Bucket.Encryption.delete("some-bucket")
{:ok,
%Aliyun.Oss.Client.Response{
data: "",
headers: [
{"Server", "AliyunOSS"},
{"Date", "Fri, 11 Jan 2019 05:19:45 GMT"},
{"Content-Length", "0"},
{"Connection", "keep-alive"},
{"x-oss-request-id", "5C3000000000000000000000"},
{"x-oss-server-time", "90"}
]
}}
Link to this function
get(config, bucket)
@spec get(Aliyun.Oss.Config.t(), String.t()) :: {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}
GetBucketEncryption - gets the encryption rules configured for a bucket.
examples
Examples
iex> Aliyun.Oss.Bucket.Encryption.get("some-bucket")
{:ok, %Aliyun.Oss.Client.Response{
data: %{
"ServerSideEncryptionRule" => %{
"ApplyServerSideEncryptionByDefault" => %{
"SSEAlgorithm" => "AES256"
}
}
},
headers: [
{"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
...
]
}}
Link to this function
put(config, bucket, opts \\ [])
@spec put(Aliyun.Oss.Config.t(), String.t(), Keyword.t()) :: {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}
PutBucketEncryption - configures encryption rules for a bucket.
options
Options
:algorithm
- Accept value::aes256
,:kms
, default is:aes256
:kms_master_key_id
- Should and only be set if algorithm is:kms
examples
Examples
iex> Aliyun.Oss.Bucket.Encryption.put("some-bucket", algorithm: :aes256)
{:ok,
%Aliyun.Oss.Client.Response{
data: "",
headers: [
{"Server", "AliyunOSS"},
{"Date", "Fri, 11 Jan 2019 05:05:50 GMT"},
{"Content-Length", "0"},
{"Connection", "keep-alive"},
{"x-oss-request-id", "5C0000000000000000000000"},
{"x-oss-server-time", "63"}
]
}}