Fix Multicloud infra workload API Format
[multicloud/framework.git] / docs / specs / multicloud_infra_workload.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (c) 2017-2018 Intel, Inc.
4
5 ===============================
6 MultiCloud infra_workload API
7 ===============================
8
9 we have two purposes for this API:
10
11 #. Intergrate SO and Multicloud.
12 #. Generic API for SO to talk to different Multicloud plugins.
13
14
15 Problem Description
16 ===================
17
18 Currently HPA flavors are returned by OOF  to SO and SO copies these flavors in
19 the Heat template before sending the Heat template to Multicloud.  In Casablanca
20 instead of SO making changes in the Heat template the flavor information will be
21 provided to Multicloud and Multicloud will pass these as parameters to HEAT
22 command line.
23 The detail design refer to https://wiki.onap.org/display/DW/SO+Casablanca+HPA+Design
24
25
26 Propose Change
27 ==============
28
29 Add infrastructure workload API
30 -------------------------------
31
32 API URL: http://{msb IP}:{msb port}/api/multicloud /v1/{cloud-owner}/{cloud-region-id}/infra_workload
33
34 Request Body:
35 ::
36
37   {
38      "generic-vnf-id":"<generic-vnf-id>",
39      "vf-module-id":"<vf-module-id>",
40      "oof_directives":{},
41      "sdnc_directives":{},
42      "template_type":"<heat/tosca/etc.>",
43      "template_data":{}
44   }
45
46 oof_directives:
47 ::
48
49       "directives":[
50          {
51            "id":"<ID of VNFC>",
52            "type": "vnfc",
53            "directives":[
54              {
55                "type":"<flavor_directive>",
56                "attributes":[
57                  {
58                    "attribute_name":"<name of attribute, such as flavor label>",
59                    "attribute_value":"<value such as cloud specific flavor>"
60                  }
61                ]
62              }
63            ]
64          },
65          {
66            "id":"<ID of VNF>",
67            "type": "vnf",
68            "directives":[
69              {
70                "type":"<Name of directive>",
71                "attributes":[
72                  {
73                    "attribute_name":"<name of attribute>",
74                    "attribute_value":"<value>"
75                  }
76                ]
77              }
78            ]
79          }
80       ]
81
82
83 Heat examples
84 =============
85 ::
86
87   "template_type":"heat",
88   "template_data":{
89      "files":{  },
90      "disable_rollback":true,
91      "parameters":{
92         "flavor":"m1.heat"
93      },
94      "stack_name":"teststack",
95      "template":{
96         "heat_template_version":"2013-05-23",
97         "description":"Simple template to test heat commands",
98         "parameters":
99         {
100            "flavor":{
101               "default":"m1.tiny",
102               "type":"string"
103            }
104         },
105         "resources":{
106            "hello_world":{
107               "type":"OS::Nova::Server",
108               "properties":{
109                  "key_name":"heat_key",
110                  "flavor":{
111                     "get_param":"flavor"
112                  },
113                  "image":"40be8d1a-3eb9-40de-8abd-43237517384f",
114                  "user_data":"#!/bin/bash -xv\necho \"hello world\" &gt; /root/hello-world.txt\n"
115               }
116            }
117         }
118      },
119      "timeout_mins":60
120   }
121
122 Work Items
123 ==========
124
125 #. Work with SO.
126 #. Work with OOF team for oof_directive form.
127 #. Work with SDNC team for sdc_directive form.
128
129 Tests
130 =====
131
132 #. Unit Tests with tox
133 #. CSIT Tests, the input/ouput of broker and each plugin see API design above.