transition to latest yang-js/yang-express, introduce additional xos-core models for service-attribute, xos-base, provider, service, and tenancy
diff --git a/package.json b/package.json
index 59bc85e..d72531f 100644
--- a/package.json
+++ b/package.json
@@ -32,8 +32,8 @@
"minimist": "^1.2.0",
"node-uuid": "^1.4.7",
"superagent": "^2.0.0",
- "yang-express": "^0.3.11",
- "yang-js": "^0.15.21"
+ "yang-express": "^0.3.15",
+ "yang-js": "^0.15.25"
},
"optionalDependencies": {
"corenova": "^1.0.0"
diff --git a/schema/xos-core.yang b/schema/xos-core.yang
index 846da5c..12cd65d 100644
--- a/schema/xos-core.yang
+++ b/schema/xos-core.yang
@@ -47,11 +47,13 @@
}
}
- grouping tenant-root {
- description
- "A Tenant Root is one of the things that can sit at the root of a chain
- of tenancy. This object represents a node.";
-
+ grouping service-attribute {
+ leaf name { type string { length 0..128; } }
+ leaf value { type string; }
+ // don't need pointer back to service
+ }
+
+ grouping xos-base {
leaf id {
type unique-identifier;
mandatory true;
@@ -66,14 +68,26 @@
type string {
length 0..255;
}
- description "Specify name of the TenantRoot";
}
-
- leaf service-specific-attribute { type string; }
+ // NOTE: this used to be service-specific-attribute
+ //leaf service-specific-attribute { type string; }
+ list attribute { uses service-attribute; }
+ // TODO: service-specific-id should be one of the attributes above?
leaf service-specific-id {
type unique-identifier;
mandatory true;
}
+ }
+
+ grouping tenant-root {
+ uses xos-base {
+ refine 'name' {
+ description "Specify name of the TenantRoot";
+ }
+ }
+ description
+ "A Tenant Root is one of the things that can sit at the root of a chain
+ of tenancy. This object represents a node.";
list subscribed-tenant {
config false;
@@ -87,7 +101,86 @@
}
// seems we should have interesting attributes specific to subscriber?
}
+
+ grouping provider {
+ uses tenant-root {
+ refine kind { default provider; }
+ }
+ // seems we should have interesting attributes specific to provider?
+ }
+ grouping service {
+ uses xos-base {
+ refine 'name' {
+ description "Name of the Service";
+ }
+ }
+ leaf description {
+ type string {
+ length 0..254;
+ }
+ description "Description of the Service";
+ }
+ leaf version {
+ type string { length 0..30; }
+ description "Version of Service Definition";
+ }
+
+ leaf enabled { type boolean; default true; }
+ leaf published { type boolean; default true; }
+
+ container external-assets {
+ leaf view { type inet:uri; }
+ leaf icon { type inet:uri; }
+ }
+
+ list keypair {
+ description "collection of public/private key pair(s)";
+ leaf public { type string { length 0..1024; } }
+ leaf private { type string { length 0..1024; } }
+ }
+
+ // TOOD: need to better understand relationship between Service and Slice
+ action scale {
+ description "Adjust scale for slice(s)";
+ }
+
+ // TODO: need to better understand relationship between Service and VTN
+ }
+
+ grouping tenancy {
+ uses xos-base;
+
+ choice provider {
+ description "only one type of provider node is valid.";
+ case service { leaf provider-service { type instance-identifier; } }
+ }
+
+ choice subscriber {
+ description "only one type of subscriber node is valid.";
+ case service { leaf subscriber-service { type instance-identifier; } }
+ case tenant { leaf subscriber-tenant { type instance-identifier; } }
+ case user { leaf subscriber-user { type instance-identifier; } }
+ case root { leaf subscriber-root { type instance-identifier; } }
+ case network { leaf subscriber-network { type instance-identifier; } }
+ }
+
+ leaf connect-method {
+ //when "../kind == 'static-tenant'";
+
+ type enumeration {
+ enum public { description "Public"; }
+ enum private { description "Private"; }
+ enum private-unidirectional { description "Private Uni-directional"; }
+ enum na { description "Not Applicable"; }
+ }
+ default na;
+ }
+
+ // TODO: should be able to deal with TenantWithContainer here
+
+ }
+
/*** main configuration tree for XOS ***/
container api {
diff --git a/src/server.coffee b/src/server.coffee
index 46a1e1b..37f7345 100644
--- a/src/server.coffee
+++ b/src/server.coffee
@@ -14,13 +14,14 @@
@enable 'openapi', require('../package.json')
@enable 'restjson'
@enable 'websocket'
-
- data = require('../sample-data.json')
- cord = @link Yang.require('cord-core'), data
- xos = @link Yang.require('xos-core'), data
-
- cord.on 'update', (prop) ->
- console.log "[#{prop.path}] got updated, should consider persisting the change somewhere"
+
+ @open 'cord', ->
+ @import Yang.require('cord-core')
+ @import Yang.require('xos-core')
+
+ @connect require('../sample-data.json')
+ @on 'update', (prop) ->
+ console.log "[#{prop.path}] got updated, should consider persisting the change somewhere"
module.exports = app