module xos-core { | |
namespace "urn:onlab:xos:core"; | |
prefix xos; | |
yang-version 1.1; | |
organization | |
"Open Networking Lab (XOS) / Corenova Technologies"; | |
contact | |
"Larry Peterson <llp@onlab.us> | |
Peter K. Lee <peter@corenova.com>"; | |
description | |
"This module contains a collection of core models for XOS. | |
Copyright (c) 2016 ON.LAB and the persons identified as authors of | |
the code. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, is permitted pursuant to, and subject to the license | |
terms of the Apache License, Version 2.0 which accompanies this | |
distribution, and is available at | |
(http://www.apache.org/licenses/LICENSE-2.0)."; | |
revision 2016-07-14 { | |
description "Initial revision."; | |
} | |
import ietf-yang-types { prefix yang; } | |
import ietf-inet-types { prefix inet; } | |
feature synchronizer { | |
description | |
"Enables configuration synchronization to the distributed store."; | |
} | |
identity kind; | |
identity generic { base kind; } | |
identity subscriber { base kind; } | |
typedef unique-identifier { | |
description "defines valid formats for external reference id"; | |
type union { | |
type uint32 { range 1..max; } | |
type yang:uuid; | |
type inet:uri; | |
} | |
} | |
grouping xos-attribute { | |
leaf name { type string { length 0..128; } } | |
leaf value { type string; } | |
// don't need pointer back to service | |
} | |
grouping xos-sync-record { | |
description "Synchronizer-specific properties for model records"; | |
leaf created { type yang:date-and-time; } | |
leaf updated { type yang:date-and-time; } | |
leaf enacted { type yang:date-and-time; } | |
leaf policed { type yang:date-and-time; } | |
leaf writable { type boolean; default true; } | |
leaf locked { type boolean; default false; } | |
leaf deleted { type boolean; default false; } | |
leaf dirty { | |
config false; | |
type boolean; | |
default false; | |
} | |
container sync { | |
anydata register { | |
description "scratchpad used by the Observer"; | |
} | |
leaf progress { | |
type enumeration { | |
enum provisioning { | |
value 0; | |
description "Provisioning in progress"; | |
} | |
} | |
} | |
leaf disabled { type boolean; default false; } | |
leaf enforced { type boolean; default true; } | |
list policy { | |
// TODO: how are policy defined/enforced? | |
} | |
} | |
action diff { | |
when "../dirty == true"; | |
description "retrieve diff of model state if dirty"; | |
} | |
action save { | |
description "trigger save into data store via synchronizer"; | |
} | |
} | |
grouping xos-base { | |
leaf id { | |
type unique-identifier; | |
mandatory true; | |
} | |
leaf kind { | |
type identityref { | |
base kind; | |
} | |
default generic; | |
} | |
leaf name { | |
type string { | |
length 0..255; | |
} | |
} | |
list attribute { | |
uses xos-attribute; | |
key name; | |
status deprecated; | |
reference "XOS: service-specific-attribute"; | |
description "backwards-compatible attribute association"; | |
} | |
leaf service-specific-id { | |
type unique-identifier; | |
mandatory true; | |
status deprecated; | |
} | |
container record { | |
if-feature synchronizer; | |
uses xos-sync-record; | |
} | |
} | |
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; | |
// not exactly clear how this is populated | |
} | |
} | |
grouping subscriber { | |
uses tenant-root { | |
refine kind { default subscriber; } | |
} | |
// 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 links { | |
leaf view { type inet:uri; } | |
leaf icon { type inet:uri; } | |
} | |
list keypair { | |
description "collection of public/private key pair(s)"; | |
// should be a specific typedef for storing this content | |
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 { | |
description | |
"The primary configuration interaction endpoint"; | |
container service { | |
description | |
"placeholder endpoint for services to augment"; | |
} | |
container tenant { | |
description | |
"placeholder endpoint for tenants to augment"; | |
} | |
} | |
} |