1 # Copyright © Intel Corporation 2019
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 open_cli_schema_version: 1.0
16 name: microservice-create
17 description: Register microservice into Onap
22 author: ONAP CLI Team onap-discuss@lists.onap.org
26 description: Onap service name
29 long_option: service-name
31 - name: service-version
32 description: Onap service version
35 long_option: service-version
38 description: Onap service base url
41 long_option: service-url
44 description: Onap service is enabled with https or not
47 long_option: enable-ssl
51 description: Onap service path
57 description: Onap service running node IP
60 description: Onap service running node port
62 - name: create-or-update
63 description: Onap service create or update
70 description: Onap service name
74 description: Onap service version
78 description: Onap service base url
82 description: Onap service status
86 description: Onap service running nodes
90 description: Onap service is enabled with https or not
94 description: Onap service path
102 uri: /api/microservices/v1/services
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}]}'
107 createOrUpdate: ${create-or-update}
112 name: $b{$.serviceName}
113 version: $b{$.version}
116 enable-ssl: $b{$.enable_ssl}
118 nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port}