EMC ECS REST API

Search (SHIFT+S)




New in this release

Set Bucket Policy

PUT /?policy

Sets the policy for the bucket.

URL Format

Host Style: http://bucketname.ns1.emc.com/?policy
Path Style: http://ns1.emc.com/bucketname?policy

Request Headers

Content-MD5 required128-bit MD5 digest of data which is base64 encoded. This is used to verify that the request was not corrupted during transit.
x-amz-date optionalTimestamp of the request added by the requester. Example: Tue, 03 Sept 2013 12:00:00 GMT. If the Authorization header is specified, either the x-amz-date or the Date header must also be specified If both the headers are specified, the value of x-amz-date header is chosen.
Authorization requiredInformation needed to authenticate requests.

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.

  • Only the owner of the bucket can create and a user having permission can replace a policy

  • BaseUrl used in a host-style request URL should be pre-configured using the ECS Management API or the ECS Portal (for example, emc.com in the URL: bucketname.ns1.emc.com).

  • Namespace corresponding to this bucket should exist (for example, ns1).


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 HTTP Success or Failure for this operation