Object Storage Policies
IAM policies define permissions that control what actions users, groups, and roles can perform on your Object Storage resources. Policies are JSON documents that follow the AWS IAM policy syntax.
List policies
Returns a list of available IAM policies by given {service_uuid}.
Request
curl -X GET https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies \
-u your_username:your_password
Get policy details
Returns policy details by given {service_uuid} and {policy_name}.
Request
curl -X GET https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/custom-policy \
-u your_username:your_password
Create policy
Creates a new IAM policy.
Attributes
- Name
name- Type
- string
- Description
The name of the policy. 1-128 characters.
- Name
document- Type
- string
- Description
The policy document in JSON format. 1-6144 characters.
- Name
description- Type
- string
- Description
A description of the policy.
Request
curl -X POST https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies \
-u your_username:your_password \
-H "Content-Type: application/json" \
-d '{
"name": "read-only-policy",
"document": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":[\"s3:GetObject\",\"s3:ListBucket\"],\"Effect\":\"Allow\",\"Resource\":\"*\"}]}",
"description": "Read-only access to all buckets"
}'
Delete policy
Deletes an IAM policy by given {service_uuid} and {policy_name}. The policy must not be attached to any users, groups, or roles.
Request
curl -X DELETE https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/read-only-policy \
-u your_username:your_password
List policy versions
Returns a list of policy versions by given {service_uuid} and {policy_name}.
Request
curl -X GET https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/custom-policy/versions \
-u your_username:your_password
Get policy version
Returns a specific policy version by given {service_uuid}, {policy_name} and {version_id}.
Request
curl -X GET https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/custom-policy/versions/v1 \
-u your_username:your_password
Create policy version
Creates a new version of an existing policy.
Attributes
- Name
document- Type
- string
- Description
The policy document in JSON format.
- Name
set_as_default- Type
- boolean
- Description
Set this version as the default. Default: false.
Request
curl -X POST https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/custom-policy/versions \
-u your_username:your_password \
-H "Content-Type: application/json" \
-d '{
"document": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":[\"s3:GetObject\"],\"Effect\":\"Allow\",\"Resource\":\"*\"}]}",
"set_as_default": true
}'
Delete policy version
Deletes a policy version by given {service_uuid}, {policy_name} and {version_id}. You cannot delete the default version.
Request
curl -X DELETE https://api.upcloud.com/1.3/object-storage-2/0ab2f83f-03f3-4c48-9a38-0a3e89c6d024/policies/custom-policy/versions/v1 \
-u your_username:your_password