REST APIGit
Allow a repository
Editors and admins may add repositories they can read at the provider (checked through the provider API with the caller's connection); `write` needs push permission there. Adding an existing entry again changes its access.
Generated from
openapi/harthelm.yaml at v1.5.0POST
cookie
__Host-harthelm_session<token>Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header
Harthelm-CSRF: 1 and a matching Origin.
ws*integerNumeric resource id.
Format
int64Range
1 <= valueIdempotency-Key?stringClient-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.
Length
1 <= length <= 255application/json- body
provider*GitProviderIDValueMatch
^[a-z][a-z0-9-]{0,30}$repo*stringMatch
^[A-Za-z0-9][A-Za-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._-]{0,99}$access*GitAccessLevelwrite also allows git push (receive-pack).
Value in
"read""write"The entry.
application/json- response
provider*stringrepo*stringowner/name, lower case (the proxy compares case-insensitively).
access*GitAccessLevelwrite also allows git push (receive-pack).
Value in
"read""write"origin*booleanThe repository the workspace was cloned from.
added_by?IDNumeric resource id.
Format
int64Range
1 <= valuecreated_at*stringFormat
date-timecurl -X POST 'https://console.example.com/api/v1/workspaces/1/git-access' \ -H 'Content-Type: application/json' \ -d '{ "provider": "string", "repo": "string", "access": "read"}'{ "provider": "string", "repo": "string", "access": "read", "origin": true, "added_by": 1, "created_at": "2019-08-24T14:15:22Z"}