google-cloud-node icon indicating copy to clipboard operation
google-cloud-node copied to clipboard

Add GCS bucket labels feature

Open swcloud opened this issue 9 years ago • 3 comments

swcloud avatar Jun 09 '17 01:06 swcloud

We currently support setting any property of the Bucket resource in storage.createBucket():

storage.createBucket({
  labels: {
    myLabel: 'my label value'
  }
}, function(err, bucket) {})

If a user wants to update the labels, they can use bucket.setMetadata():

bucket.setMetadata({
  labels: {
    myLabel: 'my new label value'
  }
}, function(err) {})

Do we need more than this?

stephenplusplus avatar Jun 12 '17 15:06 stephenplusplus

Got an update on what is wanted:

  • bucket.deleteLabels([labelName, ...], function(err) {})
  • bucket.getLabels(function(err, labels) {})
  • bucket.setLabels({ labelName: 'labelValue' }, function(err) {})

@danoscarmike does this look correct?

stephenplusplus avatar Jun 12 '17 17:06 stephenplusplus

Yes, looks right to me. @jskeet for vis.

danoscarmike avatar Jun 14 '17 15:06 danoscarmike