-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefinition.yml
158 lines (150 loc) · 4.1 KB
/
definition.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
openapi: "3.0.0"
info:
description: "This is the API definition for CircleCI self-hosted runners"
version: "0.0.1"
title: "CircleCI Self hosted runner API"
servers:
- url: "https://runner.circleci.com/api/v2"
description: "CircleCI API v2"
paths:
/runner:
get:
summary: "Get list of runners"
operationId: "getRunners"
parameters:
- in: query
name: resource-class
schema:
type: string
description: filters the list of self-hosted runners by specific resource class.
required: false
- in: query
name: namespace
schema:
type: string
description: filters the list of self-hosted runners by namespace
required: false
responses:
'200':
description: List of runners
content:
application/json:
schema:
$ref: '#/components/schemas/AgentList'
'400':
$ref: '#/components/responses/GenericError'
'401':
$ref: '#/components/responses/GenericError'
/tasks:
get:
summary: "Get number of unclaimed tasks"
operationId: "getUnclaimedTasks"
parameters:
- in: query
name: resource-class
schema:
type: string
description: filters tasks by specific resource class.
required: true
responses:
'200':
description: Number of unclaimed tasks
content:
application/json:
schema:
$ref: '#/components/schemas/UnclaimedTaskCount'
'400':
$ref: '#/components/responses/GenericError'
'401':
$ref: '#/components/responses/GenericError'
/tasks/running:
get:
summary: "Get number of running tasks"
operationId: "getRunningTasks"
parameters:
- in: query
name: resource-class
schema:
type: string
description: filters tasks by specific resource class.
required: true
responses:
'200':
description: Number of unclaimed tasks
content:
application/json:
schema:
$ref: '#/components/schemas/UnclaimedTaskCount'
'400':
$ref: '#/components/responses/GenericError'
'401':
$ref: '#/components/responses/GenericError'
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Circle-Token
responses:
GenericError:
description: GenericError
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Error:
type: object
properties:
message:
type: string
description: "Error message"
UnclaimedTaskCount:
type: object
properties:
unclaimed_task_count:
type: integer
RunningTaskCount:
type: object
properties:
running_runner_tasks:
type: integer
AgentList:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Agent'
Agent:
type: "object"
properties:
resource_class:
type: "string"
description: "Resource class for runner"
hostname:
type: "string"
description: "Hostname for runner"
name:
type: "string"
description: "Name of runner (instance id)"
first_connected:
type: "string"
format: "date-time"
description: "Timestamp of runner first connection"
last_connected:
type: "string"
format: "date-time"
description: "Timestamp of runner last connection"
last_used:
type: "string"
format: "date-time"
description: "Timestamp of runner last job run"
version:
type: "string"
description: "CircleCI Agent Version"
security:
- ApiKeyAuth: []
externalDocs:
description: "Find out more about CircleCI Runner API"
url: "https://circleci.com/docs/2.0/runner-api/index.html"