-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswagger.yaml
2731 lines (2707 loc) · 94.9 KB
/
swagger.yaml
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
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: "2.0"
info:
description: |
Dataset catalogue used to find information about data published by the ONS.
`Datasets` are published in unique `versions`, which are categorized by `edition`. Data in each version is broken down by `dimensions`, and a unique combination of dimension `options` in a version can be used to retrieve `observation` level data.
Note: As of the latest update, the `@context` field has been removed from all dataset endpoints to improve response performance and correct data structure."
version: "1.0.0"
title: "Explore our data"
license:
name: "Open Government Licence v3.0"
url: "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
basePath: "/v1"
tags:
- name: "Public"
description: Endpoints available on public API.
- name: "Private"
description: Internal only endpoints.
host: api.beta.ons.gov.uk
schemes:
- "https"
parameters:
dataset:
name: dataset
description: "A unique id for a dataset to filter on"
in: query
type: string
dimension:
name: dimension
description: "A dimension from a dataset"
in: path
required: true
type: string
patch_options:
required: true
name: patch
schema:
$ref: "#/definitions/PatchOptions"
description: "A list of patch operations for a dimension option"
in: body
patch_dimensions:
required: true
name: patch
schema:
$ref: "#/definitions/PatchDimensions"
description: "A list of patch operations for a dimension"
in: body
edition:
name: edition
description: "An edition of a dataset"
in: path
required: true
type: string
event:
name: event
description: "An event that occurs when importing a dataset"
in: body
schema:
$ref: "#/definitions/Event"
dataset_id:
name: id
description: "ID that represents a dataset"
in: path
required: true
type: string
import_tasks:
name: import_tasks
description: "A request body to update the state of an import task"
in: body
schema:
$ref: "#/definitions/ImportTasks"
inserted_observations:
name: inserted_observations
description: "A value to increment the inserted_observations within an instance"
in: path
required: true
type: integer
instance_id:
name: instance_id
description: "A unique id for an instance"
in: path
required: true
type: string
instance:
name: instance
description: "An instance related to an import job and dataset"
in: body
required: true
schema:
$ref: "#/definitions/Instance"
new_dataset:
name: dataset
description: "A new dataset"
in: body
required: true
schema:
$ref: "#/definitions/Dataset"
new_version:
name: new_version
description: "A new version for an edition of a dataset"
in: body
required: true
schema:
$ref: "#/definitions/Version"
node_id:
name: node_id
description: "An unique node id"
in: path
required: true
type: string
newInstance:
name: instance
description: "An instance related to an import job"
in: body
required: true
schema:
$ref: "#/definitions/NewInstance"
option:
name: option
description: "A option to set within a type"
in: path
required: true
type: string
state:
name: "state"
description: "A comma separated list of state values to filter on (e.g. ‘completed,edition-confirmed’)"
in: query
type: string
update_dataset:
name: dataset
description: "An update to a dataset"
in: body
required: true
schema:
$ref: "#/definitions/Dataset"
update_dimension:
name: dimension
description: "A dimension object to update for a given instance"
in: body
required: true
schema:
$ref: "#/definitions/UpdateInstanceDimension"
update_dimension_option_request:
name: dimension_option
description: "A dimension option from an instance"
in: body
schema:
$ref: "#/definitions/UpdateDimensionOptionRequest"
version:
name: version
description: "A version of a dataset"
in: path
required: true
type: string
version_update:
name: version_update
description: |
Update to a version for an edition of a dataset.
This model allows for the updating the deprecated `downloads` map for backwards compatability.
in: body
required: true
schema:
allOf:
- $ref: "#/definitions/Version"
- properties:
downloads:
allOf:
- readOnly: false
limit:
name: limit
description: "Maximum number of items that will be returned. A value of zero will return zero items."
in: query
required: false
type: integer
default: 20
minimum: 0
maximum: 1000
offset:
name: offset
description: "Starting index of the items array that will be returned. By default it is zero, meaning that the returned items will start from the beginning."
in: query
required: false
type: integer
default: 0
minimum: 0
ids:
name: id
description: "List of ids, as comma separated values and/or as multiple query parameters with the same key (e.g. 'id=op1,op2&id=op3'). It defines the IDs that we want to retrieve. If provided, it takes precedence over offset and limit."
in: query
required: false
type: string
if_match:
name: If-Match
required: false
description: "Filter resource version, as returned by a previous ETag, to be validated; or '*' to skip the version check"
in: header
type: string
is_based_on:
name: is_based_on
required: false
description: "A population type to search on to return datasets that are associated with that population type e.g. Usual-Residents. This is applicable to Census 2021 datasets only."
in: query
type: string
type:
name: type
required: false
description: "A filter to search the datasets by dataset type e.g. type=static"
in: query
type: string
metadata_update:
name: metadata_update
in: body
required: true
schema:
$ref: "#/definitions/Metadata"
securityDefinitions:
Authorization:
name: Authorization
description: "Access token provided by Auth Service in a Bearer format. Can be a human or service user token."
in: header
type: apiKey
DownloadServiceAPIKey:
name: X-Download-Service-Token
description: "API key used to allow the download service to access public and private links to a download"
in: header
type: apiKey
paths:
/datasets:
get:
tags:
- "Public"
summary: "List datasets"
description: "Returns a list of all datasets available via the ONS APIs."
parameters:
- $ref: "#/parameters/is_based_on"
- $ref: "#/parameters/type"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
security:
- {}
- Authorization: []
produces:
- "application/json"
responses:
200:
description: "A json list containing datasets which have been published"
schema:
$ref: "#/definitions/Datasets"
headers:
ETag:
description: The RFC7232 ETag header field the of the resource, where the resource is the response to the specific query paramaters. This is used for setting the `If-None-Match` headers on subsequent requests to check for changes.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: "Parameter is_based_on or type was sent but no value was provided"
404:
description: "No dataset was found with the population-type provided"
500:
$ref: "#/responses/InternalError"
post:
tags:
- "Private"
summary: "Create a new dataset"
description: "Allows an authenticated and authorised user to create a new dataset. The dataset ID should be included in the request body."
parameters:
- $ref: "#/parameters/new_dataset"
security:
- Authorization: []
produces:
- "application/json"
responses:
201:
description: "A JSON object containing the newly created dataset"
schema:
$ref: "#/definitions/Dataset"
400:
description: "Invalid request body"
401:
description: "Unauthorised to create/overwrite dataset"
403:
description: "Forbidden to overwrite dataset, dataset already exists"
500:
$ref: "#/responses/InternalError"
/datasets/{id}:
post:
tags:
- "Private"
summary: "Create a dataset (deprecated)"
description: |
**Deprecated:** This endpoint is being replaced by `POST /datasets`. Please use `POST /datasets` and provide the dataset ID in the request body. This endpoint may be removed in a future release.
deprecated: true
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/new_dataset"
security:
- Authorization: []
produces:
- "application/json"
responses:
201:
description: "A json object containing a dataset which has been created"
schema:
$ref: "#/definitions/NewDatasetResponse"
400:
description: "Invalid request body"
401:
description: "Unauthorised to create/overwrite dataset"
403:
description: "Forbidden to overwrite dataset, already published"
500:
$ref: "#/responses/InternalError"
get:
tags:
- "Public"
summary: "Get a dataset"
description: "The dataset contains all high level information, for additional details see editions or versions of a dataset. "
parameters:
- $ref: "#/parameters/dataset_id"
security:
- {}
- Authorization: []
responses:
200:
description: "A json object for a single Dataset"
schema:
$ref: "#/definitions/Dataset"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
404:
description: "No dataset was found using the id provided"
500:
$ref: "#/responses/InternalError"
put:
tags:
- "Private"
summary: "Update a dataset"
description: "Update the metadata for the next release of the dataset. The dataset contains all high level information, for additional details see editions or versions of a dataset."
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/update_dataset"
security:
- Authorization: []
responses:
200:
description: "A json object for a single Dataset"
400:
description: "Bad Request due to invalid json in the request body"
401:
description: "Unauthorised to update dataset"
404:
description: "No dataset was found using the id provided"
500:
$ref: "#/responses/InternalError"
delete:
tags:
- "Private"
summary: "Delete a dataset"
description: "Delete an existing dataset"
parameters:
- $ref: "#/parameters/dataset_id"
security:
- Authorization: []
responses:
204:
description: "The dataset was successfully deleted"
401:
description: "Unauthorised to delete the dataset"
403:
description: "Forbidden to delete dataset, already published"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions:
get:
tags:
- "Public"
summary: "Get a list of editions of a dataset"
description: "Get a list of editions of a dataset. Each edition returns the latest version of that edition."
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
security:
- {}
- Authorization: []
responses:
200:
description: "A json list containing all editions for a dataset"
schema:
$ref: "#/definitions/Editions"
headers:
ETag:
description: The RFC7232 ETag header field the of the resource, where the resource is the response to the specific query paramaters. This is used for setting the `If-None-Match` headers on subsequent requests to check for changes.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: "Invalid request, dataset id was incorrect"
404:
description: "No editions were found for the id provided"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}:
get:
tags:
- "Public"
summary: "Get an edition of a dataset"
description: "Get the latest version of a dataset edition."
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
security:
- {}
- Authorization: []
responses:
200:
description: "A json object containing the latest version of the edition"
schema:
$ref: "#/definitions/Version"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: "Invalid request, dataset id was incorrect"
404:
description: "No edition of a dataset was found using the id and edition provided"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}/versions:
get:
tags:
- "Public"
summary: "List the edition's version history"
description: "Get a list of all versions for a dataset edition."
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
security:
- {}
- Authorization: []
- Authorization: []
DownloadServiceAPIKey: []
responses:
200:
description: "A json list containing all versions for a set type of dataset and edition"
schema:
$ref: "#/definitions/Versions"
headers:
ETag:
description: The RFC7232 ETag header field the of the resource, where the resource is the response to the specific query paramaters. This is used for setting the `If-None-Match` headers on subsequent requests to check for changes.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
404:
description: "No versions found using the id and edition provided"
500:
$ref: "#/responses/InternalError"
post:
tags:
- "Private"
summary: "Create a version"
description: "Create a version for a dataset series. This will set the state of the version and dataset series to be associated."
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/edition"
- $ref: "#/parameters/new_version"
security:
- {}
- Authorization: []
responses:
201:
description: "A json object containing a version"
schema:
$ref: "#/definitions/Version"
400:
description: |
Invalid request, reasons can be one of the following:
* invalid request body
* dataset id was incorrect
* edition was incorrect
* an unpublished version of the dataset already exists
401:
description: "Unauthorised to update version of dataset"
404:
description: "Dataset series was not found for a dataset using the id and edition provided"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}/versions/{version}:
put:
tags:
- "Private"
summary: "Update a version"
description: "Update a version for an edition of a dataset, if the state is changed to associated or published, the parent documents(dataset and edition resources) will also be updated. A version can only be updated if the state is not published"
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/edition"
- $ref: "#/parameters/version"
- $ref: "#/parameters/version_update"
security:
- Authorization: []
- Authorization: []
DownloadServiceAPIKey: []
responses:
201:
description: "A json object containing a version"
schema:
$ref: "#/definitions/Version"
400:
description: |
Invalid request, reasons can be one of the following:
* invalid request body
* dataset id was incorrect
* edition was incorrect
401:
description: "Unauthorised to update version of dataset"
403:
description: "Forbidden to overwrite version of dataset, already published"
404:
description: "Version was not found for a dataset using the id and edition provided"
500:
$ref: "#/responses/InternalError"
get:
tags:
- "Public"
summary: "Get a specific version"
description: "Get a specific version of an edition of a dataset"
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/version"
security:
- {}
- Authorization: []
responses:
200:
description: "A json object containing the edition and version of a dataset"
schema:
$ref: "#/definitions/Version"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
404:
description: "No version was found for an edition of a dataset using the id, edition and version provided"
500:
$ref: "#/responses/InternalError"
delete:
tags:
- "Private"
summary: "Delete a version"
description: "detaches a version from a collection. Effectively a soft delete."
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/version"
security:
- Authorization: []
responses:
200:
description: "A json object containing the edition and version of a dataset"
schema:
$ref: "#/definitions/Version"
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
* version state was incorrect
* not the most recent unpublished version
404:
description: "No version was found for an edition of a dataset using the id, edition and version provided"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}/versions/{version}/dimensions:
get:
tags:
- "Public"
summary: "Get a list of dimensions from a dataset (filterable and cantabular datasets only)"
description: "Get all dimensions which are used in the dataset"
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/version"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
security:
- {}
- Authorization: []
responses:
200:
description: "A json list of dimensions"
schema:
$ref: "#/definitions/Dimensions"
headers:
ETag:
description: The RFC7232 ETag header field the of the resource, where the resource is the response to the specific query paramaters. This is used for setting the `If-None-Match` headers on subsequent requests to check for changes.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
* version was incorrect
404:
description: "No dimensions found for version of an edition of a dataset using the id, edition and version provided"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}/versions/{version}/dimensions/{dimension}/options:
get:
tags:
- "Public"
summary: "Get a list of options from a dimension (filterable and cantabular datasets only)"
description: "Get a list of options which appear in this dimension and dataset. By default all options are returned, but a subset can be requested by providing offset and limit query parameters, or by providing the list of option IDs, only the IDs that are found will be returned."
parameters:
- $ref: "#/parameters/dimension"
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/version"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
- $ref: "#/parameters/ids"
security:
- {}
- Authorization: []
responses:
200:
description: "Json object containing all options for a dimension"
schema:
$ref: "#/definitions/DimensionOptions"
headers:
ETag:
description: The RFC7232 ETag header field the of the resource, where the resource is the response to the specific query paramaters. This is used for setting the `If-None-Match` headers on subsequent requests to check for changes.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
* version was incorrect
* dimension was incorrect
* query parameters incorrect offset provided
* query parameters incorrect limit provided
404:
description: "No dimension options were found for dimension"
500:
$ref: "#/responses/InternalError"
/datasets/{id}/editions/{edition}/versions/{version}/metadata:
get:
tags:
- "Public"
summary: "Get metadata for a version"
description: "Get all metadata relevant to a version"
parameters:
- $ref: "#/parameters/edition"
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/version"
security:
- {}
- Authorization: []
responses:
200:
description: "Json object containing all metadata for a version"
schema:
$ref: "#/definitions/Metadata"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
404:
description: "Version not found"
500:
$ref: "#/responses/InternalError"
put:
tags:
- "Private"
summary: "Update metadata for a dataset and a version"
description: "Update metadata for a dataset and a version. The editable metadata can be updated only if both the dataset and the version have a state of associated"
parameters:
- $ref: "#/parameters/dataset_id"
- $ref: "#/parameters/edition"
- $ref: "#/parameters/version"
- $ref: "#/parameters/if_match"
- $ref: "#/parameters/metadata_update"
security:
- Authorization: []
responses:
200:
description: "The editable metadata has been updated"
400:
description: |
Invalid request, reasons can be one of the following:
* invalid request body
* version was incorrect
401:
description: "Unauthorised to update metadata"
403:
description: "Unable to update resource, expected resource to have a state of associated"
404:
description: "Version was not found for a dataset using the id and edition provided"
409:
description: "Instance does not match the expected eTag"
500:
$ref: "#/responses/InternalError"
/instances:
get:
tags:
- "Private"
summary: "Get instances"
description: "Get a list of instances which has been paged"
parameters:
- $ref: "#/parameters/state"
- $ref: "#/parameters/dataset"
- $ref: "#/parameters/limit"
- $ref: "#/parameters/offset"
produces:
- "application/json"
security:
- Authorization: []
responses:
200:
description: "Return a list of instance state"
schema:
$ref: "#/definitions/Instances"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
$ref: "#/responses/InvalidRequestError"
401:
$ref: "#/responses/UnauthorisedError"
500:
$ref: "#/responses/InternalError"
post:
tags:
- "Private"
summary: "Create an instance"
description: |
Create an instance which will be imported. To create an instance an import job id and href is required. This is to allow a link back to the import job
parameters:
- $ref: "#/parameters/newInstance"
produces:
- "application/json"
security:
- Authorization: []
responses:
201:
description: "Successfully created instance"
schema:
$ref: "#/definitions/NewInstance"
headers:
ETag:
type: string
description: "Defines a unique instance resource version"
400:
$ref: "#/responses/InvalidRequestError"
401:
$ref: "#/responses/UnauthorisedError"
403:
$ref: "#/responses/ForbiddenError"
500:
$ref: "#/responses/InternalError"
/instances/{instance_id}:
get:
tags:
- "Private"
summary: "Get an instance"
description: "Get the current state of an instance, this includes all events which have happened."
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/if_match"
produces:
- "application/json"
security:
- Authorization: []
responses:
200:
description: "Return a single instance state"
schema:
$ref: "#/definitions/Instance"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
401:
$ref: "#/responses/UnauthorisedError"
404:
$ref: "#/responses/InstanceNotFound"
409:
$ref: "#/responses/ConflictError"
500:
$ref: "#/responses/InternalError"
put:
tags:
- "Private"
summary: "Update an instance"
description: "Update an instance by providing an unique id and a set of properties to over write"
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/instance"
- $ref: "#/parameters/if_match"
produces:
- "application/json"
security:
- Authorization: []
responses:
200:
description: "The instance has been updated"
headers:
ETag:
type: string
description: "Defines a unique instance resource version"
400:
$ref: "#/responses/InvalidRequestError"
401:
$ref: "#/responses/UnauthorisedError"
403:
$ref: "#/responses/ForbiddenError"
404:
$ref: "#/responses/InstanceNotFound"
409:
$ref: "#/responses/ConflictError"
500:
$ref: "#/responses/InternalError"
/instances/{instance_id}/dimensions:
get:
tags:
- "Private"
summary: "Get a list of dimensions for an instance"
description: "Get all dimensions from an instance"
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/if_match"
produces:
- "application/json"
security:
- Authorization: []
responses:
200:
description: "Return a list of dimensions"
schema:
type: array
items:
$ref: "#/definitions/DimensionOption"
headers:
ETag:
description: The RFC7232 ETag header field. Defines the unique entity tag for the current state of the resource. This is used for setting the `If-Match` and `If-None-Match` headers on subsequent requests.
type: string
Cache-Control:
description: The RFC9111 Cache-Control header field for the response which instructs how to handle caching the resource.
type: string
400:
$ref: "#/responses/InvalidRequestError"
401:
$ref: "#/responses/UnauthorisedError"
403:
$ref: "#/responses/ForbiddenError"
404:
$ref: "#/responses/InstanceNotFound"
409:
$ref: "#/responses/ConflictError"
500:
$ref: "#/responses/InternalError"
post:
deprecated: true
tags:
- "Private"
summary: "Create a dimension"
description: "Create a new dimension which is related to an instance"
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/update_dimension_option_request"
- $ref: "#/parameters/if_match"
security:
- Authorization: []
responses:
201:
description: "Dimension was created"
headers:
ETag:
type: string
description: "Defines a unique instance resource version"
400:
$ref: "#/responses/InvalidRequestError"
404:
$ref: "#/responses/InstanceNotFound"
409:
$ref: "#/responses/ConflictError"
500:
$ref: "#/responses/InternalError"
patch:
tags:
- "Private"
summary: "Create one or more dimensions"
description: "Create one or more dimensions which are related to an instance"
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/patch_dimensions"
- $ref: "#/parameters/if_match"
produces:
- "application/json-patch+json"
security:
- Authorization: []
responses:
200:
description: "All dimensions were successfully created"
schema:
$ref: "#/definitions/PatchDimensions"
headers:
ETag:
type: string
description: "Defines a unique instance resource version"
400:
$ref: "#/responses/InvalidRequestError"
404:
$ref: "#/responses/InstanceNotFound"
409:
$ref: "#/responses/ConflictError"
500:
$ref: "#/responses/InternalError"
/instances/{instance_id}/dimensions/{dimension}:
put:
tags:
- "Private"
summary: "Update dimension"
description: "Update the label and/or description of a dimension within an instance, by providing dimension name and properties to over write"
parameters:
- $ref: "#/parameters/instance_id"
- $ref: "#/parameters/dimension"
- $ref: "#/parameters/update_dimension"
- $ref: "#/parameters/if_match"
security:
- Authorization: []
responses:
200:
description: "The instance has been updated"
headers:
ETag:
type: string
description: "Defines a unique instance resource version"
400:
$ref: "#/responses/InvalidRequestError"
401:
$ref: "#/responses/UnauthorisedError"
403:
$ref: "#/responses/ForbiddenError"
404:
$ref: "#/responses/InstanceNotFound"
409: