woodpecker/doc/swagger.yml
2015-06-23 11:35:21 -07:00

305 lines
6.4 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
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
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
description: Deletes the repository.
security:
- accessToken: []
/repos/{owner}/{name}/watch:
post:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
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
description: Unwatches the repository.
security:
- accessToken: []
/repos/{owner}/{name}/builds:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
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
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: []
consumes:
- application/json
produces:
- application/json
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
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