API が変更されました。次を使用します。
var gcloud = require('gcloud')({
projectId: 'your_id',
keyFilename: 'your_path'
});
var storage = gcloud.storage();
var bucket = storage.bucket('bucket_name');
bucket.acl.default.add({
entity: 'allUsers',
role: storage.acl.READER_ROLE
}, function(err) {});
バケット全体を公開するには、次も使用できます。
bucket.makePublic
ソース: https://github.com/GoogleCloudPlatform/gcloud-node/blob/v0.16.0/lib/storage/bucket.js#L607
またはファイルのみの場合:
var bucketFile = bucket.file(filename);
// If you upload a new file, make sure to do this
// in the callback of upload success otherwise it will throw a 404 error
bucketFile.makePublic(function(err) {});
ソース: https://github.com/GoogleCloudPlatform/gcloud-node/blob/v0.16.0/lib/storage/file.js#L1241makePublic
(リンクは変更される可能性があります。ソース コードで探してください。)
または:
bucketFile.acl.add({
scope: 'allUsers',
role: storage.acl.READER_ROLE
}, function(err, aclObject) {});
これは冗長バージョンです。
ソース: https://github.com/GoogleCloudPlatform/gcloud-node/blob/v0.16.0/lib/storage/file.js#L116