0705b04ec13b96f636410aaa6e77a6dd47af31e3
[cli.git] /
1 # Copyright 2018 Huawei Technologies Co., Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 open_cli_schema_version: 1.0
16 name: service-model-create
17 description: Create Service model in SDC
18
19 info:
20   product: onap-beijing
21   service: sdc
22   author: ONAP CLI Team onap-discuss@lists.onap.org
23
24
25 parameters:
26   - name: name
27     description: Onap Service Name
28     type: string
29     short_option: x
30     long_option: name
31     is_optional: false
32   - name: description
33     description: Description for Service
34     type: string
35     short_option: y
36     long_option: description
37     is_optional: true
38   - name: project-code
39     description: Project code
40     type: string
41     long_option: project-code
42     short_option: z
43     is_optional: true
44   - name: category
45     description: Service category
46     type: string
47     short_option: b
48     long_option: category
49     is_optional: true
50     default_value: network l1-3
51   - name: category-display-name
52     description: Service category display name
53     type: string
54     short_option: c
55     long_option: category-display-name
56     is_optional: true
57     default_value: Network L1-3
58   - name: icon-id
59     description: Service Icon id
60     type: string
61     short_option: e
62     long_option: icon-id
63     default_value: defaulticon
64     is_optional: true
65
66 results:
67   direction: portrait
68   attributes:
69     - name: ID
70       description: Service ID
71       scope: short
72       type: string
73 http:
74   service:
75     name: sdc
76     version: v1.0
77     auth: basic
78     mode: direct
79   request:
80     uri: /sdc2/rest/v1/catalog/services
81     method: POST
82     body: '{"componentType": "SERVICE", "properties": [], "requirements": {}, "toscaArtifacts": {}, "tags": ["CLI", "${name}"], "artifacts": {}, "description": "${description}", "serviceApiArtifacts": {}, "capabilities": {}, "name": "${name}", "componentInstancesProperties": {}, "componentInstancesAttributes": {}, "contactId": "${onap-username}", "groups": [], "projectCode": "${project-code}", "deploymentArtifacts": {}, "attributes": [], "componentInstances": [], "categories": [{"normalizedName": "${category}", "name": "${category-display-name}", "uniqueId": "serviceNewCategory.${category}", "icons": ["${icon-id}"]}], "icon": "${icon-id}"}'
83   success_codes:
84     - 200
85     - 201
86   result_map:
87     ID: $b{$.uniqueId}
88