-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathopenapi.yaml
More file actions
828 lines (824 loc) · 23 KB
/
openapi.yaml
File metadata and controls
828 lines (824 loc) · 23 KB
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
components:
schemas:
BasicAuthentication:
additionalProperties: false
description: User credentials for basic authentication
properties:
password:
description: Password to verify user's identity
title: Password
type: string
username:
description: Unique identifier for user
title: Username
type: string
required:
- username
- password
title: BasicAuthentication
type: object
DeviceModel:
additionalProperties: false
description: Representation of a device
properties:
name:
description: Name of the device
title: Name
type: string
protocols:
description: Protocols that a device conforms to, indicating its capabilities
items:
$ref: '#/components/schemas/ProtocolInfo'
title: Protocols
type: array
required:
- name
- protocols
title: DeviceModel
type: object
DeviceResponse:
additionalProperties: false
description: Response to a query for devices
properties:
devices:
description: Devices available to use in plans
items:
$ref: '#/components/schemas/DeviceModel'
title: Devices
type: array
required:
- devices
title: DeviceResponse
type: object
EnvironmentResponse:
additionalProperties: false
description: State of internal environment.
properties:
environment_id:
description: Unique ID for the environment instance, can be used to differentiate
between a new environment and old that has been torn down
format: uuid
title: Environment Id
type: string
error_message:
description: If present - error loading context
minLength: 1
title: Error Message
type: string
initialized:
description: blueapi context initialized
title: Initialized
type: boolean
required:
- environment_id
- initialized
title: EnvironmentResponse
type: object
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
title: Detail
type: array
title: HTTPValidationError
type: object
Health:
enum:
- ok
title: Health
type: string
HealthProbeResponse:
additionalProperties: false
properties:
status:
$ref: '#/components/schemas/Health'
required:
- status
title: HealthProbeResponse
type: object
OIDCConfig:
additionalProperties: false
properties:
client_audience:
default: blueapi
description: Client Audience(s)
title: Client Audience
type: string
client_id:
description: Client ID
title: Client Id
type: string
logout_redirect_endpoint:
default: ''
description: The oidc endpoint required to logout
title: Logout Redirect Endpoint
type: string
well_known_url:
description: URL to fetch OIDC config from the provider
title: Well Known Url
type: string
required:
- well_known_url
- client_id
title: OIDCConfig
type: object
PackageInfo:
additionalProperties: false
properties:
is_dirty:
description: Does the package have uncommitted changes
title: Is Dirty
type: boolean
location:
description: Location of the package
title: Location
type: string
name:
description: Name of the package
title: Name
type: string
source:
$ref: '#/components/schemas/SourceInfo'
default: pypi
description: Source of the package
version:
description: Version of the package
title: Version
type: string
title: PackageInfo
type: object
PlanModel:
additionalProperties: false
description: Representation of a plan
properties:
description:
description: Docstring of the plan
title: Description
type: string
name:
description: Name of the plan
title: Name
type: string
schema:
additionalProperties: true
description: Schema of the plan's parameters
title: Schema
type: object
required:
- name
title: PlanModel
type: object
PlanResponse:
additionalProperties: false
description: Response to a query for plans
properties:
plans:
description: Plans available to use by a worker
items:
$ref: '#/components/schemas/PlanModel'
title: Plans
type: array
required:
- plans
title: PlanResponse
type: object
ProtocolInfo:
additionalProperties: false
properties:
name:
title: Name
type: string
types:
default: []
items:
type: string
title: Types
type: array
required:
- name
title: ProtocolInfo
type: object
PythonEnvironmentResponse:
additionalProperties: false
description: State of the Python environment.
properties:
installed_packages:
description: List of installed packages
items:
$ref: '#/components/schemas/PackageInfo'
title: Installed Packages
type: array
scratch_enabled:
default: false
description: Scratch status
title: Scratch Enabled
type: boolean
title: PythonEnvironmentResponse
type: object
SourceInfo:
enum:
- pypi
- scratch
title: SourceInfo
type: string
StateChangeRequest:
additionalProperties: false
description: Request to change the state of the worker.
properties:
defer:
default: false
description: Should worker defer Pausing until the next checkpoint
title: Defer
type: boolean
new_state:
$ref: '#/components/schemas/WorkerState'
reason:
description: The reason for the current run to be aborted
title: Reason
type: string
required:
- new_state
title: StateChangeRequest
type: object
StompConfig:
additionalProperties: false
description: Config for connecting to stomp broker
properties:
auth:
anyOf:
- $ref: '#/components/schemas/BasicAuthentication'
- type: 'null'
description: Auth information for communicating with STOMP broker, if required
enabled:
default: false
description: True if blueapi should connect to stomp for asynchronous event
publishing
title: Enabled
type: boolean
url:
default: tcp://localhost:61613
format: uri
minLength: 1
title: Url
type: string
title: StompConfig
type: object
Task:
additionalProperties: false
description: Task that will run a plan
properties:
metadata:
additionalProperties: true
description: Any metadata to apply to all runs within this task
title: Metadata
type: object
name:
description: Name of plan to run
title: Name
type: string
params:
additionalProperties: true
description: Values for parameters to plan, if any
title: Params
type: object
required:
- name
title: Task
type: object
TaskRequest:
additionalProperties: false
description: Request to run a task with related info
properties:
instrument_session:
description: Instrument session associated with this task
title: Instrument Session
type: string
name:
description: Name of plan to run
title: Name
type: string
params:
additionalProperties: true
description: Values for parameters to plan, if any
title: Params
type: object
required:
- name
- instrument_session
title: TaskRequest
type: object
TaskResponse:
additionalProperties: false
description: Acknowledgement that a task has started, includes its ID
properties:
task_id:
description: Unique identifier for the task
title: Task Id
type: string
required:
- task_id
title: TaskResponse
type: object
TasksListResponse:
additionalProperties: false
description: Diagnostic information on the tasks
properties:
tasks:
description: List of tasks
items:
$ref: '#/components/schemas/TrackableTask'
title: Tasks
type: array
required:
- tasks
title: TasksListResponse
type: object
TrackableTask:
additionalProperties: false
description: A representation of a task that the worker recognizes
properties:
errors:
items:
type: string
title: Errors
type: array
is_complete:
default: false
title: Is Complete
type: boolean
is_pending:
default: true
title: Is Pending
type: boolean
request_id:
title: Request Id
type: string
task:
$ref: '#/components/schemas/Task'
task_id:
title: Task Id
type: string
required:
- task_id
- task
title: TrackableTask
type: object
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
title: Location
type: array
msg:
title: Message
type: string
type:
title: Error Type
type: string
required:
- loc
- msg
- type
title: ValidationError
type: object
WorkerState:
description: The state of the Worker.
enum:
- IDLE
- RUNNING
- PAUSING
- PAUSED
- HALTING
- STOPPING
- ABORTING
- SUSPENDING
- PANICKED
- UNKNOWN
title: WorkerState
type: string
WorkerTask:
additionalProperties: false
description: Worker's active task ID, can be None
properties:
task_id:
description: The ID of the current task, None if the worker is idle
title: Task Id
type: string
required:
- task_id
title: WorkerTask
type: object
info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
title: BlueAPI Control
version: 1.2.0
openapi: 3.1.0
paths:
/config/oidc:
get:
description: Retrieve the OpenID Connect (OIDC) configuration for the server.
operationId: get_oidc_config_config_oidc_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/OIDCConfig'
description: Successful Response
'204':
description: No Authentication configured
summary: Get Oidc Config
tags:
- Meta
/config/stomp:
get:
description: Retrieve the stomp configuration for the server.
operationId: get_stomp_config_config_stomp_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/StompConfig'
description: Successful Response
'204':
description: No Stomp configured
summary: Get Stomp Config
tags:
- Meta
/devices:
get:
description: Retrieve information about all available devices.
operationId: get_devices_devices_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DeviceResponse'
description: Successful Response
summary: Get Devices
tags:
- Device
/devices/{name}:
get:
description: Retrieve information about a devices by its (unique) name.
operationId: get_device_by_name_devices__name__get
parameters:
- in: path
name: name
required: true
schema:
title: Name
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DeviceModel'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Device By Name
tags:
- Device
/environment:
delete:
description: Delete the current environment, causing internal components to
be reloaded.
operationId: delete_environment_environment_delete
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentResponse'
description: Successful Response
summary: Delete Environment
tags:
- Environment
get:
description: Get the current state of the environment, i.e. initialization state.
operationId: get_environment_environment_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentResponse'
description: Successful Response
summary: Get Environment
tags:
- Environment
/healthz:
get:
description: If able to serve this, server is live and ready for requests.
operationId: health_probe_healthz_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/HealthProbeResponse'
description: Successful Response
summary: Health Probe
tags:
- Meta
/plans:
get:
description: Retrieve information about all available plans.
operationId: get_plans_plans_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PlanResponse'
description: Successful Response
summary: Get Plans
tags:
- Plan
/plans/{name}:
get:
description: Retrieve information about a plan by its (unique) name.
operationId: get_plan_by_name_plans__name__get
parameters:
- in: path
name: name
required: true
schema:
title: Name
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PlanModel'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Plan By Name
tags:
- Plan
/python_environment:
get:
description: 'Retrieve the Python environment details.
This endpoint fetches information about the Python environment,
such as the installed packages and scratch packages.'
operationId: get_python_environment_python_environment_get
parameters:
- in: query
name: name
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Name
- in: query
name: source
required: false
schema:
anyOf:
- $ref: '#/components/schemas/SourceInfo'
- type: 'null'
title: Source
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PythonEnvironmentResponse'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Python Environment
tags:
- Environment
/tasks:
get:
description: 'Retrieve tasks based on their status.
The status of a newly created task is ''unstarted''.'
operationId: get_tasks_tasks_get
parameters:
- in: query
name: task_status
required: false
schema:
title: Task Status
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TasksListResponse'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Tasks
tags:
- Task
post:
description: Submit a task to the worker.
operationId: submit_task_tasks_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRequest'
examples:
- instrument_session: cm12345-1
name: count
params:
detectors:
- x
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/TaskResponse'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Submit Task
tags:
- Task
/tasks/{task_id}:
delete:
operationId: delete_submitted_task_tasks__task_id__delete
parameters:
- in: path
name: task_id
required: true
schema:
title: Task Id
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TaskResponse'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Delete Submitted Task
tags:
- Task
get:
description: Retrieve a task
operationId: get_task_tasks__task_id__get
parameters:
- in: path
name: task_id
required: true
schema:
title: Task Id
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TrackableTask'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Task
tags:
- Task
/worker/state:
get:
description: Get the State of the Worker
operationId: get_state_worker_state_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerState'
description: Successful Response
summary: Get State
tags:
- Task
put:
description: "Request that the worker is put into a particular state.\nReturns\
\ the state of the worker at the end of the call.\n\n- **The following transitions\
\ are allowed and return 202: Accepted**\n- If the worker is **PAUSED**, new_state\
\ may be **RUNNING** to resume.\n- If the worker is **RUNNING**, new_state\
\ may be **PAUSED** to pause:\n - If defer is False (default): pauses and\
\ rewinds to the previous checkpoint\n - If defer is True: waits until\
\ the next checkpoint to pause\n - **If the task has no checkpoints, the\
\ task will instead be Aborted**\n- If the worker is **RUNNING/PAUSED**, new_state\
\ may be **STOPPING** to stop.\n Stop marks any currently open Runs in\
\ the Task as a success and ends the task.\n- If the worker is **RUNNING/PAUSED**,\
\ new_state may be **ABORTING** to abort.\n Abort marks any currently open\
\ Runs in the Task as a Failure and ends the task.\n - If reason is set,\
\ the reason will be passed as the reason for the Run failure.\n- **All other\
\ transitions return 400: Bad Request**"
operationId: set_state_worker_state_put
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StateChangeRequest'
required: true
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerState'
description: Successful Response
'400':
description: Bad Request
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Set State
tags:
- Task
/worker/task:
get:
operationId: get_active_task_worker_task_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerTask'
description: Successful Response
summary: Get Active Task
tags:
- Task
put:
description: 'Set a task to active status, the worker should begin it as soon
as possible.
This will return an error response if the worker is not idle.'
operationId: set_active_task_worker_task_put
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerTask'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerTask'
description: Successful Response
'409':
description: Conflict
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Set Active Task
tags:
- Task