woodpecker/doc/swagger.yml

326 lines
6.8 KiB
YAML
Raw Normal View History

2015-05-18 02:25:53 +00:00
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
2015-06-23 07:12:21 +00:00
- https
consumes:
- application/json
produces:
- application/json
security:
- accessToken: []
securityDefinitions:
accessToken:
type: apiKey
in: query
name: access_token
2015-05-18 02:25:53 +00:00
paths:
2015-06-23 07:12:21 +00:00
/repos/{owner}/{name}:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
2015-06-24 02:08:18 +00:00
tags:
- repository
2015-06-23 07:12:21 +00:00
description: Returns the repository based on name.
security:
- accessToken: []
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: The repository.
schema:
$ref: "#/definitions/Repo"
2015-06-23 18:35:21 +00:00
patch:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
2015-06-24 02:08:18 +00:00
- name: repo
in: body
description: The updated repository JSON
schema:
$ref: '#/definitions/Repo'
required: true
tags:
- repository
2015-06-23 18:35:21 +00:00
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
2015-06-24 02:08:18 +00:00
tags:
- repository
2015-06-23 18:35:21 +00:00
description: Deletes the repository.
security:
- accessToken: []
/repos/{owner}/{name}/watch:
post:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
2015-06-24 02:08:18 +00:00
tags:
- repository
2015-06-23 18:35:21 +00:00
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
2015-06-24 02:08:18 +00:00
tags:
- repository
2015-06-23 18:35:21 +00:00
description: Unwatches the repository.
security:
- accessToken: []
/repos/{owner}/{name}/builds:
get:
parameters:
- name: owner
in: path
type: string
- name: name
in: path
type: string
2015-06-24 02:08:18 +00:00
tags:
- build
2015-06-23 18:35:21 +00:00
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
2015-06-24 02:08:18 +00:00
tags:
- build
2015-06-23 18:35:21 +00:00
description: Returns the repository build by number.
security:
- accessToken: []
responses:
"200":
description: The build.
schema:
$ref: "#/definitions/Build"
2015-05-18 02:25:53 +00:00
/user:
get:
description: Returns the currently authenticated user.
2015-06-23 07:12:21 +00:00
security:
- accessToken: []
2015-06-24 02:08:18 +00:00
tags:
- user
2015-05-18 02:25:53 +00:00
responses:
"200":
description: The currently authenticated user.
schema:
$ref: "#/definitions/User"
2015-06-23 07:12:21 +00:00
examples:
application/json: |-
{
"name": "Octocat",
"email": "octocat@github.com",
"gravatar_id": "7194e8d48fa1d2b689f99443b767316c",
"admin": false,
"active": true
}
2015-05-18 02:25:53 +00:00
patch:
description: Updates the currently authenticated user.
produces:
- application/json
2015-06-24 02:08:18 +00:00
tags:
- user
2015-05-18 02:25:53 +00:00
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
2015-06-23 07:12:21 +00:00
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:
2015-05-18 02:25:53 +00:00
properties:
2015-06-23 07:12:21 +00:00
number:
2015-05-18 02:25:53 +00:00
type: integer
2015-06-23 07:12:21 +00:00
status:
2015-05-18 02:25:53 +00:00
type: string
2015-06-23 07:12:21 +00:00
enum:
- success
- failure
- pending
- started
- error
- killed
head_commit:
$ref: "#/definitions/Commit"
pull_request:
$ref: "#/definitions/PullRequest"
Commit:
properties:
2015-05-18 02:25:53 +00:00
sha:
type: string
ref:
type: string
branch:
type: string
2015-06-23 07:12:21 +00:00
message:
type: string
2015-05-18 02:25:53 +00:00
author:
2015-06-23 07:12:21 +00:00
$ref: "#/definitions/Author"
PullRequest:
properties:
number:
type: integer
title:
2015-05-18 02:25:53 +00:00
type: string
2015-06-23 07:12:21 +00:00
base_commit:
$ref: "#/definitions/Commit"
Author:
properties:
login:
2015-05-18 02:25:53 +00:00
type: string
2015-06-23 07:12:21 +00:00
email:
2015-05-18 02:25:53 +00:00
type: string
2015-06-23 07:12:21 +00:00
Job:
2015-05-18 02:25:53 +00:00
properties:
2015-06-23 07:12:21 +00:00
number:
2015-05-18 02:25:53 +00:00
type: integer
2015-06-23 07:12:21 +00:00
status:
2015-05-18 02:25:53 +00:00
type: string
2015-06-23 07:12:21 +00:00
enum:
- success
- failure
- pending
- started
- error
- killed
2015-05-18 02:25:53 +00:00
exit_code:
type: integer
started_at:
type: integer
format: int64
finished_at:
type: integer
format: int64
2015-06-23 07:12:21 +00:00
environment:
2015-06-23 18:35:21 +00:00
type: object