-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathswagger.yml
165 lines (160 loc) · 6.27 KB
/
swagger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
#-----------------------------------------------------------------------------------------------------------------------
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
# and limitations under the License.
#---------------------------------------------------------------------------------------------------------------
openapi: 3.0.0
info:
title: 'AWS Connected Device Framework: Simulation Manager'
description: >
The Simulation Manager service allows you to manage
and simulate a fleet of devices using different test plans.
version: 2.0.0
tags:
- name: Simulation
description: |
An `Simulation` manages how we run and orchistrate different test plans
A Simulation can be composed of multiple Modules and task that will be run in tandem to simulate a device or a fleet of devices
- name: Module
description: |
An `Module` represents a self contained piece of code that can be run by the simulation to generate data, simulate a device behavior, etc
- name: Task
description: |
A `Task` represents the executional section of the simulation.
Based on the configaration of the task multiple ECS instances can be spun up to run the simulation in parallel
During the execution of a task an instance is spun up from the simulation ECS image. This instance will use jmeter to execute the provided test plan
paths:
/simulations:
post:
tags:
- 'Simulations'
summary: 'Create a new Simulation.'
operationId: 'CreateSimulation'
requestBody:
$ref: '#/components/requestBodies/Simulation'
responses:
204:
description: 'success'
headers:
location:
schema:
type: 'string'
/simulations/{simulation-id}/runs:
post:
tags:
- 'Runs'
summary: 'Create a run for the simulation'
operationId: 'CreateRun'
requestBody:
$ref: '#/components/requestBodies/Run'
response:
204:
description: 'success'
headers:
location:
schema:
type: 'string'
components:
requestBodies:
Simulation:
content:
application/vnd.aws-cdf-v1.0+json:
schema:
$ref: '#/components/schemas/Simulation'
Run:
content:
application/vnd.aws-cdf-v1.0+json:
schema:
$ref: '#/components/schemas/Run'
schemas:
Simulation:
type: 'object'
properties:
taskOverrides:
type: 'object'
properties:
taskRoleArn:
type: 'string'
description: "optional IAM Role ARN to be used when launching the ECS task, the role name has be to prefixed with 'cdf-simulation-manager'"
simulation:
type: 'object'
properties:
name:
type: 'string'
description: 'name of the simulation'
deviceCount:
type: 'integer'
format: 'int64'
description: 'The number of devices to run the simulation for'
default: 1
modules:
type: 'object'
description: 'A list of key: value s listing the modules that the simulation needs to execute. The bellow properties are provided as an example and key/values can be changed as requiered'
properties:
simulation-engine:
type: 'string'
description: 'An example key value pair representing the module name and S3 path'
default: 'simulations/modules/simulation-engine.zip'
data-generator:
type: 'string'
description: 'An example key value pair representing the module name and S3 path'
default: 'simulations/modules/data-generator.zip'
tasks:
type: 'object'
description: 'A list of different task that will be executed by the simulator. the Task names are dynamic and can be modified as needed'
additionalProperties:
$ref: '#/components/schemas/Task'
Run:
type: 'object'
properties:
deviceCount:
type: 'integer'
format: 'int32'
default: 100
required: true
description: 'the number of devices to simulate'
simulationId:
type: 'string'
description: 'the id of the simulation you are creating runs against'
required: true
id:
type: 'string'
description: 'the id of the run'
required: false
status:
type: 'string'
description: 'the status of the run'
required: false
Task:
type: 'object'
description: 'task name is not fixed and can be modified to suite your purpose'
properties:
plan:
type: 'string'
description: 'S3 path to Jmeter test plan'
threads:
type: 'object'
description: 'defines the thread configuration that simulator will use'
properties:
total:
type: 'integer'
format: 'int32'
default: '20'
description: 'total number of threads that will be used to run the simulation for all the devices. This field has a direct impact on the number of ECS tasks that get created to run the simulation'
rampUpSecs:
type: 'integer'
format: 'int32'
default: '10'
description: 'the time in seconds before jmeter ramps up the number of threads it is using to run the simulation'
attributes:
type: object
description: 'A list of attributes that will be provided to the simulator to use at execution.these attributes can be modified to suit your needs'
additionalProperties: true