Repository Group

Repository Group is the link object between Repositories and Groups. With them, you define which groups belong to what repository, and what the group members can do in the repository.

Attributes

repository

The Id of the repository that the membership is meant for. When requesting, can be expanded to the full repository object by including the query parameter expand=repository.

  • Type: string
  • Required: true

group

The ID of the group that the membership is meant for. When requesting, can be expanded to the full group object by including the query parameter expand=group.

  • Type: string
  • Required: true

role

The role that the group members have directly in the repository. Must be one of admin, master, developer, or guest.

  • Type: string
  • Required: true

Operations

GET /projects/:project_id/repositories/:repository_id/repository_groups

Lists all repository groups for a repository, with optional limit and offset parameters, as a metadata-results object.

GET /projects/:project_id/repositories/:repository_id/repository_groups/:group_id

Returns a specific repository group.

Example request

curl -X GET \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_groups/devs

Example response

{
"api_status": 200,
"api_timestamp": "2018-10-25T09:29:37Z",
"repository": {
"id": "acme"
},
"group": {
"id": "devs"
},
"role": "developer"
}

POST /projects/:project_id/repositories/:repository_id/repository_groups

Adds a repository group for a repository. The group must have a project role before a repository role can be defined.

Example request

curl -X POST \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
-H "Content-Type: application/json" \
-d '{ "repository_group": { "id": "devs", "role": "developer" } }' \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_groups

Example response

{ 
   "api_status": 201,
   "api_timestamp": "2018-10-25T09:29:37Z",
   "repository": {
       "id": "acme"
   },
   "group": {
       "id": "devs"
   },
   "role": "guest" 
}

PUT /projects/:project_id/repositories/:repository_id/repository_groups/:group_id

Updates role for a repository group. Returns the updated repository group.

Example request

curl -X PUT \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
-H "Content-Type: application/json" \
-d '{ "repository_group": { "role": "guest" } }' \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_groups/devs

Example response

{ 
   "api_status": 200,
   "api_timestamp": "2018-11-28T10:12:20Z",
   "repository": {
       "id": "acme" 
   },
   "group": {
       "id": "devs"
   },
   "role": "guest" 
}

DELETE /projects/:project_id/repositories/:repository_id/repository_groups/:group_id

Remove a group from a repository. Returns the removed repository group.

Example request

curl -X DELETE \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_groups/devs

Example response

{
   "api_status": 200,
   "api_timestamp": "2018-11-28T10:12:28Z",
   "repository": { 
       "id": "acme"
   },
   "group": {
       "id": "devs" 
   },
   "role": "guest" 
}