461872a77c96303af723bf82074f8997f38bf29f
[cli.git] /
1 # Copyright © Intel Corporation 2019
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: microservice-create
17 description: Register microservice into Onap
18
19 info:
20   product: onap-dublin
21   service: msb
22   author: ONAP CLI Team onap-discuss@lists.onap.org
23
24 parameters:
25   - name: service-name
26     description: Onap service name
27     type: string
28     short_option: x
29     long_option: service-name
30     is_optional: false
31   - name: service-version
32     description: Onap service version
33     type: string
34     short_option: y
35     long_option: service-version
36     is_optional: false
37   - name: service-url
38     description: Onap service base url
39     type: url
40     short_option: r
41     long_option: service-url
42     is_optional: false
43   - name: enable-ssl
44     description: Onap service is enabled with https or not
45     type: string
46     short_option: b
47     long_option: enable-ssl
48     is_optional: true
49     default: false
50   - name: path
51     description: Onap service path
52     type: string
53     short_option: c
54     long_option: path
55     is_optional: true
56   - name: node-ip
57     description: Onap service running node IP
58     type: string
59   - name: node-port
60     description: Onap service running node port
61     type: string
62   - name: create-or-update
63     description: Onap service create or update
64     type: bool
65     default_value: true
66 results:
67   direction: portrait
68   attributes:
69     - name: name
70       description: Onap service name
71       scope: short
72       type: string
73     - name: version
74       description: Onap service version
75       scope: short
76       type: string
77     - name: url
78       description: Onap service base url
79       scope: short
80       type: url
81     - name: status
82       description: Onap service status
83       scope: short
84       type: digit
85     - name: nodes
86       description: Onap service running nodes
87       scope: long
88       type: string
89     - name: enable-ssl
90       description: Onap service is enabled with https or not
91       scope: long
92       type: string
93     - name: path
94       description: Onap service path
95       scope: long
96       type: string
97 http:
98   service:
99     auth: none
100     mode: direct
101   request:
102     uri: /api/microservices/v1/services
103     method: POST
104     body: '{"serviceName":"${service-name}","version":"${service-version}","path":"${path}","url":"${service-url}","protocol":"REST", "enable_ssl":"${enable-ssl}", "visualRange":"1","lb_policy":"ip_hash","nodes":[{"ip":"${node-ip}","port":"${node-port}","ttl":0}]}'
105     headers:
106     queries:
107       createOrUpdate: ${create-or-update}
108   success_codes:
109     - 201
110     - 200
111   result_map:
112     name: $b{$.serviceName}
113     version: $b{$.version}
114     url: $b{$.url}
115     status: $b{$.status}
116     enable-ssl: $b{$.enable_ssl}
117     path: $b{$.path}
118     nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port}