uisvc (1.0.0)

Download OpenAPI specification:Download

API for the user interface service; the service that is directly responsible for presenting data to users. This service typically runs at the border, and leverages session cookies or authentication tokens that we generate for users. It also is responsible for handling the act of oauth and user creation through its login hooks. uisvc typically talks to the datasvc and other services to accomplish its goal, it does not save anything locally or carry state.

Authentication

token

Security scheme type: API Key
header parameter name: Authorization

session

Security scheme type: API Key
header parameter name: Cookie

Remove and reset your tinyCI access token

The next GET /token will create a new one. This will just remove it.

Authorizations:

Responses

200

OK

500

Internal Server Error

delete /token
/token

Get a tinyCI access token

This will allow you unfettered access to the system as your user that you request the token with.

Authorizations:

Responses

200

Returns the token which you can pass as a bearer token in headers for further requests as this user.

500

An error occurred.

get /token
/token

Log into the system

Handle the server side of the oauth challenge. It is important to preserve the cookie jar after this call is made, as session cookies are used to manage many of the calls in this API.

query Parameters
code
required
string

The code github sent back to us with the callback, we use it in the OAuth2 exchange to validate the request.

state
required
string

The state (randomized string) we sent with the original link; this is echoed back to us so we can further identify the user.

Responses

302

Redirection to another page indicates success of the login function. Follow the redirection to complete the login process. If the location is "/", that means login was successful.

500

An error occurred. Body has error result.

get /login
/login

Log into the system with upgraded permissions

This upgrades the permissions of the user (which requires confirmation from the OAuthing site) to allow repository access, so that additional permission to manipulate repositories and scan additional ones is available.

Responses

302

This will be the redirection to github.

500

An error occurred. Body has error result.

get /login/upgrade
/login/upgrade

Log out of the system

Conveniently clears session cookies. You will need to login again. Does not clear oauth tokens.

Authorizations:

Responses

302

Redirection to another page indicates success.

500

An error occurred. Body has error result.

get /logout
/logout

Remove a named capability

Remove a named capability from a provided user ID. Requires the user have the 'modify:user' capability.

Authorizations:
path Parameters
username
required
string

The user ID to remove the capability from.

capability
required
string

The name of the capability to remove.

Responses

200

The capability was successfully removed

500

An error occurred adding. Body has error result.

delete /capabilities/{username}/{capability}
/capabilities/{username}/{capability}

Add a named capability

Add a named capability for a provided user ID. Requires the user have the 'modify:user' capability.

Authorizations:
path Parameters
username
required
string

The user ID to add the capability to.

capability
required
string

The name of the capability to add.

Responses

200

The capability was successfully added

500

An error occurred adding. Body has error result.

post /capabilities/{username}/{capability}
/capabilities/{username}/{capability}

Get information about the current user

Get information about the current user, such as the username.

Authorizations:

Responses

200

An object containing user properties

500

An error occurred. Body has error result.

get /user/properties
/user/properties

Retrieve errors

Server retrieves any errors the last call(s) have set for you.

Authorizations:

Responses

200

Any errors returned

500

An error occurred. Body has error result.

get /errors
/errors

Check logged in state

Validate the logged-in status of the user. Validates the session cookie against the internal database. If the user is logged in, a JSON string of "true" will be sent; otherwise an oauth redirect url will be passed for calling out to by the client.

Responses

200

Either "true" or the URL to the oauth challenge.

500

An error occurred. Body has error result.

get /loggedin
/loggedin

Perform a manual submission to tinyCI

This allows a user to push a job instead of pushing to git or filing a pull request to trigger a job. It is available on the tinyCI UI and CLI client.

Authorizations:
query Parameters
repository
required
string

the repository owner/repo to be tested.

sha
required
string

the sha or branch to be tested

all
boolean

Run all tests instead of relying on diff selection to pick them.

Responses

200

OK

500

An error occurred. Body has error result.

get /submit
/submit

Attach to a running log

For a given ID, find the log and if it is running, attach to it and start receiving the latest content from it.

Authorizations:
path Parameters
id
required
integer

The ID of the run to retrieve the log for.

Responses

101

Established websocket

500

Internal Server Error

get /log/attach/{id}
/log/attach/{id}

Scan repositories from the remote resource

Reads the repositories list from the API resource, e.g., Github.

Authorizations:

Responses

200

OK

500

Internal Server Error

get /repositories/scan
/repositories/scan

List all subscribed repositories

Returns a types.RepositoryList of all the repos the user is subscribed to.

Authorizations:
query Parameters
search
string

search string by which to filter results

Responses

200

OK

500

Internal Server Error

get /repositories/subscribed
/repositories/subscribed

Fetch all the writable repositories for the user.

Returns a types.RepositoryList for all the repos a user has write access to.

Authorizations:
query Parameters
search
string

search string by which to filter results

Responses

200

OK

500

Internal Server Error

get /repositories/my
/repositories/my

Fetch all the repositories the user can view.

Returns a types.RepositoryList for all the repos a user has view access to.

Authorizations:
query Parameters
search
string

search string by which to filter results

Responses

200

OK

500

Internal Server Error

get /repositories/visible
/repositories/visible

Add a specific repository to CI.

Generates a hook secret and populates the user's repository with it and the hook URL. Returns 200 on success, 500 + error message on failure, or if the repository has already been added to CI.

Authorizations:
path Parameters
owner
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

repo
required
string

name of the repository, the second half of the github repository name such as 'foo' in 'erikh/foo'.

Responses

200

OK

500

Internal Server Error

get /repositories/ci/add/{owner}/{repo}
/repositories/ci/add/{owner}/{repo}

Removes a specific repository from CI.

Will fail if not added to CI already; does not currently clear the hook.

Authorizations:
path Parameters
owner
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

repo
required
string

name of the repository, the second half of the github repository name such as 'foo' in 'erikh/foo'.

Responses

200

OK

500

Internal Server Error

get /repositories/ci/del/{owner}/{repo}
/repositories/ci/del/{owner}/{repo}

Subscribe to a repository running CI

Subscribing makes that repo's queue items appear in your home view. Returns 200 on success, 500 + error on failure.

Authorizations:
path Parameters
owner
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

repo
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

Responses

200

OK

500

Internal Server Error

get /repositories/sub/add/{owner}/{repo}
/repositories/sub/add/{owner}/{repo}

Unsubscribe from a repository

Unsubscribing removes any existing subscription. Either way, if nothing broke, it returns 200. Otherwise it returns 500 and the error.

Authorizations:
path Parameters
owner
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

repo
required
string

owner of the repository, first part of github repository name such as 'erikh' in 'erikh/foo'

Responses

200

OK

500

Internal Server Error

get /repositories/sub/del/{owner}/{repo}
/repositories/sub/del/{owner}/{repo}

Obtain the task list optionally filtering by repository and sha.

The tasks list returns a list of Task objects that correspond to the query. Each query may contain pagination or filtering rules to limit its contents. It is strongly recommended to look at the "count" equivalents for these endpoints so that you can implement pagination more simply.

Authorizations:
query Parameters
page
integer
Default: 0

pagination control: what page to retrieve in the query.

perPage
integer
Default: 100

pagination control: how many items counts as a page.

repository
string

optional; the repository name to get the tasks for.

sha
string

optional; the sha to get the tasks for.

Responses

200

OK

500

Internal Server Error

get /tasks
/tasks

Obtain the list of tasks that belong to repositories you are subscribed to.

This call implements basic pagination over the entire task corpus that intersects with your subscription list. It returns a list of tasks.

Authorizations:
query Parameters
page
integer
Default: 0

pagination control: what page to retrieve in the query.

perPage
integer
Default: 100

pagination control: how many items counts as a page.

Responses

200

OK

500

Internal Server Error

get /tasks/subscribed
/tasks/subscribed

Count the Tasks

Perform a full count of tasks that meet the filter criteria (which can be no filter) and return it as integer.

Authorizations:
query Parameters
repository
string

optional; repository for filtering

sha
string

optional; sha for filtering

Responses

200

OK

500

Internal Server Error

get /tasks/count
/tasks/count

Obtain the run list based on the task ID.

The queue list only contains: * stuff * other junk

Authorizations:
path Parameters
id
required
integer

the ID of the Task

query Parameters
page
integer
Default: 0

pagination control: what page to retrieve in the query.

perPage
integer
Default: 100

pagination control: how many items counts as a page.

Responses

200

OK

500

Internal Server Error

get /tasks/runs/{id}
/tasks/runs/{id}

Count the runs corresponding to the task ID.

Get the count of runs that correspond to the task ID. Returns an integer.

Authorizations:
path Parameters
id
required
integer

the ID of the Task.

Responses

200

OK

500

Internal Server Error

get /tasks/runs/{id}/count
/tasks/runs/{id}/count

Cancel by Task ID

Cancel the runs for a task by ID

Authorizations:
path Parameters
id
required
integer

The ID of the task to retrieve

Responses

200

OK

500

Internal Server Error

post /tasks/cancel/{id}
/tasks/cancel/{id}

Obtain the run list for the user

List all the runs, optionally filtering by repository or repository+SHA. Pagination controls are available.

Authorizations:
query Parameters
page
integer
Default: 0

pagination control: what page to retrieve in the query.

perPage
integer
Default: 100

pagination control: how many items counts as a page.

repository
string

optional; the repository name to get the tasks for.

sha
string

optional; the sha to get the tasks for.

Responses

200

OK

500

Internal Server Error

get /runs
/runs

Count the runs

Count the runs, optionally filtering by repository or repository+SHA.