ditrit/gandalf

Add `GitProvider` endpoint on `domain`

Closed this issue · 0 comments

Steps:

  • Create a new object GitProvider defined like this :

table GitProvider

Field Type Constraints
ID Serial auto-increment not null unique
url Text not null
token Text not null
organization Text
insert_date timestamp not null
update_date timestamp not null
  • Add endpoint for GitProvider:
Endpoint Create new GitProvider
URL /domain/[DOMAIN_ID]/gitprovider
Method POST
Body type JSON
Body GitProvider object without id
Body request { "url": string, "token": string, "organization": string}
success status 201
Sucess Response generated Gitprovider
Body response { "ID": integer, "url": string, "token": string, "organization": string}
Authentication check Yes

Errors list:

  • 404 when unknown domain id
  • 400 on missing url or path
  • 400 if GitProvider already exist on domain
Endpoint Get GitProvider
URL /domain/[DOMAIN_ID]/gitprovider/[GITPROVIDER_ID]
Method GET
success status 200
Sucess Response Gitprovider
Body response { "ID": integer, "url": string, "token": string, "organization": string}
Authentication check Yes

Errors list:

  • 404 when unknown GitProvider id
Endpoint Update GitProvider
URL /domain/[DOMAIN_ID]/gitprovider/[GITPROVIDER_ID]
Method PUT
Body type JSON
Body GitProvider object without id
Body request { "url": string, "token": string, "organization": string}
success status 204
Authentication check Yes

Errors list:

  • 404 when unknown GitProvider id
  • 400 on missing url or path
Endpoint Delete GitProvider
URL /domain/[DOMAIN_ID]/gitprovider/[GITPROVIDER_ID]
Method DELETE
success status 204
Authentication check Yes

Errors list:

  • 404 when unknown GitProvider id