Proposal to move Promise shim-layer code to a new deprecated folder
[promise.git] / deprecated / source / schema / nfv-mano.yang
1 module nfv-mano {
2   namespace "urn:opnfv:promise:nfv:mano";
3   prefix mano;
4
5   import access-control-models { prefix acm; }
6   import nfv-infrastructure { prefix nfvi; }
7   import complex-types { prefix ct; }
8   import ietf-inet-types { prefix inet; }
9   import iana-crypt-hash { prefix ianach; }
10
11   description
12     "NFV Management and Orchestration Data Models with complex types and typed
13      instance identifiers representing the NFVO, VNFM, and the VIM.";
14   
15   revision 2015-09-03 {
16     description
17       "This YANG module is modeled using 'yangforge' which natively provides
18        complex types and typed instance identifiers.  This module
19        provides various collections of infrastructure management data
20        models for instance based management";
21   }
22
23   grouping provider-credentials {
24     leaf endpoint {
25       type inet:uri;
26       description "The target URL endpoint for the resource provider";
27       mandatory true;
28     }
29     leaf username {
30       type string;
31       mandatory true;
32     }
33     leaf password {
34       type acm:password;
35       mandatory true;
36     }
37     leaf region {
38       type string;
39       description "Optional specified region for the provider";
40     }
41   }
42
43   ct:complex-type ServiceOrchestrator {
44     ct:extends acm:Domain;
45     ct:abstract true;
46     // TBD
47   }
48
49   ct:complex-type ResourceOrchestrator {
50     ct:extends acm:Domain;
51     ct:abstract true;
52     // TBD
53   }
54
55   ct:complex-type VirtualNetworkFunctionManager {
56     ct:extends acm:Domain;
57     ct:abstract true;
58     // TBD
59   }
60   
61   ct:complex-type VirtualInfrastructureManager {
62     ct:extends acm:Domain;
63     ct:abstract true;
64     
65     leaf name { type string; mandatory true; }
66
67     container auth {
68       description 'Conceptual container that will be extended by explicit provider';
69       // ct:instance-list credentials { ct:instance-type AccessCredential; }
70       // ct:instance-list roles { ct:instance-type AccessRole; }
71       // ct:instance-list policies { ct:instance-type AccessPolicy; }
72     }
73
74     ct:instance-list hosts { ct:instance-type nfvi:PhysicalHost; }
75     ct:instance-list hypervisors { ct:instance-type nfvi:Hypervisor; }
76
77     container compute {
78       if-feature has-compute;
79       description "Contains compute related resources";
80
81       ct:instance-list servers { ct:instance-type nfvi:ServerInstance; }
82       ct:instance-list images { ct:instance-type nfvi:VirtualMachineImage; }
83       ct:instance-list flavors { ct:instance-type nfvi:ComputeFlavor; }
84     }
85
86     container network {
87       if-feature has-networking;
88       description "Contains networking related resources";
89         
90       ct:instance-list networks { ct:instance-type nfvi:Network; }
91       ct:instance-list subnets { ct:instance-type nfvi:SubNetwork; }
92       ct:instance-list ports { ct:instance-type nfvi:SwitchPort; }
93       //ct:instance-list routers { ct:instance-type Router; }
94     }
95   }
96
97   container stack {
98     container nfvo {
99       ct:instance service  { ct:instance-type ServiceOrchestrator; }
100       ct:instance resource { ct:instance-type ResourceOrchestrator; }
101     }
102     container vnfm {
103       ct:instance-list managers { ct:instance-type VirtualNetworkFunctionManager; }
104     }
105     container vim {
106       ct:instance-list managers { ct:instance-type VirtualInfrastructureManager; }
107     }
108   }
109
110   rpc add-vim {
111     description "This operation allows you to add a new VirtualInfrastructureManager into the NFVI stack";
112     input {
113       uses provider-credentials;
114       
115       leaf provider {
116         description "Select a specific resource provider";
117         mandatory true;
118         type enumeration {
119           enum openstack;
120           enum hp;
121           enum rackspace;
122           enum amazon {
123             status planned;
124           }
125           enum joyent {
126             status planned;
127           }
128           enum azure {
129             status planned;
130           }
131         }
132       }
133     }
134     output {
135       leaf id {
136         description "Unique identifier for the newly added provider found in /promise/providers";
137         type instance-identifier {
138           ct:instance-type VirtualInfrastructureManager;
139         }
140       }
141       leaf result {
142         type enumeration {
143           enum success;
144           enum error;
145         }
146       }
147     }
148   }
149 }