EMC ECS REST API

Search (SHIFT+S)




Set Bucket Policy

PUT /object/bucket/{bucketName}/policy

Add/Replace the policy on the specified bucket

bucketNameName of the bucket for which the policy is to be displayed.

Query Parameters

namespacenamespace of the bucket

Required Roles

Requires one of the following roles:

  • SYSTEM_ADMIN

  • NAMESPACE_ADMIN


Prerequisites

The following conditions must be met in order to call this operation.

  • Bucket must exist.


Request Payload

All parameters are required unless otherwise stated.

Field Description Type Notes
set_bucket_policy
Version Specifies the policy language version. String
Id Specifies an optional identifier for the policy. String
Statement    
Sid It is an optional identifier that is provided for the policy statement. String
Effect Specifies whether the statement will result in an allow or an explicit deny. String
Principal Specifies the User String
NotPrincipal Use the NotPrincipal element to specify an exception to a list of principals String
Action Specifies the action or actions that will be allowed or denied. Statements must include either an Action or NotAction element. String
NotAction Specifies an advanced policy element that explicitly matches everything except a list of actions. String
Resource Specifies the object or objects that the statement covers. String
NotResource Specifies an advanced policy element that explicitly matches everything except a list of resources. String
Condition An optional element which specifies conditions for when a policy is in effect. String

Response Body

Response indicating Success or Failure of the operation


JSON Example

Request
> PUT /bucket1/policy HTTP/1.1
> Host: 192.168.0.0:9021
> User-Agent: curl/7.43.0
> Accept: */*
> Date: Wed, 24 May 2017 01:04:30 +0000
> Authorization: AWS usr:trMwEQOoJTuT+G0wGVuFSu3/6tM=
> Content-Length: 236
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
Response
< HTTP/1.1 200 OK
< Date: Wed, 24 May 2017 01:04:30 GMT
< Server: ViPR/1.0
< x-amz-request-id: 0af9f567:15c37397b93:1098:1
< x-amz-id-2: 79ec477d47e7382e9c95b2860282a2283d5cc504d13d0c372caf03f8fae64697
< ETag: "a491bcbb2a23d666b3e7918177736000"
< Last-Modified: Wed, 24 May 2017 01:04:30 GMT
< x-emc-mtime: 1495587870656
< x-emc-previous-object-size: 233
< x-amz-server-side-encryption: AES256
< x-amz-copy-source-version-id:
< Content-Length: 0
<
* Connection #0 to host 10.249.245.103 left intact