Add Multicloud infra workload API
[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
39   {
40      "generic-vnf-id":"<generic-vnf-id>",
41      "vf-module-id":"<vf-module-id>",
42      "oof_directives":{},
43      "sdnc_directives":{},
44      "template_type":"<heat/tosca/etc.>",
45      "template_data":{}
46   }
47
48 oof_directives:
49 ::
50
51       "directives":[
52          {
53            "id":"<ID of VNFC>",
54            "type": "vnfc",
55            "directives":[
56              {
57                "type":"<flavor_directive>",
58                "attributes":[
59                  {
60                    "attribute_name":"<name of attribute, such as flavor label>",
61                    "attribute_value":"<value such as cloud specific flavor>"
62                  }
63                ]
64              }
65            ]
66          },
67          {
68            "id":"<ID of VNF>",
69            "type": "vnf",
70            "directives":[
71              {
72                "type":"<Name of directive>",
73                "attributes":[
74                  {
75                    "attribute_name":"<name of attribute>",
76                    "attribute_value":"<value>"
77                  }
78                ]
79              }
80            ]
81          }
82       ]
83
84
85 Heat examples
86 =============
87
88   "template_type":"heat",
89   "template_data":{
90      "files":{  },
91      "disable_rollback":true,
92      "parameters":{
93         "flavor":"m1.heat"
94      },
95      "stack_name":"teststack",
96      "template":{
97         "heat_template_version":"2013-05-23",
98         "description":"Simple template to test heat commands",
99         "parameters":
100         {
101            "flavor":{
102               "default":"m1.tiny",
103               "type":"string"
104            }
105         },
106         "resources":{
107            "hello_world":{
108               "type":"OS::Nova::Server",
109               "properties":{
110                  "key_name":"heat_key",
111                  "flavor":{
112                     "get_param":"flavor"
113                  },
114                  "image":"40be8d1a-3eb9-40de-8abd-43237517384f",
115                  "user_data":"#!/bin/bash -xv\necho \"hello world\" &gt; /root/hello-world.txt\n"
116               }
117            }
118         }
119      },
120      "timeout_mins":60
121   }
122
123 Work Items
124 ==========
125
126 #. Work with SO.
127 #. Work with OOF team for oof_directive form.
128 #. Work with SDNC team for sdc_directive form.
129
130 Tests
131 =====
132
133 #. Unit Tests with tox
134 #. CSIT Tests, the input/ouput of broker and each plugin see API design above.
135

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use