1 Promise YANG Schemas based on StormForge
2 ----------------------------------------
10 namespace "urn:opnfv:vim:promise";
13 import opnfv-promise-models { prefix opm; }
14 import complex-types { prefix ct; }
17 "OPNFV Promise Resource Reservation/Allocation controller module";
27 ct:instance-list reservations {
29 "Aggregate collection of all registered ResourceReservation
31 ct:instance-type opm:ResourceReservation;
35 rpc list-reservations;
36 rpc create-reservation;
37 rpc cancel-reservation;
39 notification reservation-event;
40 notification capacity-event;
41 notification allocation-event;
44 OPNFV Promise YANG Schema
45 ^^^^^^^^^^^^^^^^^^^^^^^^^
49 module opnfv-promise-models {
52 import storm-common-models { prefix scm; }
53 import complex-types { prefix ct; }
55 feature resource-reservation;
57 ct:complex-type ResourceReservation {
58 ct:extends scm:ResourceElement;
61 "Contains the capacities of various resource services being reserved
62 along with any resource elements needed to be available at
63 the time of allocation(s).";
65 reference "OPNFV-PROMISE, Section 3.4.1";
67 leaf start { type ct:date-and-time; }
68 leaf end { type ct:date-and-time; }
71 "Duration in seconds from start when unallocated reserved resources
72 will be released back into the pool";
73 type number; units "seconds";
76 type instance-identifier { ct:instance-type scm:AvailabilityZone; }
79 uses scm:compute-capacity;
80 uses scm:networking-capcity;
81 uses scm:storage-capacity;
85 "Reference to a collection of existing resource elements required by
86 this reservation. It can contain any instance derived from
87 ResourceElement, such as ServerInstances or even other
88 ResourceReservations. If the ResourceReservation request is
89 accepted, the ResourceElement(s) listed here will be placed
90 into 'protected' mode as to prevent accidental delete.";
91 type instance-identifier {
92 ct:instance-type scm:ResourceElement;
94 // following 'must' statement applies to each element
95 must "boolean(/provider/elements/*[@id=id])" {
97 "One or more of the ResourceElement(s) does not exist in the
98 provider to be reserved";
103 if-feature multi-provider;
107 "Reference to a specified existing provider from which this
108 reservation will be drawn if used in the context of multi-provider
110 type instance-identifier {
111 ct:instance-type scm:ResourceProvider;
112 require-instance true;
116 container remaining {
119 "Provides visibility into total remaining capacity for this
120 reservation based on allocations that took effect utilizing
121 this reservation ID as a reference.";
123 uses scm:compute-capacity;
124 uses scm:networking-capcity;
125 uses scm:storage-capacity;
128 leaf-list allocations {
131 "Reference to a collection of consumed allocations referencing
133 type instance-identifier {
134 ct:instance-type ResourceAllocation;
140 ct:complex-type ResourceAllocation {
141 ct:extends scm:ResourceElement;
144 "Contains a list of resources to be allocated with optional reference
145 to an existing reservation.
147 If reservation is specified but this request is received prior
148 to reservation start timestamp, then it will be rejected unless
149 'allocate-on-start' is set to true. 'allocate-on-start' allows
150 the allocation to be auto-initiated and scheduled to run in the
153 The 'priority' state indicates the classification for dealing
154 with resource starvation scenarios. Lower priority allocations
155 will be forcefully terminated to allow for higher priority
156 allocations to be fulfilled.
158 Allocations without reference to an existing reservation will
159 receive the lowest priority.";
161 reference "OPNFV-PROMISE, Section 3.4.3";
164 description "Reference to an existing reservation identifier";
166 type instance-identifier {
167 ct:instance-type ResourceReservation;
168 require-instance true;
172 leaf allocate-on-start {
174 "If 'allocate-on-start' is set to true, the 'planned' allocations will
175 take effect automatically at the reservation 'start' date/time.";
176 type boolean; default false;
179 ct:instance-list resources {
180 description "Contains list of new ResourceElements that will be
182 ct:instance-type scm:ResourceElement;
187 "Reflects current priority level of the allocation according to
188 classification rules";