Repository navigation
docs(examples): add a team member, a bucket and an upload to the service account script - #111
Closed
ehennestad wants to merge 7 commits into
Closed
ehennestad wants to merge 7 commits into
ehennestad wants to merge 7 commits into
Conversation
addTeamUser sends PUT /rest/v1/collabs/{collabId}/team/{role}/users/
{username}, which gives a user the role "viewer", "editor" or
"administrator" in a collab. A 204 (No Content) response is the
success case, as documented in the OpenAPI spec of the Collaboratory
API; any other status is reported through throwError.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## add-create-bucket-method #111 +/- ##
=========================================================
Coverage 90.50% 90.50%
=========================================================
Files 137 137
Lines 3580 3580
=========================================================
Hits 3240 3240
Misses 340 340 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The team endpoint is a PUT without a body. MATLAB warns (MATLAB:http:BodyExpectedFor) when such a request is sent, so every call to addTeamUser printed the warning. The warning is turned off for the request and restored afterwards, as BucketsClient does for its PUT requests without a body. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
createBucket sends POST /api/v1/buckets with the body
{"bucket_name": <name>}, the endpoint the Data Proxy API documents for
creating the bucket of a collab. A 200 (OK) response is the success
case; any other status is reported through throwError.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ehennestad
force-pushed
the
extend-service-account-example
branch
from
November 11, 2026 10:57
4db68aa to
b68ff2f
Compare
The Data Proxy answers POST /api/v1/buckets with 201 (Created) when it has created the bucket and with 204 (No Content) when the bucket exists already, where its API spec documents 200 (OK). createBucket reported the 201 of a bucket it had just created as an error. All three statuses are now the success case, and a bucket that exists is left as it is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ehennestad
force-pushed
the
extend-service-account-example
branch
from
November 11, 2026 12:39
b68ff2f to
28f2b23
Compare
createBucket returns true when the Data Proxy created the bucket and false when it answered 204 (No Content) for a bucket that existed already. The value is returned only when asked for, so a call without a semicolon displays nothing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ice account script After creating the collab, the script adds a user to its team with addTeamUser, creates the bucket of the collab with createBucket and uploads a small text file to it with ebrains.bucket.uploadFile. It reports each step as it completes, and names the step that failed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… bucket The script prints that the bucket existed already when createBucket returns false, and that it was created otherwise. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ehennestad
force-pushed
the
extend-service-account-example
branch
from
November 11, 2026 12:42
28f2b23 to
6a067a4
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
examples/collab/checkServiceAccountCanCreateCollab.mstopped after creating a collab. This PR extends it with the next steps of setting up a collab as a service account in the integration environment:CollabsClient.addTeamUseradds the userTEAM_USERNAMEto the team with the roleTEAM_ROLE.BucketsClient.createBucketcreates the bucket of the collab, which has the name of the collab. The script prints whether the bucket was created or existed already.ebrains.bucket.uploadFileuploads a one-line text file to the bucket asOBJECT_NAME. The file is written totempdirand deleted at the end.The script prints a line after each step that completes. When a step fails it prints which one, with the identifier and message of the error, and still switches back to the environment it started in.
🤖 Generated with Claude Code