Skip to content

Commit

Permalink
explorer支持bcs
Browse files Browse the repository at this point in the history
  • Loading branch information
leeight committed Aug 25, 2015
1 parent e2061cd commit 6a42767
Show file tree
Hide file tree
Showing 13 changed files with 4,922 additions and 2,335 deletions.
37 changes: 37 additions & 0 deletions baidubce-sdk.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4504,6 +4504,43 @@ BcsClient.prototype.createBucket = function (bucketName, options) {
});
};

BcsClient.prototype.setBucketAcl = function (bucketName, acl, options) {
options = options || {};

var headers = {};
headers[H.CONTENT_TYPE] = 'application/json; charset=UTF-8';
return this._sendRequest('PUT', {
bucketName: bucketName,
body: JSON.stringify({accessControlList: acl}),
headers: headers,
params: {acl: ''},
config: options.config
});
};

BcsClient.prototype.setBucketCannedAcl = function (bucketName, cannedAcl, options) {
options = options || {};

var headers = {};
headers[H.X_BCE_ACL] = cannedAcl;
return this._sendRequest('PUT', {
bucketName: bucketName,
headers: headers,
params: {acl: ''},
config: options.config
});
};

BcsClient.prototype.getBucketAcl = function (bucketName, options) {
options = options || {};

return this._sendRequest('GET', {
bucketName: bucketName,
params: {acl: '1'},
config: options.config
});
};

BcsClient.prototype.deleteBucket = function (bucketName, options) {
options = options || {};

Expand Down
37 changes: 37 additions & 0 deletions src/bcs_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,43 @@ BcsClient.prototype.createBucket = function (bucketName, options) {
});
};

BcsClient.prototype.setBucketAcl = function (bucketName, acl, options) {
options = options || {};

var headers = {};
headers[H.CONTENT_TYPE] = 'application/json; charset=UTF-8';
return this._sendRequest('PUT', {
bucketName: bucketName,
body: JSON.stringify({accessControlList: acl}),
headers: headers,
params: {acl: ''},
config: options.config
});
};

BcsClient.prototype.setBucketCannedAcl = function (bucketName, cannedAcl, options) {
options = options || {};

var headers = {};
headers[H.X_BCE_ACL] = cannedAcl;
return this._sendRequest('PUT', {
bucketName: bucketName,
headers: headers,
params: {acl: ''},
config: options.config
});
};

BcsClient.prototype.getBucketAcl = function (bucketName, options) {
options = options || {};

return this._sendRequest('GET', {
bucketName: bucketName,
params: {acl: '1'},
config: options.config
});
};

BcsClient.prototype.deleteBucket = function (bucketName, options) {
options = options || {};

Expand Down
Loading

0 comments on commit 6a42767

Please sign in to comment.