44f1f86a9e00353cc0030550d1a5c4a67d5d3736
[cli.git] /
1 open_cli_schema_version: 1.0
2 name: microservice-create
3 description: Register microservice into Onap
4
5 info:
6   product: onap-amsterdam
7   service: msb
8   author: ONAP CLI Team onap-discuss@lists.onap.org
9
10 parameters:
11   - name: service-name
12     description: Onap service name
13     type: string
14     short_option: x
15     long_option: service-name
16     is_optional: false
17   - name: service-version
18     description: Onap service version
19     type: string
20     short_option: y
21     long_option: service-version
22     is_optional: false
23   - name: service-url
24     description: Onap service base url
25     type: url
26     short_option: r
27     long_option: service-url
28     is_optional: false
29   - name: enable-ssl
30     description: Onap service is enabled with https or not
31     type: string
32     short_option: b
33     long_option: enable-ssl
34     is_optional: true
35     default: false
36   - name: path
37     description: Onap service path
38     type: string
39     short_option: c
40     long_option: path
41     is_optional: true
42   - name: node-ip
43     description: Onap service running node IP
44     type: string
45   - name: node-port
46     description: Onap service running node port
47     type: string
48   - name: create-or-update
49     description: Onap service create or update
50     type: bool
51     default_value: true
52 results:
53   direction: portrait
54   attributes:
55     - name: name
56       description: Onap service name
57       scope: short
58       type: string
59     - name: version
60       description: Onap service version
61       scope: short
62       type: string
63     - name: url
64       description: Onap service base url
65       scope: short
66       type: url
67     - name: status
68       description: Onap service status
69       scope: short
70       type: digit
71     - name: nodes
72       description: Onap service running nodes
73       scope: long
74       type: string
75     - name: enable-ssl
76       description: Onap service is enabled with https or not
77       scope: long
78       type: string
79     - name: path
80       description: Onap service path
81       scope: long
82       type: string
83 http:
84   service:
85     auth: none
86     mode: direct
87   request:
88     uri: /services
89     method: POST
90     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}]}'
91     headers:
92     queries:
93       createOrUpdate: ${create-or-update}
94   success_codes:
95     - 201
96     - 200
97   result_map:
98     name: $b{$.serviceName}
99     version: $b{$.version}
100     url: $b{$.url}
101     status: $b{$.status}
102     enable-ssl: $b{$.enable_ssl}
103     path: $b{$.path}
104     nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port}
105
106   sample_response:
107     body: '{"serviceName":"test","version":"v1","url":"/api/test/v1","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"127.0.0.1","port":"8012","ttl":0,"nodeId":"test_127.0.0.1_8012","expiration":"2017-02-10T05:33:25Z","created_at":"2017-02-10T05:33:25Z","updated_at":"2017-02-10T05:33:25Z"}],"status":"1"}'