Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requester pays samples #453

Merged
merged 7 commits into from
Aug 15, 2017
Merged

Add requester pays samples #453

merged 7 commits into from
Aug 15, 2017

Conversation

ace-n
Copy link
Contributor

@ace-n ace-n commented Aug 12, 2017

No description provided.

@ace-n ace-n requested review from jmdobry and frankyn August 12, 2017 03:11
@codecov
Copy link

codecov bot commented Aug 12, 2017

Codecov Report

Merging #453 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #453   +/-   ##
=======================================
  Coverage   83.84%   83.84%           
=======================================
  Files           4        4           
  Lines         421      421           
=======================================
  Hits          353      353           
  Misses         68       68

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e99370...37c1837. Read the comment docs.

Copy link
Member

@jmdobry jmdobry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you need to add the samples to package.json and then re-generate the readme

@ace-n
Copy link
Contributor Author

ace-n commented Aug 15, 2017

Done - FYI, I wasn't sure whether or not this sample warranted a README update since requesterPays.js seemed like a mix of stuff from other files.

Examples:
node requesterPays.js enable my-bucket Enables requester-pays requests on a bucket named
"my-bucket".
node requesterPays.js list Disables requester-pays requests on a bucket named
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be disable? I think the README didn't generate correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 😄 - good catch!

Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up Ace! I added two comments. I'll approve after the README is fixed.

let status;
const metadata = data[0];
if (metadata && metadata.billing && metadata.billing.requesterPays) {
status = `enabled`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this string use single-quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the other strings should use backticks. Will fix.

@@ -177,8 +177,8 @@ const cli = require(`yargs`)
(opts) => downloadFileUsingRequesterPays(opts.projectId, opts.bucketName, opts.srcFileName, opts.destFileName)
)
.example(`node $0 enable my-bucket`, `Enables requester-pays requests on a bucket named "my-bucket".`)
.example(`node $0 list`, `Disables requester-pays requests on a bucket named "my-bucket".`)
.example(`node $0 delete my-bucket`, `Determines whether requester-pays requests are enabled for a bucket named "my-bucket".`)
.example(`node $0 disable`, `Disables requester-pays requests on a bucket named "my-bucket".`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last nit, disable should accept a bucket id similar to enable.