3 version: !<tag:yaml.org,2002:js/undefined> ''
4 description: Resource Management for Virtualized Infrastructure
9 namespace: 'urn:opnfv:promise'
18 access-control-models:
22 description: OPNFV Promise Resource Reservation/Allocation controller module
25 description: Complete coverage of reservation related intents
27 description: Updated to incorporate YangForge framework
29 description: Initial revision.
32 description: 'When enabled, provides resource reservation service'
34 description: 'When enabled, provides resource management across multiple providers'
41 description: Conceptual container that should be extended
43 description: Conceptual container that should be extended
46 description: Conceptual container that should be extended
49 description: Conceptual container that should be extended
51 temporal-resource-collection:
52 description: Information model capturing resource-collection with start/end time window
55 type: 'yang:date-and-time'
57 type: 'yang:date-and-time'
101 'ct:instance-type': 'nfvi:ResourceElement'
102 require-instance: true
103 resource-usage-request:
105 Information model capturing available parameters to make a resource
107 reference: 'OPNFV-PROMISE, Section 3.4.1'
111 description: Optional identifier to an Availability Zone
114 'ct:instance-type': 'nfvi:AvailabilityZone'
116 type: 'yang:date-and-time'
118 type: 'yang:date-and-time'
162 'ct:instance-type': 'nfvi:ResourceElement'
163 require-instance: true
165 Reference to a list of 'pre-existing' resource elements that are
166 required for fulfillment of the resource-usage-request.
168 It can contain any instance derived from ResourceElement,
169 such as ServerInstances or even other
170 ResourceReservations. If the resource-usage-request is
171 accepted, the ResourceElement(s) listed here will be placed
172 into 'protected' mode as to prevent accidental removal.
174 If any of these resource elements become 'unavailable' due to
175 environmental or administrative activity, a notification will
176 be issued informing of the issue.
177 query-start-end-window:
180 description: Matches entries that are within the specified start/end time window
183 type: 'yang:date-and-time'
185 type: 'yang:date-and-time'
191 description: Matches entries that start AND end within the window
194 description: Matches entries that start OR end within the window
197 query-resource-collection:
201 description: Excludes specified collection identifiers from the result
204 'ct:instance-type': ResourceCollection
213 description: Query for ResourceCollection(s) that contain some or more of these element(s)
216 'ct:instance-type': 'nfvi:ResourceElement'
218 description: Query for ResourceCollection(s) that contain all of these element(s)
221 'ct:instance-type': 'nfvi:ResourceElement'
223 description: Matches entries that are within the specified start/end time window
226 type: 'yang:date-and-time'
228 type: 'yang:date-and-time'
234 description: Matches entries that start AND end within the window
237 description: Matches entries that start OR end within the window
240 common-intent-output:
260 type: 'yang:date-and-time'
304 'ct:extends': 'nfvi:ResourceContainer'
305 'ct:abstract': 'true'
307 Describes an abstract ResourceCollection data model, which represents
308 a grouping of capacity and elements available during a given
309 window in time which must be extended by other resource
310 collection related models
313 type: 'yang:date-and-time'
315 type: 'yang:date-and-time'
319 Provides current state of this record whether it is enabled and within
320 specified start/end time
323 'ct:extends': ResourceCollection
325 Describes an instance of an active ResourcePool record, which
326 represents total available capacity and elements from a given
332 'ct:instance-type': 'nfvi:ResourceContainer'
333 require-instance: true
338 'boolean(/source/elements/*[@id=id])':
339 error-message: One or more of the ResourceElement(s) does not exist in the provider to be reserved
341 'ct:extends': ResourceCollection
343 Describes an instance of an accepted resource reservation request,
344 created usually as a result of 'create-reservation' request.
346 A ResourceReservation is a derived instance of a generic
347 ResourceCollection which has additional parameters to map the
348 pool(s) that were referenced to accept this reservation as well
349 as to track allocations made referencing this reservation.
351 Contains the capacities of various resource attributes being
352 reserved along with any resource elements that are needed to be
353 available at the time of allocation(s).
354 reference: 'OPNFV-PROMISE, Section 3.4.1'
357 type: 'yang:date-and-time'
360 type: 'yang:date-and-time'
366 Provides list of one or more pools that were referenced for providing
367 the requested resources for this reservation. This is an
368 important parameter for informing how/where allocation
369 requests can be issued using this reservation since it is
370 likely that the total reserved resource capacity/elements are
371 made availble from multiple sources.
374 'ct:instance-type': ResourcePool
375 require-instance: true
379 Reference to a collection of consumed allocations referencing
383 'ct:instance-type': ResourceAllocation
384 require-instance: true
389 Provides visibility into total remaining capacity for this
390 reservation based on allocations that took effect utilizing
391 this reservation ID as a reference.
430 'ct:extends': ResourceCollection
432 A ResourceAllocation record denotes consumption of resources from a
433 referenced ResourcePool.
435 It does not reflect an accepted request but is created to
436 represent the actual state about the ResourcePool. It is
437 created once the allocation(s) have successfully taken effect
438 on the 'source' of the ResourcePool.
440 The 'priority' state indicates the classification for dealing
441 with resource starvation scenarios. Lower priority allocations
442 will be forcefully terminated to allow for higher priority
443 allocations to be fulfilled.
445 Allocations without reference to an existing reservation will
446 receive the lowest priority.
447 reference: 'OPNFV-PROMISE, Section 3.4.3'
450 description: Reference to an existing reservation identifier (optional)
453 'ct:instance-type': ResourceReservation
454 require-instance: true
456 description: Reference to an existing resource pool from which allocation is drawn
459 'ct:instance-type': ResourcePool
460 require-instance: true
463 description: Reflects current priority level of the allocation according to classification rules
477 description: Reference to actual instance identifier of the provider/server for this allocation
482 'ct:instance-type': ResourceProvider
486 description: currently NOT an extension of ResourceElement.
505 'ct:extends': 'nfvi:ResourceContainer'
520 'ct:instance-type': ResourceFlavor
524 description: Provides list of one or more pools that are referencing this provider.
527 'ct:instance-type': ResourcePool
528 require-instance: true
534 if-feature: multi-provider
535 description: Aggregate collection of all registered ResourceProvider instances for Promise resource management service
536 'ct:instance-type': ResourceProvider
539 if-feature: reservation-service
540 description: Aggregate collection of all ResourcePool instances
541 'ct:instance-type': ResourcePool
544 if-feature: reservation-service
545 description: Aggregate collection of all ResourceReservation instances
546 'ct:instance-type': ResourceReservation
549 description: Aggregate collection of all ResourceAllocation instances
550 'ct:instance-type': ResourceAllocation
556 max-future-start-range:
557 description: "Enforce reservation request 'start' time is within allowed range from now"
562 max-future-end-range:
563 description: "Enforce reservation request 'end' time is within allowed range from now"
569 description: Enforce reservation duration (end-start) does not exceed specified threshold
575 Duration in minutes from start when unallocated reserved resources
576 will be released back into the pool
582 description: Conceptual container that should be extended
621 description: Conceptual container that should be extended
661 description: Conceptual container that should be extended
701 description: Conceptual container that should be extended
742 if-feature: reservation-service
743 description: Make a request to the reservation system to reserve resources
748 description: Optional identifier to an Availability Zone
751 'ct:instance-type': 'nfvi:AvailabilityZone'
753 type: 'yang:date-and-time'
755 type: 'yang:date-and-time'
799 'ct:instance-type': 'nfvi:ResourceElement'
800 require-instance: true
802 Reference to a list of 'pre-existing' resource elements that are
803 required for fulfillment of the resource-usage-request.
805 It can contain any instance derived from ResourceElement,
806 such as ServerInstances or even other
807 ResourceReservations. If the resource-usage-request is
808 accepted, the ResourceElement(s) listed here will be placed
809 into 'protected' mode as to prevent accidental removal.
811 If any of these resource elements become 'unavailable' due to
812 environmental or administrative activity, a notification will
813 be issued informing of the issue.
819 'ct:instance-type': ResourceReservation
834 description: Update reservation details for an existing reservation
840 'ct:instance-type': ResourceReservation
841 require-instance: true
844 description: Optional identifier to an Availability Zone
847 'ct:instance-type': 'nfvi:AvailabilityZone'
849 type: 'yang:date-and-time'
851 type: 'yang:date-and-time'
896 'ct:instance-type': 'nfvi:ResourceElement'
897 require-instance: true
899 Reference to a list of 'pre-existing' resource elements that are
900 required for fulfillment of the resource-usage-request.
902 It can contain any instance derived from ResourceElement,
903 such as ServerInstances or even other
904 ResourceReservations. If the resource-usage-request is
905 accepted, the ResourceElement(s) listed here will be placed
906 into 'protected' mode as to prevent accidental removal.
908 If any of these resource elements become 'unavailable' due to
909 environmental or administrative activity, a notification will
910 be issued informing of the issue.
926 description: Cancel the reservation and be a good steward
932 'ct:instance-type': ResourceReservation
949 if-feature: reservation-service
950 description: Query the reservation system to return matching reservation(s)
956 'ct:instance-type': 'nfvi:AvailabilityZone'
963 description: Excludes specified collection identifiers from the result
966 'ct:instance-type': ResourceCollection
971 description: Query for ResourceCollection(s) that contain some or more of these element(s)
974 'ct:instance-type': 'nfvi:ResourceElement'
976 description: Query for ResourceCollection(s) that contain all of these element(s)
979 'ct:instance-type': 'nfvi:ResourceElement'
981 description: Matches entries that are within the specified start/end time window
984 type: 'yang:date-and-time'
986 type: 'yang:date-and-time'
992 description: Matches entries that start AND end within the window
995 description: Matches entries that start OR end within the window
1002 instance-identifier:
1003 'ct:instance-type': ResourceReservation
1009 type: 'yang:date-and-time'
1053 description: Increase total capacity for the reservation system between a window in time
1058 instance-identifier:
1059 'ct:instance-type': 'nfvi:ResourceContainer'
1061 type: 'yang:date-and-time'
1063 type: 'yang:date-and-time'
1106 instance-identifier:
1107 'ct:instance-type': 'nfvi:ResourceElement'
1108 require-instance: true
1113 instance-identifier:
1114 'ct:instance-type': ResourcePool
1128 description: Decrease total capacity for the reservation system between a window in time
1133 instance-identifier:
1134 'ct:instance-type': 'nfvi:ResourceContainer'
1136 type: 'yang:date-and-time'
1138 type: 'yang:date-and-time'
1181 instance-identifier:
1182 'ct:instance-type': 'nfvi:ResourceElement'
1183 require-instance: true
1188 instance-identifier:
1189 'ct:instance-type': ResourcePool
1203 description: Check available capacity information about a specified resource collection
1221 instance-identifier:
1222 'ct:instance-type': 'nfvi:AvailabilityZone'
1229 description: Excludes specified collection identifiers from the result
1231 instance-identifier:
1232 'ct:instance-type': ResourceCollection
1237 description: Query for ResourceCollection(s) that contain some or more of these element(s)
1239 instance-identifier:
1240 'ct:instance-type': 'nfvi:ResourceElement'
1242 description: Query for ResourceCollection(s) that contain all of these element(s)
1244 instance-identifier:
1245 'ct:instance-type': 'nfvi:ResourceElement'
1247 description: Matches entries that are within the specified start/end time window
1250 type: 'yang:date-and-time'
1252 type: 'yang:date-and-time'
1258 description: Matches entries that start AND end within the window
1261 description: Matches entries that start OR end within the window
1268 instance-identifier:
1269 'ct:instance-type': ResourceCollection
1275 type: 'yang:date-and-time'
1318 description: Create an instance of specified resource(s) utilizing capacity from the pool
1322 if-feature: multi-provider
1324 instance-identifier:
1325 'ct:instance-type': ResourceProvider
1326 require-instance: true
1347 instance-identifier:
1348 'ct:instance-type': ResourceReservation
1349 require-instance: true
1354 instance-identifier:
1355 'ct:instance-type': ResourceAllocation
1369 description: Destroy an instance of resource utilization and release it back to the pool
1374 instance-identifier:
1375 'ct:instance-type': ResourceAllocation
1376 require-instance: true
1392 description: Register a new resource provider into reservation system
1396 description: Select a specific resource provider type
1428 description: The target endpoint for authentication
1430 default: 'http://localhost:5000/v2.0'
1435 type: 'acm:password'
1449 instance-identifier:
1450 'ct:instance-type': ResourceProvider
1464 reservation-event: null
1465 capacity-event: null
1466 allocation-event: null
1468 access-control-models:
1470 access-control-models:
1472 namespace: 'urn:opnfv:promise:acm'
1499 description: The target endpoint for authentication
1505 type: 'acm:password'
1509 'ct:abstract': 'true'
1510 description: Identity represents an administrative access model entity
1525 'ct:extends': Identity
1532 instance-identifier:
1533 'ct:instance-type': Domain
1545 'ct:instance-type': Group
1547 'ct:extends': Identity
1551 instance-identifier:
1552 'ct:instance-type': User
1556 instance-identifier:
1557 'ct:instance-type': Domain
1559 'ct:extends': Identity
1561 Domain represent a distinct administrative domain across
1562 collection of users and groups.
1565 'ct:instance-type': User
1567 'ct:instance-type': Group
1576 namespace: 'urn:opnfv:promise:nfv:infrastructure'
1579 access-control-models:
1588 NFV Infrastructure Data Models with complex types and typed instance
1589 identifiers representing the various ResourceElements available
1590 in the infrastructure across compute, network, and storage.
1593 description: Introduce capacity and element collection into NFVI models
1596 This YANG module is modeled using 'yangforge' which natively provides
1597 complex types and typed instance identifiers. This module
1598 provides various collections of resource management data models
1599 for instance based management
1602 description: used by specific modules implementing manager role for NFVI
1683 resource-collection:
1685 Information model capturing parameters for describing a collection of
1686 resource capacity and resource elements
1729 instance-identifier:
1730 'ct:instance-type': 'nfvi:ResourceElement'
1731 require-instance: true
1734 Information model describing a NFVI resource stack comprising of
1735 various resource elements across compute, network, and storage
1738 'ct:instance-type': 'nfvi:PhysicalHost'
1740 'ct:instance-type': 'nfvi:Hypervisor'
1743 description: Contains compute related resources
1746 'ct:instance-type': 'nfvi:ServerInstance'
1748 'ct:instance-type': 'nfvi:VirtualMachineImage'
1750 'ct:instance-type': 'nfvi:ComputeFlavor'
1752 description: Contains networking related resources
1755 'ct:instance-type': 'nfvi:Network'
1757 'ct:instance-type': 'nfvi:SubNetwork'
1759 'ct:instance-type': 'nfvi:SwitchPort'
1762 'ct:abstract': 'true'
1778 instance-identifier:
1779 'ct:instance-type': 'acm:Identity'
1781 description: "Specify visibility level available from the perspective of 'owner'"
1800 description: Optionally share with explicit list of members of AccessIdentity complex-type
1802 instance-identifier:
1803 'ct:instance-type': 'acm:Identity'
1805 'ct:extends': ResourceElement
1806 'ct:abstract': 'true'
1824 'ct:extends': ResourceInstance
1825 'ct:abstract': 'true'
1827 An abstract resource instance which contains a collection of capacity
1871 instance-identifier:
1872 'ct:instance-type': 'nfvi:ResourceElement'
1873 require-instance: true
1875 'ct:extends': ResourceElement
1877 'ct:extends': ResourceElement
1916 instance-identifier:
1917 'ct:instance-type': Hypervisor
1919 'ct:extends': PhysicalHost
1923 instance-identifier:
1924 'ct:instance-type': PhysicalHost
1938 instance-identifier:
1939 'ct:instance-type': ServerInstance
1941 'ct:extends': ResourceElement
1942 'ct:abstract': 'true'
1959 description: State info about instances currently using this resource element
1961 instance-identifier:
1962 'ct:instance-type': ResourceInstance
1964 VirtualMachineImage:
1965 'ct:extends': ComputeElement
1977 description: "should be a 'private' property so only direct access retrieves content"
2020 'ct:extends': ResourceElement
2034 'ct:extends': ResourceInstance
2038 instance-identifier:
2039 'ct:instance-type': ComputeFlavor
2043 instance-identifier:
2044 'ct:instance-type': VirtualMachineImage
2048 instance-identifier:
2049 'ct:instance-type': PhysicalHost
2053 References to collection of NetworkingElement class objects such as
2054 Network, Subnet, Port, Router that this ServerInstance is
2057 instance-identifier:
2058 'ct:instance-type': NetworkElement
2060 'ct:extends': ResourceElement
2061 'ct:abstract': 'true'
2063 'ct:extends': NetworkElement
2067 instance-identifier:
2068 'ct:instance-type': SubNetwork
2070 'ct:extends': NetworkElement
2074 instance-identifier:
2075 'ct:instance-type': Network
2088 type: 'inet:ip-address'
2090 type: 'inet:ip-address'
2092 'ct:extends': NetworkElement
2096 instance-identifier:
2097 'ct:instance-type': SubNetwork
2127 preprocess: !<tag:yaml.org,2002:js/function> |-
2128 function (arg, params, ctx) {
2129 var changes, match, ref, synth, target;
2130 synth = this.require('data-synth');
2131 ref = params.augment;
2132 for (target in ref) {
2133 changes = ref[target];
2134 match = this.locate(ctx, target);
2135 if (match == null) {
2138 synth.copy(match, changes);
2140 return delete this.source[params.prefix];
2142 construct: !<tag:yaml.org,2002:js/function> |-
2143 function (arg, params, children, ctx, self) {
2144 return (self.origin.construct.apply(this, arguments)).merge({
2145 models: this.resolve('complex-type')
2179 preprocess: !<tag:yaml.org,2002:js/function> |-
2180 function (arg, params, ctx) {
2181 var changes, match, ref, synth, target;
2182 synth = this.require('data-synth');
2183 ref = params.augment;
2184 for (target in ref) {
2185 changes = ref[target];
2186 match = this.locate(ctx, target);
2187 if (match == null) {
2190 synth.copy(match, changes);
2192 return delete this.source[params.prefix];
2194 construct: !<tag:yaml.org,2002:js/function> |-
2195 function (arg, params, children) {
2196 var k, m, modules, ref, synth, v;
2197 synth = this.require('data-synth');
2199 ref = params["import"];
2202 modules[k] = children[k];
2205 m = (synth.Store(params, function() {
2211 this.define('module', arg, m);
2216 preprocess: !<tag:yaml.org,2002:js/function> |-
2217 function (arg, params, ctx) {
2218 return this.source[arg] = this.source;
2222 preprocess: !<tag:yaml.org,2002:js/function> |-
2223 function (arg, params, ctx) {
2224 var k, m, ref, ref1, ref2, results, v;
2225 m = this.preprocess(this.resolve('dependencies', arg));
2229 this.define('extension', k, v);
2234 this.define('typedef', k, v);
2240 results.push(ctx[k] = v);
2259 argument: target-node
2262 preprocess: !<tag:yaml.org,2002:js/function> |-
2263 function (arg, params, ctx) {
2264 return this.source[params.prefix] = this.source;
2304 preprocess: !<tag:yaml.org,2002:js/function> |-
2305 function (arg, p, ctx) {
2306 return ctx.config = arg === true || arg === 'true';
2327 construct: !<tag:yaml.org,2002:js/function> |-
2328 function (arg, params, children) {
2330 synth = this.require('data-synth');
2331 return (synth.Object(params)).bind(children);
2354 construct: !<tag:yaml.org,2002:js/function> |-
2355 function (arg, params, children) {
2357 synth = this.require('data-synth');
2358 return (synth.Object(params)).bind(children);
2376 argument: target-node
2382 preprocess: !<tag:yaml.org,2002:js/function> |-
2383 function (arg, params, ctx) {
2384 if (params.value == null) {
2385 if (this.enumValue == null) {
2388 params.value = this.enumValue++;
2390 params.value = Number(params.value);
2391 this.enumValue = params.value + 1;
2393 return ctx["enum"][arg] = params;
2401 preprocess: !<tag:yaml.org,2002:js/function> |-
2402 function (arg, params, ctx) {
2403 if (params.status === 'unavailable') {
2404 console.warn("feature " + arg + " is unavailable");
2405 if (typeof ctx.feature === 'object') {
2406 return delete ctx.feature[arg];
2408 return delete ctx.feature;
2412 construct: !<tag:yaml.org,2002:js/function> |-
2413 function (arg, params, children) {
2415 feature = this.resolve('feature', arg);
2432 preprocess: !<tag:yaml.org,2002:js/function> |-
2433 function (arg, params) {
2434 return this.define('grouping', arg, params);
2452 preprocess: !<tag:yaml.org,2002:js/function> |-
2453 function (arg, params) {
2454 return this.define('grouping', arg, params);
2462 preprocess: !<tag:yaml.org,2002:js/function> |-
2463 function (arg, params) {
2464 return this.define('identity', arg, params);
2468 preprocess: !<tag:yaml.org,2002:js/function> |-
2469 function (arg, params, ctx) {
2470 if ((this.resolve('feature', arg)) == null) {
2471 return ctx.status = 'unavailable';
2478 preprocess: !<tag:yaml.org,2002:js/function> |-
2479 function (arg, params, ctx) {
2480 var copy, k, m, original, ref, ref1, rev, schema, source, synth, v;
2481 synth = this.require('data-synth');
2482 schema = this.resolve('dependencies', arg, false);
2483 if (schema == null) {
2484 console.warn("no explicit dependency for " + arg + " defined, searching local filesystem");
2485 schema = this.parse("!yang " + arg + ".yang", this.source);
2486 if (schema != null) {
2487 this.define('dependencies', arg, schema);
2488 source = this.source.parent;
2489 while ((source.parent != null) && source.parent.name !== 'yangforge') {
2490 source = source.parent;
2492 if (source.dependencies == null) {
2493 source.dependencies = {};
2495 source.dependencies[arg] = schema;
2498 m = this.preprocess(schema);
2500 throw this.error("unable to resolve '" + arg + "' in dependencies", 'import');
2502 rev = params['revision-date'];
2503 if ((rev != null) && !(rev in m.revision)) {
2504 throw this.error("requested " + rev + " not available in " + arg, 'import');
2509 if (!(v.override === true)) {
2512 original = this.resolve('extension', k);
2513 copy = synth.copy({}, v);
2514 copy.origin = synth.copy({}, (ref1 = original.origin) != null ? ref1 : original);
2515 delete copy.override;
2516 this.define('extension', k, copy);
2518 return this.source[params.prefix] = m;
2520 construct: !<tag:yaml.org,2002:js/function> |-
2521 function (arg, params, children, ctx) {
2522 return this.compile(this.source[params.prefix], this.source);
2535 construct: !<tag:yaml.org,2002:js/function> |-
2536 function (arg, params, children) {
2538 synth = this.require('data-synth');
2539 return (synth.Object(params)).bind(children);
2553 construct: !<tag:yaml.org,2002:js/function> |-
2554 function (arg, params, children) {
2556 synth = this.require('data-synth');
2557 return (synth.Object(params)).bind(children);
2571 construct: !<tag:yaml.org,2002:js/function> |-
2572 function (arg, params, children, ctx, self) {
2574 synth = this.require('data-synth');
2575 if (params.type['instance-identifier'] != null) {
2576 return synth.BelongsTo(params, function() {
2578 model: children.type
2582 return self.origin.construct.apply(this, arguments);
2598 construct: !<tag:yaml.org,2002:js/function> |-
2599 function (arg, params, children) {
2601 synth = this.require('data-synth');
2602 return synth.Property(params, function() {
2603 if (children.type != null) {
2624 construct: !<tag:yaml.org,2002:js/function> |-
2625 function (arg, params, children, ctx, self) {
2627 synth = this.require('data-synth');
2628 if (params.type['instance-identifier'] != null) {
2629 return synth.HasMany(params, function() {
2631 model: children.type
2635 return self.origin.construct.apply(this, arguments);
2652 construct: !<tag:yaml.org,2002:js/function> |-
2653 function (arg, params, children) {
2655 synth = this.require('data-synth');
2656 return synth.List(params, function() {
2657 if (children.type != null) {
2687 construct: !<tag:yaml.org,2002:js/function> |-
2688 function (arg, params, children) {
2690 synth = this.require('data-synth');
2691 item = (synth.Object(null)).bind(children);
2692 return (synth.List(params)).set({
2698 preprocess: !<tag:yaml.org,2002:js/function> |-
2699 function (arg, p, ctx) {
2700 return ctx.mandatory = arg === true || arg === 'true';
2704 preprocess: !<tag:yaml.org,2002:js/function> |-
2705 function (arg, params, ctx) {
2706 if (arg !== 'unbounded') {
2707 return ctx['max-elements'] = Number(arg);
2712 preprocess: !<tag:yaml.org,2002:js/function> |-
2713 function (arg, params, ctx) {
2714 return ctx['min-elements'] = Number(arg);
2737 preprocess: !<tag:yaml.org,2002:js/function> |-
2738 function (arg, params) {
2739 return this.define('notification', arg, params);
2752 construct: !<tag:yaml.org,2002:js/function> |-
2753 function (arg, params, children) {
2755 synth = this.require('data-synth');
2756 return (synth.Object(params)).bind(children);
2770 construct: !<tag:yaml.org,2002:js/function> |-
2771 function (arg, params, children) {
2773 synth = this.require('data-synth');
2774 return (synth.Object(params)).bind(children);
2777 preprocess: !<tag:yaml.org,2002:js/function> |-
2778 function (arg, params, ctx) {
2779 return ctx.path = arg.replace(/[_]/g, '.');
2783 construct: !<tag:yaml.org,2002:js/function> |-
2784 function (arg, params, children, ctx) {
2785 if (ctx.patterns == null) {
2788 return ctx.patterns.push(new RegExp(arg));
2802 argument: target-node
2804 preprocess: !<tag:yaml.org,2002:js/function> |-
2805 function (arg, params, ctx) {
2806 return ctx['require-instance'] = arg === true || arg === 'true';
2812 preprocess: !<tag:yaml.org,2002:js/function> |-
2813 function (arg, params, ctx) {
2814 return this.define('revision', arg, params);
2826 construct: !<tag:yaml.org,2002:js/function> |-
2827 function (arg, params, children) {
2828 var func, method, ref, ref1, request, response, synth;
2829 synth = this.require('data-synth');
2830 func = this.resolve('rpc', arg, false);
2832 func = function(input, output, done) {
2833 return done("No control logic found for '" + arg + "' rpc operation");
2836 request = (ref = children.input) != null ? ref : synth.Meta;
2837 response = (ref1 = children.output) != null ? ref1 : synth.Meta;
2838 method = function(data, resolve, reject) {
2839 var e, error, input, output;
2840 if (typeof console.debug === "function") {
2841 console.debug("executing rpc " + arg + "...");
2844 input = new request(data, this);
2845 output = new response(null, this);
2850 return func.call(this, input, output, function(e) {
2852 return resolve(output);
2858 method.params = params;
2859 method.input = request;
2860 method.output = response;
2891 preprocess: !<tag:yaml.org,2002:js/function> |-
2892 function (arg, params, ctx) {
2898 return delete ctx.submodule;
2930 preprocess: !<tag:yaml.org,2002:js/function> |-
2931 function (arg, params, ctx) {
2937 return delete ctx.submodule;
2940 preprocess: !<tag:yaml.org,2002:js/function> |-
2941 function (arg, params, ctx) {
2942 return ctx.status != null ? ctx.status : ctx.status = arg;
2949 fraction-digits: 0..1
2954 require-instance: 0..1
2956 preprocess: !<tag:yaml.org,2002:js/function> |-
2957 function (arg, params, ctx) {
2958 return delete this.enumValue;
2960 construct: !<tag:yaml.org,2002:js/function> |-
2961 function (arg, params, children, ctx, self) {
2962 if (children.ctype != null) {
2963 ctx.type = children.ctype;
2966 return self.origin.construct.apply(this, arguments);
2975 fraction-digits: 0..1
2980 require-instance: 0..1
2982 preprocess: !<tag:yaml.org,2002:js/function> |-
2983 function (arg, params, ctx) {
2984 return delete this.enumValue;
2986 construct: !<tag:yaml.org,2002:js/function> |-
2987 function (arg, params, children, ctx) {
2988 var key, mparams, ref, ref1, synth, typedef, value;
2989 synth = this.require('data-synth');
2990 typedef = this.resolve('typedef', arg);
2991 if (typedef == null) {
2992 throw this.error("unable to resolve typedef for " + arg);
2995 case typedef.construct == null:
2996 ctx.type = typedef.construct(params, this, arguments.callee);
2998 case typeof typedef.type !== 'object':
3002 mparams = synth.copy({}, value);
3003 synth.copy(mparams, params);
3004 arguments.callee.call(this, key, mparams, children, ctx);
3007 case typeof typedef.type !== 'string':
3008 arguments.callee.call(this, typedef.type, params, children, ctx);
3010 if ((ref1 = ctx.type) != null) {
3011 ref1.toString = function() {
3024 preprocess: !<tag:yaml.org,2002:js/function> |-
3025 function (arg, params) {
3026 return this.define('typedef', arg, params);
3037 preprocess: !<tag:yaml.org,2002:js/function> |-
3038 function (arg, params, ctx) {
3039 var changes, grouping, k, match, ref, ref1, synth, target, v;
3040 synth = this.require('data-synth');
3041 grouping = synth.copy({}, this.resolve('grouping', arg));
3042 delete grouping.description;
3043 delete grouping.reference;
3044 synth.copy(ctx, grouping);
3045 ref = params.refine;
3046 for (target in ref) {
3047 changes = ref[target];
3048 match = this.locate(ctx, target);
3049 if (match == null) {
3052 for (k in changes) {
3057 ref1 = params.augment;
3058 for (target in ref1) {
3059 changes = ref1[target];
3060 match = this.locate(ctx, target);
3061 if (match == null) {
3064 synth.copy(match, changes);
3066 if (typeof ctx.uses === 'object') {
3067 return delete ctx.uses[arg];
3069 return delete ctx.uses;
3132 feature: !<tag:yaml.org,2002:js/undefined> ''
3147 create-reservation: !<tag:yaml.org,2002:js/function> |-
3148 function (input, output, done) {
3149 var reservation, reservations;
3150 reservation = this.create('ResourceReservation');
3151 reservations = this.access('promise.reservations');
3152 return reservation.invoke('update', input.get()).then(function(res) {
3153 return res.save().then(function() {
3154 reservations.push(res);
3157 message: 'reservation request accepted'
3159 output.set('reservation-id', res.id);
3161 })["catch"](function(err) {
3168 })["catch"](function(err) {
3176 query-reservation: !<tag:yaml.org,2002:js/function> |-
3177 function (input, output, done) {
3179 query = input.get();
3180 query.capacity = 'reserved';
3181 return this.invoke('query-capacity', query).then(function(res) {
3182 output.set('reservations', res.get('collections'));
3183 output.set('utilization', res.get('utilization'));
3185 })["catch"](function(e) {
3189 update-reservation: !<tag:yaml.org,2002:js/function> |-
3190 function (input, output, done) {
3192 if ((input.get('reservation-id')) == null) {
3195 message: "must provide 'reservation-id' parameter"
3199 reservation = this.find('ResourceReservation', input.get('reservation-id'));
3200 if (reservation == null) {
3203 message: 'no reservation found for specified identifier'
3207 return reservation.invoke('update', input.get()).then(function(res) {
3208 return res.save().then(function() {
3211 message: 'reservation update successful'
3214 })["catch"](function(err) {
3221 })["catch"](function(err) {
3229 cancel-reservation: !<tag:yaml.org,2002:js/function> |-
3230 function (input, output, done) {
3232 reservation = this.find('ResourceReservation', input.get('reservation-id'));
3233 if (reservation == null) {
3236 message: 'no reservation found for specified identifier'
3240 return reservation.destroy().then((function(_this) {
3242 (_this.access('promise.reservations')).remove(reservation.id);
3243 output.set('result', 'ok');
3244 output.set('message', 'reservation canceled');
3247 })(this))["catch"](function(e) {
3248 output.set('result', 'error');
3249 output.set('message', e);
3253 query-capacity: !<tag:yaml.org,2002:js/function> |-
3254 function (input, output, done) {
3255 var collections, deltas, entry, k, last, matches, metric, timestamp, usages, v, window;
3256 window = input.get('window');
3257 metric = input.get('capacity');
3258 collections = (function() {
3261 return ['ResourcePool'];
3263 return ['ResourceReservation'];
3265 return ['ResourceAllocation'];
3267 return ['ResourcePool', 'ResourceReservation', 'ResourceAllocation'];
3270 matches = collections.reduce(((function(_this) {
3271 return function(a, name) {
3273 res = _this.find(name, {
3274 start: function(value) {
3275 return (window.end == null) || (new Date(value)) <= (new Date(window.end));
3277 end: function(value) {
3278 return (window.start == null) || (new Date(value)) >= (new Date(window.start));
3282 return a.concat.apply(a, res);
3285 if (window.scope === 'exclusive') {
3286 matches = matches.where({
3287 start: function(value) {
3288 return (window.start == null) || (new Date(value)) >= (new Date(window.start));
3290 end: function(value) {
3291 return (window.end == null) || (new Date(value)) <= (new Date(window.end));
3295 matches = matches.without({
3296 id: input.get('without')
3298 if (metric === 'available') {
3299 matches = matches.without({
3300 reservation: function(v) {
3305 output.set('collections', matches);
3306 if ((input.get('show-utilization')) !== true) {
3309 deltas = matches.reduce((function(a, entry) {
3310 var b, base, base1, ekey, k, ref1, ref2, skey, v;
3312 if (b.end == null) {
3313 b.end = 'infiniteT';
3315 ref1 = [(b.start.split('T'))[0], (b.end.split('T'))[0]], skey = ref1[0], ekey = ref1[1];
3316 if (a[skey] == null) {
3322 if (a[ekey] == null) {
3336 if ((base = a[skey].capacity)[k] == null) {
3339 if ((base1 = a[ekey].capacity)[k] == null) {
3342 if (entry.name === 'ResourcePool') {
3343 a[skey].capacity[k] += v;
3344 a[ekey].capacity[k] -= v;
3346 a[skey].capacity[k] -= v;
3347 a[ekey].capacity[k] += v;
3356 usages = (function() {
3357 var i, len, ref1, ref2, ref3, results;
3358 ref1 = Object.keys(deltas).sort();
3360 for (i = 0, len = ref1.length; i < len; i++) {
3361 timestamp = ref1[i];
3362 if (!(timestamp !== 'infinite')) {
3365 entry = deltas[timestamp];
3366 entry.timestamp = (new Date(timestamp)).toJSON();
3367 entry.count += last.count;
3368 ref2 = entry.capacity;
3371 entry.capacity[k] += (ref3 = last.capacity[k]) != null ? ref3 : 0;
3374 results.push(entry);
3378 output.set('utilization', usages);
3381 increase-capacity: !<tag:yaml.org,2002:js/function> |-
3382 function (input, output, done) {
3384 pool = this.create('ResourcePool', input.get());
3385 return pool.save().then((function(_this) {
3386 return function(res) {
3387 (_this.access('promise.pools')).push(res);
3390 message: 'capacity increase successful'
3392 output.set('pool-id', res.id);
3395 })(this))["catch"](function(e) {
3403 decrease-capacity: !<tag:yaml.org,2002:js/function> |-
3404 function (input, output, done) {
3405 var k, pool, ref1, request, v;
3406 request = input.get();
3407 ref1 = request.capacity;
3410 request.capacity[k] = -v;
3412 pool = this.create('ResourcePool', request);
3413 return pool.save().then((function(_this) {
3414 return function(res) {
3415 (_this.access('promise.pools')).push(res);
3418 message: 'capacity decrease successful'
3420 output.set('pool-id', res.id);
3423 })(this))["catch"](function(e) {
3431 create-instance: !<tag:yaml.org,2002:js/function> |-
3432 function (input, output, done) {
3433 var available, flavor, k, pid, provider, required, reservation, rid, v;
3434 pid = input.get('provider-id');
3436 provider = this.find('ResourceProvider', pid);
3437 if (provider == null) {
3440 message: "no matching provider found for specified identifier: " + pid
3445 provider = (this.find('ResourceProvider'))[0];
3446 if (provider == null) {
3449 message: "no available provider found for create-instance"
3454 flavor = provider.access("services.compute.flavors." + (input.get('flavor')));
3455 if (flavor == null) {
3458 message: "no such flavor found for specified identifier: " + pid
3464 cores: flavor.get('vcpus'),
3465 ram: flavor.get('ram'),
3466 gigabytes: flavor.get('disk')
3468 rid = input.get('reservation-id');
3470 reservation = this.find('ResourceReservation', rid);
3471 if (reservation == null) {
3474 message: 'no valid reservation found for specified identifier'
3478 if ((reservation.get('active')) !== true) {
3481 message: "reservation is currently not active"
3485 available = reservation.get('remaining');
3487 available = this.get('promise.capacity.available');
3489 for (k in required) {
3491 if ((v != null) && !!v) {
3492 if (!(available[k] >= v)) {
3495 message: "required " + k + "=" + v + " exceeds available " + available[k]
3501 return this.create('ResourceAllocation', {
3504 }).save().then((function(_this) {
3505 return function(instance) {
3507 url = provider.get('services.compute.endpoint');
3508 request = _this.parent.require('superagent');
3509 request.post(url + "/servers").send({
3511 name: input.get('name'),
3512 imageRef: input.get('image'),
3513 flavorRef: input.get('flavor')
3515 }).set('X-Auth-Token', provider.get('token')).set('Accept', 'application/json').end(function(err, res) {
3516 if ((err != null) || !res.ok) {
3519 return done(res.error);
3521 instance.set('instance-ref', {
3523 server: res.body.server.id
3525 (_this.access('promise.allocations')).push(instance);
3528 message: 'create-instance request accepted'
3530 output.set('instance-id', instance.id);
3535 })(this))["catch"](function(err) {
3543 destroy-instance: !<tag:yaml.org,2002:js/function> |-
3544 function (input, output, done) {
3546 instance = this.find('ResourceAllocation', input.get('instance-id'));
3547 if (instance == null) {
3550 message: 'no allocation found for specified identifier'
3554 return instance.destroy().then((function(_this) {
3556 var provider, ref, request, url;
3557 (_this.access('promise.allocations')).remove(instance.id);
3558 ref = instance.get('instance-ref');
3559 provider = _this.access("promise.providers." + ref.provider);
3560 url = provider.get('services.compute.endpoint');
3561 request = _this.parent.require('superagent');
3562 request["delete"](url + "/servers/" + ref.server).set('X-Auth-Token', provider.get('token')).set('Accept', 'application/json').end(function(err, res) {
3563 if ((err != null) || !res.ok) {
3565 return done(res.error);
3567 output.set('result', 'ok');
3568 output.set('message', 'instance destroyed and resource released back to pool');
3573 })(this))["catch"](function(e) {
3574 output.set('result', 'error');
3575 output.set('message', e);
3579 add-provider: !<tag:yaml.org,2002:js/function> "function (input, output, done) {\n var app, payload, providers, request, url;\n app = this.parent;\n request = app.require('superagent');\n payload = (function() {\n switch (input.get('provider-type')) {\n case 'openstack':\n return {\n auth: {\n tenantId: input.get('tenant.id'),\n tenantName: input.get('tenant.name'),\n passwordCredentials: input.get('username', 'password')\n }\n };\n }\n })();\n if (payload == null) {\n return done('Sorry, only openstack supported at this time');\n }\n url = input.get('endpoint');\n switch (input.get('strategy')) {\n case 'keystone':\n case 'oauth':\n if (!/\\/tokens$/.test(url)) {\n url += '/tokens';\n }\n }\n providers = this.access('promise.providers');\n return request.post(url).send(payload).set('Accept', 'application/json').end((function(_this) {\n return function(err, res) {\n var access, provider, ref1, ref2, ref3;\n if ((err != null) || !res.ok) {\n return done(res.error);\n }\n access = res.body.access;\n provider = _this.create('ResourceProvider', {\n token: access != null ? (ref1 = access.token) != null ? ref1.id : void 0 : void 0,\n name: access != null ? (ref2 = access.token) != null ? (ref3 = ref2.tenant) != null ? ref3.name : void 0 : void 0 : void 0\n });\n return provider.invoke('update', access.serviceCatalog).then(function(res) {\n return res.save().then(function() {\n providers.push(res);\n output.set('result', 'ok');\n output.set('provider-id', res.id);\n return done();\n })[\"catch\"](function(err) {\n output.set('error', {\n message: err\n });\n return done();\n });\n })[\"catch\"](function(err) {\n output.set('error', {\n message: err\n });\n return done();\n });\n };\n })(this));\n }"
3580 typedef: !<tag:yaml.org,2002:js/undefined> ''
3583 id: !<tag:yaml.org,2002:js/function> |-
3585 return prev.set('default', function() {
3591 - !<tag:yaml.org,2002:js/function> |-
3593 return prev.set('default', function() {
3598 - !<tag:yaml.org,2002:js/function> |-
3600 return prev.set('default', function() {
3601 return (new Date).toJSON();
3605 - !<tag:yaml.org,2002:js/function> |-
3607 return this.computed((function() {
3608 var end, now, start;
3610 start = new Date(this.get('start'));
3613 case (this.get('end')) == null:
3614 return new Date(this.get('end'));
3619 return (this.get('enabled')) && ((start <= now && now <= end));
3624 ResourceReservation:
3626 - !<tag:yaml.org,2002:js/function> |-
3628 return prev.set('default', function() {
3633 - !<tag:yaml.org,2002:js/function> |-
3635 return prev.set('default', function() {
3636 return (new Date).toJSON();
3640 - !<tag:yaml.org,2002:js/function> |-
3642 return this.computed((function() {
3643 var end, now, start;
3645 start = new Date(this.get('start'));
3648 case (this.get('end')) == null:
3649 return new Date(this.get('end'));
3654 return (this.get('enabled')) && ((start <= now && now <= end));
3660 - !<tag:yaml.org,2002:js/function> |-
3662 return prev.set('default', function() {
3664 end = new Date(this.get('start'));
3665 max = this.parent.get('promise.policy.reservation.max-duration');
3669 end.setTime(end.getTime() + (max * 60 * 60 * 1000));
3670 return end.toJSON();
3674 - !<tag:yaml.org,2002:js/function> |-
3676 return this.computed((function() {
3678 res = this.store.find('ResourceAllocation', {
3679 reservation: this.id
3681 return res.map(function(x) {
3689 - !<tag:yaml.org,2002:js/function> |-
3691 return this.computed((function() {
3692 var entry, i, k, len, records, total, usage, v;
3693 total = this.get('capacity');
3694 records = this.store.find('ResourceAllocation', {
3695 id: this.get('allocations'),
3698 for (i = 0, len = records.length; i < len; i++) {
3700 usage = entry.get('capacity');
3712 - !<tag:yaml.org,2002:js/function> |-
3714 return function(value, resolve, reject) {
3715 var end, hasCapacity, k, now, ref, start, v;
3716 if (value == null) {
3719 ref = value.capacity;
3722 if ((v != null) && !!v) {
3726 if ((!hasCapacity) && value.elements.length === 0) {
3727 return reject("unable to validate reservation record without anything being reserved");
3730 if (value.start != null) {
3731 start = new Date(value.start);
3733 if (value.end != null) {
3734 end = new Date(value.end);
3736 if ((end != null) && end < now) {
3737 return reject("requested end time " + value.end + " cannot be in the past");
3739 if ((start != null) && (end != null) && start > end) {
3740 retun(reject("requested start time must be earlier than end time"));
3742 return resolve(this);
3746 - !<tag:yaml.org,2002:js/function> |-
3748 return function(req, resolve, reject) {
3749 if (req.start == null) {
3750 req.start = this.get('start');
3752 if (req.end == null) {
3753 req.end = this.get('end');
3755 return this.parent.invoke('query-capacity', {
3758 capacity: 'available',
3760 }).then((function(_this) {
3761 return function(res) {
3762 var available, collections, end, entries, i, k, pools, ref, ref1, start, t1, t2, v, x;
3763 collections = res.get('collections');
3764 if (!(collections.length > 0)) {
3765 return reject('no resource capacity available during requested start/end time');
3767 pools = collections.filter(function(e) {
3768 return /^ResourcePool/.test(e);
3770 entries = res.get('utilization');
3771 start = new Date(req.start);
3772 end = new Date(req.end);
3773 for (x = i = 0, ref = entries.length - 1; 0 <= ref ? i <= ref : i >= ref; x = 0 <= ref ? ++i : --i) {
3774 t1 = new Date(entries[x].timestamp);
3778 if (x < entries.length - 1) {
3779 t2 = new Date(entries[x + 1].timestamp);
3780 if (!(t2 > start)) {
3784 available = entries[x].capacity;
3785 ref1 = req.capacity;
3788 if ((v != null) && !!v) {
3789 if (!(available[k] >= v)) {
3790 return reject("requested " + k + "=" + v + " exceeds available " + available[k] + " between " + t1 + " and " + t2);
3796 _this.set('pools', pools);
3797 return resolve(_this);
3799 })(this))["catch"](function(err) {
3805 - !<tag:yaml.org,2002:js/function> |-
3807 return function(resolve, reject) {
3808 return this.invoke('validate', this.get()).then(function(res) {
3810 now = (new Date).toJSON();
3811 if ((res.get('created-on')) == null) {
3812 res.set('created-on', now);
3814 res.set('modified-on', now);
3815 return resolve(res);
3816 })["catch"](function(e) {
3823 - !<tag:yaml.org,2002:js/function> |-
3825 return prev.set('default', function() {
3830 - !<tag:yaml.org,2002:js/function> |-
3832 return prev.set('default', function() {
3833 return (new Date).toJSON();
3837 - !<tag:yaml.org,2002:js/function> |-
3839 return this.computed((function() {
3840 var end, now, start;
3842 start = new Date(this.get('start'));
3845 case (this.get('end')) == null:
3846 return new Date(this.get('end'));
3851 return (this.get('enabled')) && ((start <= now && now <= end));
3857 - !<tag:yaml.org,2002:js/function> |-
3859 return this.computed((function() {
3861 case !((this.get('reservation')) == null):
3863 case !!(this.get('active')):
3874 - !<tag:yaml.org,2002:js/function> |-
3876 return prev.set('default', function() {
3881 - !<tag:yaml.org,2002:js/function> |-
3883 return prev.set('default', function() {
3884 return (new Date).toJSON();
3888 - !<tag:yaml.org,2002:js/function> |-
3890 return this.computed((function() {
3891 var end, now, start;
3893 start = new Date(this.get('start'));
3896 case (this.get('end')) == null:
3897 return new Date(this.get('end'));
3902 return (this.get('enabled')) && ((start <= now && now <= end));
3908 - !<tag:yaml.org,2002:js/function> |-
3910 return function(resolve, reject) {
3911 var hasCapacity, k, ref, v, value;
3913 ref = value.capacity;
3916 if ((v != null) && !!v) {
3920 if ((!hasCapacity) && value.elements.length === 0) {
3921 return reject("unable to save pool record without any capacity values");
3923 return resolve(this);
3928 - !<tag:yaml.org,2002:js/function> |-
3930 return prev.set('default', function() {
3935 - !<tag:yaml.org,2002:js/function> |-
3937 return prev.set('private', true);
3940 - !<tag:yaml.org,2002:js/function> |-
3942 return this.computed((function() {
3943 return (this.store.find('ResourcePool', {
3944 source: this.get('name')
3945 })).map(function(x) {
3953 - !<tag:yaml.org,2002:js/function> |-
3955 return function(services, resolve, reject) {
3957 if (services == null) {
3960 if (!services.length) {
3961 return reject("unable to update provider without list of services");
3963 request = this.store.parent.require('superagent');
3964 services.forEach((function(_this) {
3965 return function(service) {
3967 switch (service.type) {
3969 url = service.endpoints[0].publicURL;
3970 _this.set('services.compute.endpoint', url);
3971 request.get(url + "/limits").set('X-Auth-Token', _this.get('token')).set('Accept', 'application/json').end(function(err, res) {
3973 if ((err != null) || !res.ok) {
3974 console.warn("request to discover capacity limits failed");
3977 capacity = (ref = res.body.limits) != null ? ref.absolute : void 0;
3978 return (_this.access('capacity')).set({
3979 cores: capacity.maxTotalCores,
3980 ram: capacity.maxTotalRAMSize,
3981 instances: capacity.maxTotalInstances,
3982 addresses: capacity.maxTotalFloatingIps
3985 return request.get(url + "/flavors/detail").set('X-Auth-Token', _this.get('token')).set('Accept', 'application/json').end(function(err, res) {
3986 var er, error, flavors, ref;
3987 if ((err != null) || !res.ok) {
3988 console.warn("request to discover compute flavors failed");
3991 flavors = res.body.flavors;
3993 flavors = flavors.map(function(x) {
3998 return (ref = _this.access('services.compute.flavors')).push.apply(ref, flavors);
4001 return console.warn("failed to update flavors into the provider due to validation errors");
4007 return resolve(this);
4010 ResourceFlavor: !<tag:yaml.org,2002:js/undefined> ''
4011 pkgdir: /home/plee/hack/opnfv-promise
4014 promise.capacity.total:
4015 - !<tag:yaml.org,2002:js/function> |-
4017 return this.computed((function() {
4019 combine = function(a, b) {
4034 return (this.parent.get('pools')).filter(function(entry) {
4035 return entry.active === true;
4036 }).reduce(combine, {});
4041 promise.capacity.reserved:
4042 - !<tag:yaml.org,2002:js/function> |-
4044 return this.computed((function() {
4046 combine = function(a, b) {
4061 return (this.parent.get('reservations')).filter(function(entry) {
4062 return entry.active === true;
4063 }).reduce(combine, {});
4068 promise.capacity.usage:
4069 - !<tag:yaml.org,2002:js/function> |-
4071 return this.computed((function() {
4073 combine = function(a, b) {
4088 return (this.parent.get('allocations')).filter(function(entry) {
4089 return entry.active === true;
4090 }).reduce(combine, {});
4095 promise.capacity.available:
4096 - !<tag:yaml.org,2002:js/function> |-
4098 return this.computed((function() {
4099 var k, reserved, total, usage, v;
4100 total = this.get('total');
4101 reserved = this.get('reserved');
4102 usage = this.get('usage');
4108 if (reserved[k] != null) {
4109 total[k] -= reserved[k];
4111 if (usage[k] != null) {
4112 total[k] -= usage[k];
4120 config: !<tag:yaml.org,2002:js/undefined> ''