8cad86688275383d97c788e32746d4687f40ca43
[cli.git] / products / sample / src / main / resources / open-cli-schema / hello-world-http.yaml
1 open_cli_schema_version: 1.0
2 name: weather-report
3 description: |
4     Place this OCS YAML under $OPEN_CLI_HOME/open-cli-schema folder. Then run the commands
5     oclip schema-refresh
6
7     It is used to display the temparature and wind speed details from https://openweathermap.org.
8     Try to add new commands to display different weather details by exploring this site.
9
10     Sample usage:
11     oclip --product tutorial weather-report --host-url http://api.openweathermap.org --zip-code 637301 --country-code in
12
13 info:
14   product: tutorial
15   service: learning
16   author: Kanagaraj Manickam kanagaraj.manickam@huawei.com
17
18 parameters:
19   - name: zip-code
20     description: zip-code
21     type: string
22     short_option: x
23     long_option: zip-code
24     is_optional: true
25     default_value: 637301
26   - name: country-code
27     description: country-code
28     type: string
29     short_option: y
30     long_option: country-code
31     is_optional: true
32     default_value: in
33   - name: api-code
34     description: api-code
35     type: string
36     short_option: z
37     long_option: api-code
38     is_optional: true
39     default_value: 13cf06b1b379a4b7501c34c2d67a625c
40
41 results:
42   direction: landscape
43   attributes:
44     - name: temperature
45       description: temperature at city
46       scope: short
47       type: string
48     - name: wind
49       description: wind speed
50       scope: short
51       type: string
52 http:
53   service:
54     auth: none
55     mode: direct
56   request:
57     uri: /data/2.5/weather?zip=${zip-code},${country-code}&appid=${api-code}
58     method: GET
59   success_codes:
60     - 200
61   result_map:
62     temperature: $b{$.main.temp}
63     wind: $b{$.wind.speed}
64