Edit this page on GitHub

Home > docs > api > Repository

Repository

Concord projects have one or multiple associated repositories. The repository API supports a number of operations on the project specific repositories:

Create a Repository

A new repository can be created with a POST request and the required parameters.

  • URI /api/v1/org/{orgName}/project/{projectName}/repository
  • Method POST
  • Headers Authorization, Content-Type: application/json
  • Body
      {
        "name": "...",
        "url": "...",
        "branch": "...",
        "commitId": "...",
        "path": "...",
        "secretId": "..."
      }
    
  • Success response
      Content-Type: application/json
    
      {
        "result": "CREATED",
        "ok": true
      }
    

Update a Repository

An existing repository can be updated with a POST request and the changed parameters.

  • URI /api/v1/org/{orgName}/project/{projectName}/repository
  • Method POST
  • Headers Authorization, Content-Type: application/json
  • Body
      {
        "id": "...",
        "name": "...",
        "url": "...",
        "branch": "...",
        "commitId": "...",
        "path": "...",
        "secretId": "..."
      }
    
  • Success response
      Content-Type: application/json
    
      {
        "result" : "UPDATED",
        "ok" : true
      }
    

Delete a Repository

A DELETE request can be used to removes a repository.

  • URI /api/v1/org/{orgName}/project/{projectName}/repository/{repositoryName}
  • Method DELETE
  • Headers Authorization
  • Body none
  • Success response
      Content-Type: application/json
    
      {
        "result": "DELETED",
        "ok": true
      }
    

Validate a Repository

A HTTP POST request can be used to validate a Concord repository. Specifically this action causes the Concord YML file to be parsed and validated with regards to syntax and any defined policies.

  • URI /api/v1/org/{orgName}/project/{projectName}/repository/{repositoryName}/validate
  • Method POST
  • Headers Authorization
  • Body none
  • Success response
      Content-Type: application/json
    
      {
        "result": "VALIDATED",
        "ok": true
      }
    

Refresh a Repository

An existing repository can be refreshed with a POST request. This causes the clone of the git repository stored within Concord to be updated. As a consequence the Concord YML file is parsed again and any changes to triggers and other configurations are updated.

  • URI /api/v1/org/{orgName}/project/{projectName}/repository/{repositoryName}/refresh
  • Method POST
  • Headers Authorization
  • Body none
  • Success response
      Content-Type: application/json
    
      {
        "result": "UPDATED",
        "ok": true
      }