Skip to content

Commit fcb3e05

Browse files
authored
Method to select/unselect pack (#46)
* Method to select/unselect pack * Add all flag to GetPackInfo * PackRefenece is added, request and response parameters changed to use it
1 parent f91ae97 commit fcb3e05

1 file changed

Lines changed: 67 additions & 8 deletions

File tree

api/csolution-openapi.yml

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ paths:
9898
'200':
9999
description: OK
100100
content: {application/json: {schema: {$ref: '#/components/schemas/GetPacksInfoResponse'}}}
101+
/rpc/SelectPack:
102+
post:
103+
summary: Select pack
104+
description: Select pack
105+
tags: [/rpc]
106+
requestBody:
107+
content: {application/json: {schema: {$ref: '#/components/schemas/SelectPackRequest'}}}
108+
responses:
109+
'200':
110+
description: OK
111+
content: {application/json: {schema: {$ref: '#/components/schemas/SelectPackResponse'}}}
112+
113+
101114
/rpc/GetDeviceList:
102115
post:
103116
summary: Get device list
@@ -244,7 +257,7 @@ paths:
244257
/rpc/ListMissingPacks:
245258
post:
246259
summary: ListMissingPacks
247-
description: List missing (not installed) packs required by the active target-set
260+
description: List missing (not installed) packs required by the active target-set
248261
tags: [/rpc]
249262
requestBody:
250263
content: {application/json: {schema: {$ref: '#/components/schemas/ListMissingPacksRequest'}}}
@@ -287,21 +300,40 @@ components:
287300
pack:
288301
type: string
289302
description: Originating pack ID
303+
PackReference:
304+
type: object
305+
properties:
306+
pack:
307+
type: string
308+
description: Requested pack ID or range, in the same format as stored in YAML file
309+
resolvedPack:
310+
type: string
311+
description: Resolved pack full ID including version, empty if not resolved
312+
path:
313+
type: string
314+
description: Optional path to local pack
315+
origin:
316+
type: string
317+
description: Originating YAML file
318+
selected:
319+
type: boolean
320+
description: Flag to indicate if reference is selected
321+
required:
322+
- pack
323+
- origin
324+
- selected
290325
Pack:
291326
allOf:
292327
- $ref: '#/components/schemas/Common'
293328
- properties:
294-
overview:
295-
type: string
296-
description: Pack overview
297329
used:
298330
type: boolean
299331
description: True when pack is used in the current context
300332
references:
301333
type: array
302-
description: List of yml files where the pack is referenced
334+
description: List of references in YAML files
303335
items:
304-
type: string
336+
$ref: '#/components/schemas/PackReference'
305337
PacksInfo:
306338
allOf:
307339
- $ref: '#/components/schemas/SuccessResult'
@@ -679,7 +711,7 @@ components:
679711
packs:
680712
type: array
681713
items:
682-
$ref: '#/components/schemas/Pack'
714+
$ref: '#/components/schemas/PackReference'
683715
required:
684716
- components
685717
- packs
@@ -1002,14 +1034,41 @@ components:
10021034
properties:
10031035
context:
10041036
type: string
1037+
all:
1038+
type: boolean
10051039
required:
10061040
- context
1041+
- all
10071042
GetPacksInfoResponse:
10081043
allOf:
10091044
- $ref: '#/x-jsonrpc-envelope-response'
10101045
- properties:
10111046
result:
10121047
$ref: '#/components/schemas/PacksInfo'
1048+
SelectPackRequest:
1049+
allOf:
1050+
- $ref: '#/x-jsonrpc-envelope-request-with-params'
1051+
- properties:
1052+
method:
1053+
type: string
1054+
const: SelectPack
1055+
params:
1056+
type: object
1057+
properties:
1058+
context:
1059+
type: string
1060+
pack:
1061+
description: pack data to select/unselect pack or modify its properties
1062+
$ref: '#/components/schemas/PackReference'
1063+
required:
1064+
- context
1065+
- pack
1066+
SelectPackResponse:
1067+
allOf:
1068+
- $ref: '#/x-jsonrpc-envelope-response'
1069+
- properties:
1070+
result:
1071+
$ref: '#/components/schemas/SuccessResult'
10131072
GetUsedItemsRequest:
10141073
allOf:
10151074
- $ref: '#/x-jsonrpc-envelope-request-with-params'
@@ -1276,7 +1335,7 @@ components:
12761335
filter:
12771336
$ref: '#/components/schemas/DraftProjectsFilter'
12781337
required:
1279-
- filter
1338+
- filter
12801339
GetDraftProjectsResponse:
12811340
allOf:
12821341
- $ref: '#/x-jsonrpc-envelope-response'

0 commit comments

Comments
 (0)