Skip to content

Commit

Permalink
Merge pull request StackStorm#3901 from mz-techops/match-and-multiple…
Browse files Browse the repository at this point in the history
…-execute-doc

Match and multiple execute doc
  • Loading branch information
Kami authored Dec 8, 2017
2 parents 1e1af13 + a099216 commit 901a013
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ generate-api-spec: requirements .generate-api-spec
@echo
echo "# NOTE: This file is auto-generated - DO NOT EDIT MANUALLY" > st2common/st2common/openapi.yaml
echo "# Edit st2common/st2common/openapi.yaml.j2 and then run" >> st2common/st2common/openapi.yaml
echo "# make .generate-api-spec make target to generate the final spec file" >> st2common/st2common/openapi.yaml
echo "# make .generate-api-spec" >> st2common/st2common/openapi.yaml
echo "# to generate the final spec file" >> st2common/st2common/openapi.yaml
. virtualenv/bin/activate; st2common/bin/st2-generate-api-spec >> st2common/st2common/openapi.yaml

.PHONY: circle-lint-api-spec
Expand Down
121 changes: 117 additions & 4 deletions st2common/st2common/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# NOTE: This file is auto-generated - DO NOT EDIT MANUALLY
# Edit st2common/st2common/openapi.yaml.j2 and then run
# make .generate-api-spec make target to generate the final spec file
# make .generate-api-spec
# to generate the final spec file
swagger: '2.0'

info:
Expand Down Expand Up @@ -792,7 +793,7 @@ paths:
post:
operationId: st2api.controllers.v1.aliasexecution:action_alias_execution_controller.match_and_execute
description: |
Create an execution based on action alias match (if any).
Create executions based on action alias match (if any).
parameters:
- name: input_api
in: body
Expand All @@ -810,9 +811,16 @@ paths:
description: User performing the operation.
responses:
'201':
description: Action alias execution created
description: Action alias executions created
schema:
$ref: '#/definitions/AliasExecution'
type: object
properties:
results:
description: List of all matched and executed actions
type: array
items:
type: object
$ref: '#/definitions/AliasExecution'
examples:
application/json:
ref: 'core.local'
Expand Down Expand Up @@ -4118,9 +4126,114 @@ definitions:
AliasExecution:
x-api-model: st2common.models.api.action:AliasExecutionAPI
type: object
properties:
actionalias:
type: object
description: Alias for an action
properties:
id:
type: string
description: Unique identifier for the action alias.
ref:
type: string
description: |
System computed user friendly reference for the alias. Provided
value will be overridden by computed value.
uid:
type: string
name:
type: string
description: Name of the action alias.
pack:
type: string
description: The content pack this actionalias belongs to.
description:
type: string
description: Description of the executed alias.
default: ""
enabled:
type: boolean
description: Flag indicating if action alias is enabled.
default: true
action_ref:
type: string
description: Reference to the aliased action
formats:
type: array
description: Possible parameter format.
items:
oneOf:
- type: string
- type: object
description: Matched alias formats
properties:
representation:
type: array
description: Alias format representations
items:
type: string
match_multiple:
type: boolean
optional: true
display:
type: string
description: Display string of alias format
ack:
type: object
description: Acknowledgement message format.
properties:
enabled:
type: boolean
format:
type: string
extra:
type: object
append_url:
type: boolean
result:
type: object
description: Execution message format.
properties:
enabled:
type: boolean
format:
type: string
extra:
type: object
extra:
type: object
description: Extra parameters, usually adapter-specific
execution:
type: object
description: Execution result
properties:
$ref: '#/definitions/Execution'
message:
type: string
AliasMatchAndExecuteInputAPI:
x-api-model: st2common.models.api.action:AliasMatchAndExecuteInputAPI
type: object
required:
- command
- source_channel
properties:
command:
type: string
description: "Command string to parse (eg: message from chat)"
user:
type: string
description: User that requested the execution (or messaged in chat)
source_channel:
type: string
description: Channel the message is from (different than the notification channel)
notification_channel:
type: string
description: StackStorm notification channel to use to respond
default: ""
notification_route:
type: string
description: StackStorm notification route to use to respond
default: ""
Execution:
title: ActionExecution
description: Record of the execution of an action.
Expand Down
118 changes: 115 additions & 3 deletions st2common/st2common/openapi.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ paths:
post:
operationId: st2api.controllers.v1.aliasexecution:action_alias_execution_controller.match_and_execute
description: |
Create an execution based on action alias match (if any).
Create executions based on action alias match (if any).
parameters:
- name: input_api
in: body
Expand All @@ -807,9 +807,16 @@ paths:
description: User performing the operation.
responses:
'201':
description: Action alias execution created
description: Action alias executions created
schema:
$ref: '#/definitions/AliasExecution'
type: object
properties:
results:
description: List of all matched and executed actions
type: array
items:
type: object
$ref: '#/definitions/AliasExecution'
examples:
application/json:
ref: 'core.local'
Expand Down Expand Up @@ -4115,9 +4122,114 @@ definitions:
AliasExecution:
x-api-model: st2common.models.api.action:AliasExecutionAPI
type: object
properties:
actionalias:
type: object
description: Alias for an action
properties:
id:
type: string
description: Unique identifier for the action alias.
ref:
type: string
description: |
System computed user friendly reference for the alias. Provided
value will be overridden by computed value.
uid:
type: string
name:
type: string
description: Name of the action alias.
pack:
type: string
description: The content pack this actionalias belongs to.
description:
type: string
description: Description of the executed alias.
default: ""
enabled:
type: boolean
description: Flag indicating if action alias is enabled.
default: true
action_ref:
type: string
description: Reference to the aliased action
formats:
type: array
description: Possible parameter format.
items:
oneOf:
- type: string
- type: object
description: Matched alias formats
properties:
representation:
type: array
description: Alias format representations
items:
type: string
match_multiple:
type: boolean
optional: true
display:
type: string
description: Display string of alias format
ack:
type: object
description: Acknowledgement message format.
properties:
enabled:
type: boolean
format:
type: string
extra:
type: object
append_url:
type: boolean
result:
type: object
description: Execution message format.
properties:
enabled:
type: boolean
format:
type: string
extra:
type: object
extra:
type: object
description: Extra parameters, usually adapter-specific
execution:
type: object
description: Execution result
properties:
$ref: '#/definitions/Execution'
message:
type: string
AliasMatchAndExecuteInputAPI:
x-api-model: st2common.models.api.action:AliasMatchAndExecuteInputAPI
type: object
required:
- command
- source_channel
properties:
command:
type: string
description: "Command string to parse (eg: message from chat)"
user:
type: string
description: User that requested the execution (or messaged in chat)
source_channel:
type: string
description: Channel the message is from (different than the notification channel)
notification_channel:
type: string
description: StackStorm notification channel to use to respond
default: ""
notification_route:
type: string
description: StackStorm notification route to use to respond
default: ""
Execution:
title: ActionExecution
description: Record of the execution of an action.
Expand Down

0 comments on commit 901a013

Please sign in to comment.