mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-18 07:54:28 +00:00
213 lines
No EOL
4.3 KiB
YAML
213 lines
No EOL
4.3 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"
|
|
/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 |