harness-drone/doc/swagger.yml
Brad Rydzewski 796ec75b38 swagger docs
2015-06-23 19:08:18 -07:00

325 lines
6.8 KiB
YAML

swagger: "2.0"
info:
version: 1.0.0
title: Drone API
contact:
name: Team Drone
url: "https://github.com/drone/drone"
license:
name: Creative Commons 4.0 International
url: "http://creativecommons.org/licenses/by/4.0/"
host: "localhost:8080"
basePath: /api
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
security:
- accessToken: []
securityDefinitions:
accessToken:
type: apiKey
in: query
name: access_token
paths:
/repos/{owner}/{name}:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
tags:
- repository
description: Returns the repository based on name.
security:
- accessToken: []
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: The repository.
schema:
$ref: "#/definitions/Repo"
patch:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
- name: repo
in: body
description: The updated repository JSON
schema:
$ref: '#/definitions/Repo'
required: true
tags:
- repository
description: Updates the repository.
security:
- accessToken: []
responses:
"200":
description: The updated repository.
schema:
$ref: "#/definitions/Repo"
delete:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
tags:
- repository
description: Deletes the repository.
security:
- accessToken: []
/repos/{owner}/{name}/watch:
post:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
tags:
- repository
description: Watches the named repository.
security:
- accessToken: []
/repos/{owner}/{name}/unwatch:
delete:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
tags:
- repository
description: Unwatches the repository.
security:
- accessToken: []
/repos/{owner}/{name}/builds:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
tags:
- build
description: Returns recent builds for the repository based on name.
security:
- accessToken: []
responses:
"200":
description: The recent builds.
schema:
type: array
items:
$ref: "#/definitions/Build"
/repos/{owner}/{name}/builds/{number}:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
- name: number
in: path
type: integer
tags:
- build
description: Returns the repository build by number.
security:
- accessToken: []
responses:
"200":
description: The build.
schema:
$ref: "#/definitions/Build"
/user:
get:
description: Returns the currently authenticated user.
security:
- accessToken: []
tags:
- user
responses:
"200":
description: The currently authenticated user.
schema:
$ref: "#/definitions/User"
examples:
application/json: |-
{
"name": "Octocat",
"email": "octocat@github.com",
"gravatar_id": "7194e8d48fa1d2b689f99443b767316c",
"admin": false,
"active": true
}
patch:
description: Updates the currently authenticated user.
produces:
- application/json
tags:
- user
parameters:
- name: user
in: body
description: Updates to the user.
required: true
schema:
$ref: "#/definitions/User"
responses:
"200":
description: The updated user.
schema:
$ref: "#/definitions/User"
definitions:
User:
properties:
login:
type: string
email:
type: string
gravatar_id:
type: string
admin:
type: boolean
active:
type: boolean
Repo:
properties:
owner:
type: string
name:
type: string
full_name:
type: string
link_url:
type: string
clone_url:
type: string
default_branch:
type: string
private:
type: boolean
trusted:
type: boolean
timeout:
type: integer
keypair:
type: object
properties:
public:
type: string
private:
type: string
hooks:
type: object
properties:
pull_request:
type: boolean
push:
type: boolean
tags:
type: boolean
permissions:
type: object
properties:
pull:
type: boolean
push:
type: boolean
admin:
type: boolean
params:
type: object
Build:
properties:
number:
type: integer
status:
type: string
enum:
- success
- failure
- pending
- started
- error
- killed
head_commit:
$ref: "#/definitions/Commit"
pull_request:
$ref: "#/definitions/PullRequest"
Commit:
properties:
sha:
type: string
ref:
type: string
branch:
type: string
message:
type: string
author:
$ref: "#/definitions/Author"
PullRequest:
properties:
number:
type: integer
title:
type: string
base_commit:
$ref: "#/definitions/Commit"
Author:
properties:
login:
type: string
email:
type: string
Job:
properties:
number:
type: integer
status:
type: string
enum:
- success
- failure
- pending
- started
- error
- killed
exit_code:
type: integer
started_at:
type: integer
format: int64
finished_at:
type: integer
format: int64
environment:
type: object