-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathopenapi.yaml
4159 lines (4097 loc) · 124 KB
/
openapi.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:
version: "1.0.0"
title: StackStorm API
description: |
## Welcome
Welcome to the StackStorm API Reference documentation! You can use the StackStorm API to integrate StackStorm with 3rd-party systems and custom applications. Example integrations include writing your own self-service user portal, or integrating with other orchestration systems.
This document provides an overview of how to use the API. Use the menu on the left to look up details of specific API endpoints. For more information about how StackStorm works, and how to use it, check out the main [StackStorm documentation](https://docs.stackstorm.com).
> ### A Quick Note
> This API is intended for software developers, and those are who are comfortable working with RESTful APIs, and writing some code. You do not need to use this API to work with StackStorm, or to use and write integration packs for StackStorm.
## Accessing the API
Usually the API is available at `https://$ST2_HOSTNAME/api`. The default implementation is to use Nginx as a front-end, passing `/api` requests through to the `st2api` service, which by default listens on port `9101`. On a [reference single-system deployment](https://docs.stackstorm.com/install/index.html), all processes run on the same system. If you have a [multi-system deployment](https://docs.stackstorm.com/reference/ha.html), the components may be running on multiple systems, and may be load-balanced.
## Authentication
To authenticate against the StackStorm API, either an authentication token or an API key (but not both) should be provided in the HTTP request headers. The headers are named `X-Auth-Token` and `St2-Api-Key` respectively. In situation when it is impossble to provide a header to the response, query parameters `x-auth-token` and `st2-api-key` could be used instead, but would require you to weight in on security implications.
An authentication token is a time-limited access token, granted once a user authenticates, typically using a username and password. This is suitable for short-term, interactive sessions. [API Keys](https://docs.stackstorm.com/authentication.html#api-keys) do not expire, and are therefore better suited for use with integrating other applications.
### Authentication Tokens
If you are using authentication tokens, you need to first obtain a token using the `/auth` endpoint, and then use the token for future requests against the `/api` endpoint. To obain a token:
```
curl -X POST -u 'yourusername:yourpassword' https://$ST2_HOSTNAME/auth/v1/tokens
```
You can then use the token like this:
```
# Token as header
curl -H "X-Auth-Token: 4d76e023841a4a91a9c66aa4541156fe" https://$ST2_HOSTNAME/api/v1/actions
# Token as query parameter
curl "https://$ST2_HOSTNAME/api/v1/actions?x-auth-token=4d76e023841a4a91a9c66aa4541156fe"
```
### API Keys
API Keys can be generated once, and then used indefinitely. To obtain an API Key, you can use the `st2` CLI:
```
st2 apikey create -k -m '{"used_by": "my integration"}'
```
Note the use of the option `-m` flag to provide key metadata. This is good practice, because it helps to identify what the key is used for. This is useful if you need to later revoke or disable keys.
Keys can also be created using the [apikeys](api/v1/apikeys/) API.
Using the API key:
```
# Key as header
curl -H "St2-Api-Key: <API-KEY-VALUE>" https://$ST2_HOSTNAME/api/v1/actions
# Key as query parameter
curl https://$ST2_HOSTNAME/api/v1/actions?st2-api-key=<API-KEY-VALUE>
```
## HTTP Methods
The StackStorm API supports these HTTP methods:
* **GET:** Use to retrieve data, e.g. current status of an execution. GET requests will not update or change data.
* **POST:** Use to create new resources. For example, make a POST request to create a new rule, or execute an action.
* **PUT:** Use to create or update a resource, e.g. to update an existing Key-Value pair.
* **DELETE:** Remove a resource, e.g. delete an API key.
There is also an implicit support of **OPTIONS** method that will return a set of CORS-related headers.
Methods **HEAD** and **PATCH** are not supported in API v1, but might be considered in future iterations.
## SSL
By default, StackStorm generates a self-signed certificate. If you are testing this with `curl`, you may need to disable certificate validation with `curl -k`. We **strongly** recommend you configure valid, signed certificates for StackStorm.
## JSON
The StackStorm API only supports JSON, not XML. Most POST requests require a well-formatted JSON object body.
## Code Examples
These are some examples to show how to use the StackStorm API with cURL. You can use any REST-capable client, library or programming language to access the StackStorm API.
Obtaining an authentication token:
```
$ curl -X POST -k -u st2admin:'Ch@ngeMe' https://$ST2_HOSTNAME/auth/v1/tokens
{"user": "st2admin", "token": "866218ad67e141e4aaddbbb92964e67e", "expiry": "2017-04-06T01:15:06.602758Z", "id": "58e4451ac4da5f1e040fb859", "metadata": {}}
```
List rules for the ChatOps pack:
```
$ curl -k -X GET -H 'X-Auth-Token: b99d3f74a16e471992f2a10935637916' 'https://$ST2_HOSTNAME/api/v1/rules?limit=50&pack=chatops'
[{"description": "Notification rule to send results of action executions to stream for chatops", "tags": [], "type": {"ref": "standard", "parameters": {}}, "enabled": true, "name": "notify", "trigger": {"ref": "core.st2.generic.notifytrigger", "type": "core.st2.generic.notifytrigger", "parameters": {}}, "criteria": {"trigger.route": {"pattern": "hubot", "type": "equals"}}, "action": {"ref": "chatops.post_result", "parameters": {"user": "{{trigger.data.user}}", "execution_id": "{{trigger.execution_id}}", "channel": "{{trigger.data.source_channel}}"}}, "pack": "chatops", "ref": "chatops.notify", "id": "58b7089ac4da5f6aa779b85a", "uid": "rule:chatops:notify"}]
```
Load a new rule:
```
$ curl -X POST -H 'content-type: application/json' -H 'X-Auth-Token: b99d3f74a16e471992f2a10935637916' --data-binary '{"description": "Sample rule using an Interval Timer.", "enabled": false, "trigger": {"type": "core.st2.IntervalTimer", "parameters": {"unit": "seconds", "delta": 5}}, "criteria": {}, "action": {"ref": "core.local", "parameters": {"cmd": "echo \"{{trigger.executed_at}}\""}}, "pack": "examples", "name": "sample_rule_with_timer"}' https://$ST2_HOSTNAME/api/v1/rules
{
"description": "Sample rule using an Interval Timer.",
"tags": [],
"type": {
"ref": "standard",
"parameters": {}
},
"enabled": false,
"name": "sample_rule_with_timer",
"trigger": {
"ref": "core.cab3cb5f-f0c5-466b-b27c-dc481fc19fac",
"type": "core.st2.IntervalTimer",
"parameters": {
"unit": "seconds",
"delta": 5
}
},
"criteria": {},
"action": {
"ref": "core.local",
"parameters": {
"cmd": "echo \"{{trigger.executed_at}}\""
}
},
"pack": "examples",
"ref": "examples.sample_rule_with_timer",
"id": "58eddb871878c12be65c9fdd",
"uid": "rule:examples:sample_rule_with_timer"
}
```
### Further examples
For further examples of using the API, check out the `st2 --debug` command. If you know which st2 command you want, run `st2 --debug <st2 command>`, and it will display the equivalent cURL commands. For example:
```
st2 --debug action list -p chatops
2017-04-05 00:56:01,935 DEBUG - Using cached token from file "/home/vagrant/.st2/token-st2admin"
# -------- begin 37703888 request ----------
curl -X GET -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-requests/2.11.1' -H 'X-Auth-Token: b99d3f74a16e471992f2a10935637916' 'http://127.0.0.1:9101/v1/actions?pack=chatops'
# -------- begin 37703888 response ----------
[{"name": "format_execution_result", "parameters": {"execution_id": {"required": true, "type": "string", "description": "Id of execution to format"}}, "tags": [], "description": "Format an execution result for chatops", "enabled": true, "entry_point": "format_execution_result.py", "notify": {}, "uid": "action:chatops:format_execution_result", "pack": "chatops", "ref": "chatops.format_execution_result", "id": "58b7089ac4da5f6aa779b847", "runner_type": "run-python"}, {"name": "post_message", "parameters": {"extra": {"type": "object", "description": "Extra adapter-specific parameters."}, "whisper": {"default": false, "type": "boolean", "description": "Send a private message to user"}, "route": {"default": "chatops"}, "experimental": {"default": true, "immutable": true}, "user": {"type": "string", "description": "Explicitly notify a user"}, "message": {"required": true, "type": "string", "description": "Message to send."}, "channel": {"required": true, "type": "string", "description": "Channel to post to"}}, "tags": [], "description": "Post a message to stream for chatops", "enabled": true, "entry_point": "", "notify": {}, "uid": "action:chatops:post_message", "pack": "chatops", "ref": "chatops.post_message", "id": "58b7089ac4da5f6aa779b848", "runner_type": "announcement"}, {"name": "post_result", "parameters": {"whisper": {"default": false, "type": "boolean", "description": "Send a private message to user"}, "user": {"type": "string", "description": "Explicitly notify a user"}, "execution_id": {"required": true, "type": "string", "description": "ID of an execution to send"}, "channel": {"required": true, "type": "string", "description": "Channel to post to"}}, "tags": [], "description": "Post an execution result to stream for chatops", "enabled": true, "entry_point": "workflows/post_result.yaml", "notify": {}, "uid": "action:chatops:post_result", "pack": "chatops", "ref": "chatops.post_result", "id": "58b7089ac4da5f6aa779b849", "runner_type": "action-chain"}]
# -------- end 37703888 response ------------
+---------------------------------+---------+--------------------------------------------+
| ref | pack | description |
+---------------------------------+---------+--------------------------------------------+
| chatops.format_execution_result | chatops | Format an execution result for chatops |
| chatops.post_message | chatops | Post a message to stream for chatops |
| chatops.post_result | chatops | Post an execution result to stream for |
| | | chatops |
+---------------------------------+---------+--------------------------------------------+
```
**NOTE**: The URL displayed in the `curl` commands above is directly accessing the API service on port 9101. If you are connecting to the ST2 API from a remote system, you should modify this to work with Nginx on port 443. In the above output, `http://127.0.0.1:9101/v1/actions?pack=chatops` would become `https://myhost.example.com/api/v1/actions?pack=chatops`.
## Errors
API errors have a standard HTTP response code, and a human-readable message. For example, if you try to create a rule with the same name as an existing rule, you will see an HTTP 409 response:
```
< HTTP/1.1 409 Conflict
< Server: nginx/1.10.3
< Date: Wed, 05 Apr 2017 00:44:32 GMT
< Content-Type: application/json
< Content-Length: 230
< Connection: keep-alive
< Access-Control-Allow-Origin: http://127.0.0.1:3000
< Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS
< Access-Control-Allow-Headers: Content-Type,Authorization,X-Auth-Token,St2-Api-Key,X-Request-ID
< Access-Control-Expose-Headers: Content-Type,X-Limit,X-Total-Count,X-Request-ID
< X-Request-ID: 68de2f2a-6fc0-4827-9ee9-b7124553d3e8
<
{
"conflict-id": "58e43d58c4da5f35c286a81f",
"faultstring": "Tried to save duplicate unique keys (E11000 duplicate key error collection: st2.rule_d_b index: uid_1 dup key: { : \"rule:examples:sample_rule_with_timer\" })"
}
```
`4xx` codes indicate a bad request, whereas `5xx` errors indicate a server-side problem with StackStorm.
## Support
Join our [Slack Community](https://stackstorm.com/community-signup) to get help from the engineering team and fellow users. You can also create issues against the main [StackStorm GitHub repo](https://github.com/StackStorm/st2/issues), or the [st2apidocs repo](https://github.com/StackStorm/st2apidocs) for documentation-specific issues.
We also recommend reviewing the main [StackStorm documentation](https://docs.stackstorm.com/).
paths:
/api/v1/:
get:
operationId: st2api.controllers.root:root_controller.index
description: General API info.
responses:
'200':
description: General API info.
schema:
type: object
properties:
version:
type: string
docs_url:
type: string
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions:
get:
operationId: st2api.controllers.v1.actions:actions_controller.get_all
x-permissions:
description: Returns a list of all actions.
parameters:
- name: exclude_attributes
in: query
description: List of attributes to exclude
type: array
items:
type: string
required: false
- name: limit
in: query
description: Number of actions to get
type: integer
- name: id
in: query
description: Action id filter
type: array
items:
type: string
- name: name
in: query
description: Action name filter
type: string
- name: pack
in: query
description: Action pack name filter
type: string
responses:
'200':
description: List of actions
schema:
type: array
items:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
operationId: st2api.controllers.v1.actions:actions_controller.post
description: |
Create a new action.
parameters:
- name: action
in: body
description: Action content
schema:
$ref: '#/definitions/ActionCreateRequest'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Single action being created
schema:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions/{ref_or_id}:
get:
operationId: st2api.controllers.v1.actions:actions_controller.get_one
description: |
Get one action.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Action requested
schema:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
operationId: st2api.controllers.v1.actions:actions_controller.put
description: |
Update an action.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
- name: action
in: body
description: Action content
schema:
$ref: '#/definitions/ActionUpdateRequest'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Action updated
schema:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
operationId: st2api.controllers.v1.actions:actions_controller.delete
description: |
Delete an action.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'204':
description: Action deleted
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions/views/parameters/{action_id}:
get:
operationId: st2api.controllers.v1.actionviews:parameters_view_controller.get_one
description: |
Get parameters for an action.
parameters:
- name: action_id
in: path
description: Entity id
type: string
required: true
responses:
'200':
description: An object containing action parameters
schema:
$ref: '#/definitions/ActionParameters'
examples:
application/json:
parameters:
cmd:
type: string
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions/views/overview:
get:
operationId: st2api.controllers.v1.actionviews:overview_controller.get_all
x-permissions:
description: Returns a list of all the actions with runner parameters included.
parameters:
- name: exclude_attributes
in: query
description: List of attributes to exclude
type: array
items:
type: string
required: false
- name: limit
in: query
description: Number of actions to get
type: integer
- name: id
in: query
description: Action id filter
type: string
- name: name
in: query
description: Action name filter
type: string
- name: pack
in: query
description: Action pack name filter
type: string
responses:
'200':
description: List of actions
schema:
type: array
items:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions/views/overview/{ref_or_id}:
get:
operationId: st2api.controllers.v1.actionviews:overview_controller.get_one
description: |
Get one action with runner parameters included.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
responses:
'200':
description: Action requested
schema:
$ref: '#/definitions/Action'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actions/views/entry_point/{ref_or_id}:
get:
operationId: st2api.controllers.v1.actionviews:entry_point_controller.get_one
description: |
Get code of the action's entry_point.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
responses:
'200':
description: Entry point code
schema:
type: string
examples:
text/plain: |-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actionalias:
get:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.get_all
x-permissions:
description: |
Get list of action-alias.
parameters:
- name: pack
in: query
description: Only return resources belonging to the provided pack
type: string
responses:
'200':
description: List of action alias.
schema:
type: array
items:
$ref: '#/definitions/ActionAlias'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.post
description: |
Create actionalias.
parameters:
- name: action_alias
in: body
description: Action alias file.
schema:
$ref: '#/definitions/ActionAlias'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'201':
description: Action alias created
schema:
$ref: '#/definitions/ActionAlias'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actionalias/{ref_or_id}:
get:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.get_one
x-requirements:
ref_or_id: (?!match)(?!help).*
description: |
Get a specific actionalias based on ref or id.
parameters:
- name: ref_or_id
in: path
description: Entity reference or id
type: string
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Action alias requested
schema:
$ref: '#/definitions/ActionAlias'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.put
description: Update action alias
parameters:
- name: ref_or_id
in: path
description: Name or ID of the action alias.
type: string
required: true
- name: action_alias
in: body
description: JSON/YAML file containing the action alias to update.
schema:
$ref: '#/definitions/ActionAlias'
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Action alias updated.
schema:
$ref: '#/definitions/ActionAlias'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.delete
description: |
Delete action alias based on ref_or_id.
parameters:
- name: ref_or_id
in: path
description: Name or ID of the action alias.
type: string
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'204':
description: Action alias deleted
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actionalias/match:
post:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.match
x-permissions:
description: |
Match actionalias based on format (representation or display).
parameters:
- name: action_alias_match_api
in: body
description: Object containing the format to be matched.
schema:
$ref: '#/definitions/ActionAliasMatchRequest'
responses:
'200':
description: Action alias match pattern
schema:
$ref: '#/definitions/ActionAliasMatch'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/actionalias/help:
get:
operationId: st2api.controllers.v1.actionalias:action_alias_controller.help
x-permissions:
description: |
Get available help strings for action aliases.
parameters:
- name: pack
in: query
description: Entity pack
type: string
- name: filter
in: query
description: Regex filter
type: string
- name: limit
in: query
description: Number of actions to get
type: integer
default: 100
- name: offset
in: query
description: Number of actions offset
type: integer
default: 0
responses:
'200':
description: Action alias match pattern
schema:
$ref: '#/definitions/ActionAliasHelp'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/aliasexecution:
post:
operationId: st2api.controllers.v1.aliasexecution:action_alias_execution_controller.post
description: |
Create alias execution.
parameters:
- name: payload
in: body
description: Alias execution payload.
schema:
$ref: '#/definitions/AliasExecution'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'201':
description: Action alias created
schema:
$ref: '#/definitions/AliasExecution'
examples:
application/json:
ref: 'core.local'
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/executions:
get:
operationId: st2api.controllers.v1.actionexecutions:action_executions_controller.get_all
x-permissions:
x-log-result: false
description: Returns a list of all executions.
parameters:
- name: exclude_attributes
in: query
description: List of attributes to exclude
type: array
items:
type: string
required: false
- name: limit
in: query
description: Number of actions to get
type: integer
default: 100
- name: offset
in: query
description: Number of actions offset
type: integer
default: 0
- name: sort
in: query
description: Comma-separated list of fields to sort by
type: string
- name: sort_asc
in: query
description: Sort in ascending order
type: string
- name: sort_desc
in: query
description: Sort in descending order
type: string
- name: id
in: query
description: Execution id filter
type: array
items:
type: string
- name: status
in: query
description: Execution status filter
type: string
- name: parent
in: query
description: Parent execution filter
type: string
- name: trigger_type
in: query
description: Trigger type filter
type: string
- name: trigger
in: query
description: Trigger filter
type: string
- name: trigger_instance
in: query
description: Trigger instance filter
type: string
- name: rule
in: query
description: Rule filter
type: string
- name: action
in: query
description: Action ref filter
type: string
- name: runner
in: query
description: Runner filter
type: string
- name: user
in: query
description: User filter
type: string
- name: liveaction
in: query
description: Liveaction id filter
type: string
- name: timestamp
in: query
description: Start timestamp filter
type: string
pattern:
- name: timestamp_lt
in: query
description: Start timestamp less than filter
type: string
pattern:
- name: timestamp_gt
in: query
description: Start timestamp greater than filter
type: string
pattern:
responses:
'200':
description: List of executions
schema:
type: array
items:
$ref: '#/definitions/Execution'
examples:
application/json:
- trigger:
type: object
action:
type: object
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
operationId: st2api.controllers.v1.actionexecutions:action_executions_controller.post
x-log-result: false
description: |
Create a new execution.
parameters:
- name: liveaction_api
in: body
description: Execution request
schema:
$ref: '#/definitions/ExecutionRequest'
- name: show_secrets
in: query
description: Show secrets in plain text
type: boolean
- name: st2-context
in: header
x-as: context_string
description: Additional execution context
type: string
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Execution being created
schema:
$ref: '#/definitions/Execution'
examples:
application/json:
trigger:
type: object
action:
type: object
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/executions/{id}:
get:
operationId: st2api.controllers.v1.actionexecutions:action_executions_controller.get_one
x-log-result: false
description: |
Get one execution.
parameters:
- name: id
in: path
description: Entity id
type: string
required: true
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Execution requested
schema:
$ref: '#/definitions/Execution'
examples:
application/json:
trigger:
type: object
action:
type: object
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
operationId: st2api.controllers.v1.actionexecutions:action_executions_controller.delete
description: |
Cancel an execution.
parameters:
- name: id
in: path
description: Entity id
type: string
required: true
- name: show_secrets
in: query
description: Show secrets in plain text
type: boolean
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'204':
description: Execution cancelled
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/api/v1/executions/{id}/re_run:
post:
operationId: st2api.controllers.v1.actionexecutions:action_execution_rerun_controller.post
x-log-result: false
description: |
Create a new execution.
parameters:
- name: id
in: path
description: Entity id
type: string
required: true
- name: spec_api
in: body
description: Execution request
schema:
type: object
properties:
parameters:
type: object
default: {}
tasks:
type: array
default: []
reset:
type: array
default: []
user:
type: string
default: ''
- name: show_secrets
in: query
description: Show secrets in plain text
type: boolean
x-parameters:
- name: user
in: context
x-as: requester_user
description: User running the action
responses:
'200':
description: Single action being created
schema:
$ref: '#/definitions/Execution'
examples:
application/json:
trigger:
type: object
action:
type: object
# and stuff
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'