Route | Description |
---|---|
GET /vcs-roots | Get list of repositories |
GET /vcs-root/:vcsRootId/refs | Test connection, return remote refs |
POST /vcs-root/refs | Test connection with unsaved repository |
POST /vcs-root/:vcsRootId/refs | Test connection with edited unsaved parameters |
POST /orgs/:orgId/vcs-roots | Create repository |
HEAD /vcs-roots/:vcsRootId | Check if repository exists |
PUT /vcs-roots/:vcsRootId | Update repository |
DELETE /vcs-roots/:vcsRootId | Delete repository |
Overview
API routes related to setting up version control repository connections.
Get list of repositories
Retrieve a list of all repositories to which you have access. If you have access to multiple organizations, use the version that includes the organization id.
GET /test-cases
GET /orgs/:orgId/test-cases
Sample Response
[
{
"id":9,
"createdAt":"2016-12-12T03:06:50.158Z",
"updatedAt":"2016-12-14T21:33:11.281Z",
"name":"wdio-testable-example",
"vcsType":"Git",
"url":"https://github.com/testable/wdio-testable-example.git",
"branch":"HEAD",
"vcsAuthType":"None"
},
{
"id":8,
"createdAt":"2016-12-11T07:41:25.555Z",
"updatedAt":"2016-12-11T07:52:12.446Z",
"name":"t14",
"vcsType":"Git",
"url":"https://github.com/testable/sample-node.git",
"branch":"HEAD",
"vcsAuthType":"None"
}
]
Get repository details
Retrieve details about a specific repsitory connection. Note that private key file contents and the password are never shown in the response.
GET /vcs-roots/:vcsRootId
Sample Response
{
"id":9,
"createdAt":"2016-12-12T03:06:50.158Z",
"updatedAt":"2016-12-14T21:33:11.281Z",
"name":"wdio-testable-example",
"vcsType":"Git",
"url":"https://github.com/testable/wdio-testable-example.git",
"branch":"HEAD",
"vcsAuthType":"None"
}
Test connection, return remote refs
Tries to connect to the repository per the configured parameters. If successful returns all refs found. Otherwise returns an error.
Parameters provided in the body
GET /vcs-roots/:vcsRootId/refs
Sample Response
[ "refs/heads/master" ]
Test connection with unsaved repository
Tries to connect to the repository per the parameters provided in the body. Same parameters supported as POST /orgs/:orgId/vcs-roots
.
POST /vcs-roots/refs
Example Request
{
"name": "wdio-testable-example",
"vcsType": "Git",
"url": "https://github.com/testable/wdio-testable-example.git",
"branch": "HEAD",
"vcsAuthType": "None"
}
Sample Response
[ "refs/heads/master" ]
Test connection with edited unsaved parameters
Tries to connect to the saved repository overriding any parameters provided in the body. Same parameters supported as PUT /vcs-roots/:vcsRootId
. Useful for testing an edit to the parameters before save.
POST /vcs-roots/:vcsRootId/refs
Example Request
{
"branch": "some-new-branch"
}
Sample Response
[ "refs/heads/master", "refs/heads/some-new-branch" ]
Create repository
Creates a new repository link. Must specify your organization ID which can be found using the GET /orgs
route.
POST /orgs/:orgId/vcs-roots
Request Body
name
: Label to reference this repositoryvcsType
: Version control system type. Currently onlygit
is supported.url
: Url for the repository. Supports both http(s) and ssh style URLs.branch
: Default branch to clone when downloading from this repository for use in Testable. Defaults toHEAD
.vcsAuthType
: Can beNone
,Username
, orPrivateKey
.username
: ForUsername
auth, this field provides the username. Must use http(s) style url for username auth.password
: ForPassword
auth, this field provides the password. Must use http(s) style url for username auth.privateKey
: Base64 encoded private key file when using SSH authentication.privateKeyName
: Name of the private key file. Not used for anything on Testable other than to provide you a useful label to remember which key you used.
Example Request
{
"name": "wdio-testable-example",
"vcsType": "Git",
"url": "https://github.com/testable/wdio-testable-example.git",
"branch": "HEAD",
"vcsAuthType": "None"
}
Response
{
"id":9,
"createdAt":"2016-12-12T03:06:50.158Z",
"updatedAt":"2016-12-14T21:33:11.281Z",
"name":"wdio-testable-example",
"vcsType":"Git",
"url":"https://github.com/testable/wdio-testable-example.git",
"branch":"HEAD",
"vcsAuthType":"None"
}
Check if repository exists
HEAD /vcs-roots/:vcsRootId
Response
HTTP Status: 200 OK or 404 NOT FOUND
Update repository
Update the repository details. All parameters supported when creating the repository link are supported here.
PUT /vcs-roots/:vcsRootId
Request Body
{
"name": "new-wdio-testable-example"
}
Response
{
"id":9,
"createdAt":"2016-12-12T03:06:50.158Z",
"updatedAt":"2016-12-15T09:21:14.349Z",
"name":"new-wdio-testable-example",
"vcsType":"Git",
"url":"https://github.com/testable/wdio-testable-example.git",
"branch":"HEAD",
"vcsAuthType":"None"
}
Delete repository
DELETE /vcs-roots/:vcsRootId
Response
The deleted repository
{
"id":9,
"createdAt":"2016-12-12T03:06:50.158Z",
"updatedAt":"2016-12-15T09:21:14.349Z",
"name":"new-wdio-testable-example",
"vcsType":"Git",
"url":"https://github.com/testable/wdio-testable-example.git",
"branch":"HEAD",
"vcsAuthType":"None"
}