Requester pays expose userProject#2558
Conversation
…java into requester_pays
|
PTAL |
| /** | ||
| * Returns an option for bucket's billing user project. This option is only used by the buckets with | ||
| * 'requester_pays' flag. | ||
| */ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| */ | ||
| List<Boolean> delete(Iterable<BlobId> blobIds); | ||
|
|
||
| /** |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * | ||
| * <p>Example of getting the ACL entry for a specific user on a bucket. | ||
| * <pre> {@code | ||
| * String bucketName = "my_unique_bucket"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return Collections.unmodifiableList(results); | ||
| } | ||
|
|
||
| @Override |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| */ | ||
| RewriteResponse continueRewrite(RewriteResponse previousResponse); | ||
|
|
||
| /** |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| // Test listing a Requester Pays bucket. | ||
| Bucket remoteBucket = storage.get(BUCKET, Storage.BucketGetOption.fields(BucketField.ID)); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| StorageRoles.legacyBucketOwner(), | ||
| (Set<Identity>) newHashSet(projectOwner, projectEditor), | ||
| StorageRoles.legacyBucketReader(), newHashSet(projectViewer)); | ||
| (Set<Identity>) Sets.newHashSet(projectOwner, projectEditor), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Addressed all comments. PTAL |
| * String bucketName = "my_unique_bucket"; | ||
| * String userEmail = "google-cloud-java-tests@java-docs-samples-tests.iam.gserviceaccount.com"; | ||
| * Acl acl = storage.getAcl(bucketName, new User(userEmail)); | ||
| * BucketSourceOption userProjectOption = BucketSourceOption.userProject("myProject"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * | ||
| * @throws StorageException upon failure | ||
| */ | ||
| Acl getAcl(String bucket, Entity entity, BucketSourceOption... options); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * <pre> {@code | ||
| * String bucketName = "my_unique_bucket"; | ||
| * boolean deleted = storage.deleteAcl(bucketName, User.ofAllAuthenticatedUsers()); | ||
| * BucketSourceOption userProject = BucketSourceOption.userProject("myProject"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| Acl createAcl(String bucket, Acl acl, BucketSourceOption... options); | ||
|
|
||
| /** | ||
| * @see com.google.cloud.storage.Storage#createAcl(String bucket, Acl acl, BucketSourceOption... options) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| try { | ||
| storage.bucketAccessControls().delete(bucket, entity).execute(); | ||
| storage.bucketAccessControls().delete(bucket, entity) | ||
| .setUserProject(Option.USER_PROJECT.getString(options)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Replied to all comments. PTAL. |
vam-google
left a comment
There was a problem hiding this comment.
Overall LGTM, with few minor comments. Please address them before pushing (you don't have to request for another LGTM to push your changes).
| Acl updateAcl(String bucket, Acl acl, BucketSourceOption... options); | ||
|
|
||
| /** | ||
| * @see Storage#updateAcl(String, Acl, BucketSourceOption...) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * // do something with ACL entry | ||
| * } | ||
| * }</pre> | ||
| * |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Expose userProject for the operations - storage.objects.list - storage.bucket.testIamPermissions - storage.bucketAccessControls.delete - storage.bucketAccessControls.get - storage.bucketAccessControls.insert - storage.bucketAccessControls.list - storage.bucketAccessControls.patch - storage.buckets.getIamPolicy - storage.buckets.setIamPolicy
…-info-reports-plugin to v3.6.2 (#2558)
Expose userProject for the operations