Abstract
The Cisco Virtual Topology System (VTS) 1.5 Developer Guide gives information on VTS APIs and development features.
The Virtual Topology System (VTS) provides L2 and L3 connectivity to tenant, router, and service VMs. The main components of the VTS are the Virtual Topology Controller (VTC) and the XRVR.
Cisco Virtual Topology System 1.5 Developer Guide
© 1999–2015 Cisco Systems, Inc. All rights reserved.
2.1.1 Virtual Topology Controller (VTC)
3 Preparing to Use the VTS 1.5 API
3.2 Installing the VTS 1.5 API
4.2.1 Payload to add N9K device
5 Debugging and troubleshooting
The VTS 1.5 API is exposed north-bound by the VTC component. The API is used to:
· Provision VTC with the Inventory of the DC topology
· Provision VTC with the Hardware VTEP Info
· Provision VTC with the information about the networks that will be serviced by the associated tenants
· Provision VTC with the information about sub-networks
· Provision VTC with the information about VMs attached to the networks
· Provision VTC with the information of L3 router and its interfaces that will be used for L3 connectivity between the tenant VMs
VTC is the topology controller for the VTS; VTC controls all the hardware VTEPs to provide intra DC connectivity between VMs belonging to the same tenant zone in the DC and inter DC/WAN connectivity to remote networks belonging to the same tenant. VTC learns about remote networks by peering using BGP and other routing protocols to remote peers and route reflectors.
The VTC VM will have one VNIC interface which has VIP address:
- One for control, used in the NB API to program VTC.
The VTC northbound API is a REST API over HTTPS. A VM managing entity is assumed to create VMs and call the VTC APIs to provide the required information for the creation of the virtual networks.
For security reasons the API implements certificate-based validation both on client side (the Managing Entity) and server side (VTC). The user is responsible for creating and uploading the server-side certificate in VTC, as well as creating and using the certificate on the client side. Instructions for the upload of certificate are specified in section 4.4.
The VTC NB API is used to provision the VTC with all hardware VTEPS that it controls, as well the networks, subnets and VMs that will be deployed on the compute servers.
In order to exercise the API you should be able to issue https requests to VTC. This can be done by a binary or script. This document provides client-side examples using the curl command.
The VTS 1.5 API uses server-side certificate for security. The VTS 1.5 comes with default server-side certificate. The user is responsible for creating and replacing such certificates if needed.
· Key-file: Specifies which file that contains the private key for the certificate
Copy the key file to /etc/ncs/ssl/cert/host.key
· Cert-file: Specifies which file that contains the server certificate.
Copy the cert file to /etc/ncs/ssl/cert/host.cert
· restart the VTS server process:
sudo service ncs restart
Retrieving a Resource
GET is used to retrieve a representation of a known resource.
The XML representation has the list of container name as the XML document root.
Request query parameters
"deep" : retrieve a resource with all subresources incline
"shallow" : retrieve a resource with no subresources incline
"offset"/"limit" : used to specify a limited set of list entries to retrieve
"select" : used to select which nodes and subresources in a resource to retrieve
Replace a resource
PUT is used to completely replace a known resource.
Update some properties of a resource
PATCH RFC 5789 is used to edit a known resource. PATCH cannot be used to change keys of a resource.
Create a Resource
POST to the parent resource to create a new resource.
DELETE a Resource
DELETE is used to remove a known resource. DELETE can be used to remove the entire resource or part of it.
The following APIs are used to create or retrieve the authentication groups for which the username and password that will be used to access the devices are stored.
GET
https://host:8888/api/running/devices/authgroup - to get list of authgroups.
PATCH
https://host:8888/api/running/devices/authgroup/ - to incrementally add the authgroup.
<authgroups>
<group>
<name>default_device</name>
<umap>
<local-‐user>admin</local-‐user><!-‐-‐Username used for NCS API authentication-‐-‐>
<remote-‐name>admin</remote-‐name><!-‐-‐Username for Device authentication-‐-‐>
<remote-‐password>admin</remote-‐password><!-‐-‐Password on Device for user account supplied-‐-‐>
<remote-‐secondary-‐password>admin</remote-‐secondary-‐password><!-‐-‐used for enable password-‐-‐>
</umap>
</group>
</authgroups>
The following APIs are used to do CRUD operation of the device.
GET
https://host:8888/api/running/devices/device - to get list of devices
PUT
https://host:8888/api/running/devices/device/{device-name} - to add device to VTS or replace a device
PATCH
https://host:8888/api/running/devices/device/ - to incrementally add the device ( Existing device will not be modified)
<device>
<name>n9k1</name>
<address>1.1.1.1</address>
<authgroup>N9k-authgroup1</authgroup>
<device-type>
<cli>
<ned-id>cisco-nx</ned-id>
<protocol>ssh</protocol>
</cli>
</device-type>
<ned-settings>
<cisco-nx-connection>
<method>nxapi</method>
</cisco-nx-connection>
</ned-settings>
<state>
<admin-state>unlocked</admin-state>
<admin-state-description>changed to xyz</admin-state-description>
</state>
<device-info>
<device-use>LEAF</device-use>
<bgp-peering>
<bgp-asn>100</bgp-asn>
<loopback-if-num>1</loopback-if-num>
<loopback-if-ip>10.10.10.0/24</loopback-if-ip>
</bgp-peering>
</device-info>
</device>
The following APIs are used to upload / retrieve the inventory of the topology.
GET
https://host:8888/api/running/deviceport-server- to get list of device and the connected servers information on each device
PUT
https://host:8888/api/running/deviceport-server/{device-name} - to add deviceport-server info to NCS or replace a deviceport-server info for this device
PATCH
https://host:8888/api/running/deviceport-server - to incrementally add the deviceport-server info ( Existing device will not be modified)
<deviceport-server>
<name>tb2-tor1</name>
<port>
<portname>Ethernet1/1</portname>
<connection-type>server</connection-type>
<server>
<server-id>vts-tb2-server1.cisco.com</server-id>
<type>baremetal</type>
<mac>11:22:33:44:66:77</mac>
<interface-name>eth3</interface-name>
<ip>172.20.100.20</ip>
</server>
</port>
<port>
<portname>Ethernet1/2</portname>
<connection-type>server</connection-type>
<server>
<server-id>vts-tb2-server2.cisco.com</server-id>
<type>baremetal</type>
<mac>11:22:33:44:66:78</mac>
<interface-name>eth3</interface-name>
<ip>172.20.100.21</ip>
</server>
</port>
</deviceport-server>
The following APIs are used to do CRUD operation of the network.
GET
https://host:8888/api/running/ vts_network_cfs_policy/network - to get list of networks
PUT
https://host:8888/api/running/ vts_network_cfs_policy/network/{networkId} - to add network info to NCS or replace a network for this network ID.
PATCH
https://host:8888/api/running/ vts_network_cfs_policy/network - to incrementally add the network info (Existing network will not be modified)
<network>
<id>f5aae6e6-f814-4a98-b01b-00dff2c01a3c</id>
<admin-state-up>true</admin-state-up>
<name>net1</name>
<provider-physical-network>physnet1</provider-physical-network>
<provider-segmentation-id>5</provider-segmentation-id>
<provider-network-type>vlan</provider-network-type>
<router-external>false</router-external>
<shared>false</shared>
<status>ACTIVE</status>
<tenant-id>tenant1</tenant-id>
<tenant-name>tenant1</tenant-name>
</network>
The following APIs are used to do CRUD operation of the network.
GET
https://host:8888/api/running/ vts_subnet_cfs_policy/subnet - to get list of subnets
PUT
https://host:8888/api/running/ vts_subnet_cfs_policy/subnet/{subnetId} - to add subnet info to NCS or replace a subnet for this subnetID
PATCH
https://host:8888/api/running/ vts_subnet_cfs_policy/subnet - to incrementally add the subnet info (Existing subnet will not be modified)
<subnet>
<id>e04d49bf-f05e-4ad5-875c-f05de1a46e6d</id>
<allocation-pools>
<start>100.100.100.2</start>
<end>100.100.100.254</end>
</allocation-pools>
<name>sub1</name>
<cidr>100.100.100.0/24</cidr>
<enable-dhcp>true</enable-dhcp>
<gateway-ip>100.100.100.1</gateway-ip>
<ip-version>4</ip-version>
<network-id>f5aae6e6-f814-4a98-b01b-00dff2c01a3c</network-id>
<shared>false</shared>
<tenant-id>tenant1</tenant-id>
<tenant-name>tenant1</tenant-name>
</subnet>
The following APIs are used to do CRUD operation of the VM Port.
GET
https://host:8888/api/running/ vts_port_cfs_policy/port - to get list of ports
PUT
https://host:8888/api/running/ vts_port_cfs_policy/port/{portId} - to add port info to NCS or replace a port for this port ID
PATCH
https://host:8888/api/running/ vts_port_cfs_policy/port - to incrementally add the port info (Existing port will not be modified)
<port>
<id>fef42c35-b4a9-4e94-a874-7772711d24e9</id>
<name></name>
<network-id>49267f5f-6817-4108-aac3-4d3d5ee03ace</network-id>
<admin-state-up>true</admin-state-up>
<status>ACTIVE</status>
<mac-address>fa:16:3e:96:36:d1</mac-address>
<fixed-ips>
<ip-address>10.10.1.11</ip-address>
<subnet-id>89210263-349e-4a2d-b251-277ce24e9d8e</subnet-id>
</fixed-ips>
<device-id>f7b737d6-e56f-4612-a2a2-59404c743351</device-id>
<device-owner>compute:nova</device-owner>
<tenant-id>admin</tenant-id>
<tenant-name>admin</tenant-name>
<binding-vif-type>ovs</binding-vif-type>
<binding-vif-details>
<port-filter>true</port-filter>
<ovs-hybrid-plug>true</ovs-hybrid-plug>
</binding-vif-details>
<binding-vnic-type>normal</binding-vnic-type>
<binding-host-id>vts-tb2-server4.cisco.com</binding-host-id>
<security-groups>
<id>24175db7-8fa9-4696-a6e5-a37537df486b</id>
<name>default</name>
<tenant-id>378f3370b583456082206c0875de64c3</tenant-id>
<binding-vif-type>ovs</binding-vif-type>
<binding-vif-details>
<port-filter>true</port-filter>
<ovs-hybrid-plug>true</ovs-hybrid-plug>
</binding-vif-details>
<binding-vnic-type>normal</binding-vnic-type>
<binding-host-id>vts-tb2-server4.cisco.com</binding-host-id>
<security-groups>
<id>24175db7-8fa9-4696-a6e5-a37537df486b</id>
<name>default</name>
<tenant-id>378f3370b583456082206c0875de64c3</tenant-id>
<description>default</description>
<security-group-rules>
<id>53751ee0-691f-407b-b966-30f239cae4c8</id>
<direction>egress</direction>
<ethertype>IPv4</ethertype>
<tenant-id>378f3370b583456082206c0875de64c3</tenant-id>
<security-group-id>24175db7-8fa9-4696-a6e5-a37537df486b</security-group-id>
</security-group-rules>
</security-groups>
</port>
The following APIs are used to do CRUD operation of the router.
GET
https://host:8888/api/running/l3/router - to get list of routers
PUT
https://host:8888/api/running/l3/router/{routerId} - to add router info to NCS or replace a router for this routerId
PATCH
https://host:8888/api/running/l3/router - to incrementally add the router info (Existing router will not be modified)
<router>
<id>5830b211-51af-4f18-8b14-e02995480434</id>
<name>router1 </name>
<status>ACTIVE</status>
<tenant-id>tenant1</tenant-id>
</router>
The following APIs are used to do CRUD operation of the router interfaces.
GET
https://host:8888/api/running/l3/interfaces - to get list of interfaces for a given router ID
PUT
https://host:8888/api/running/l3/interfaces/{interfaceId} - to add interfaces to router or replace a interface for this router ID
PATCH
https://host:8888/api/running/l3/interfaces - to incrementally add the interfaces info (Existing interfaces will not be modified)
<interfaces>
<subnet-id>789e9efd-be80-402d-9461-d9a5e2fa9210</subnet-id>
<router-id>5830b211-51af-4f18-8b14-e02995480434</router-id>
<ip-address>10.10.2.1</ip-address>
</interfaces>
There are 3 VTS specific services on VTC :
1) ncs:. The controller and handles NB API etc.
2) tomcat7: Handles the user interface
3) vtsWebServer: Handles Auto Discovery API and Openstack Plugin installation etc.
These services are managed via the Linux service commands, e.g. “service <service-name> status” to query a service.
The VTC logs are collected in the /var/log/ncs directory
This appendix explains the YANG model for the VTS REST API.
module cisco-vts {
namespace "http://cisco.com/ns/yang/vts";
prefix vts;
include cisco-vts-common {
revision-date 2015-02-28;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
}
submodule cisco-vts-common {
belongs-to cisco-vts {
prefix vts;
}
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
import tailf-common {
prefix tailf;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
/*
* Typedefs
*/
typedef uuid {
type string {
length "32|36";
}
}
typedef string128 {
type string {
length "0..128";
}
}
typedef string15 {
type string {
length "0..15";
}
}
typedef vlan-id {
type uint32 {
range "2..4094";
}
}
typedef vni {
type uint32 {
range "4096..16777215";
}
}
/*
* Identities
*/
identity network-type {
description "Based identity from which network types are " +
"derived.";
}
identity vlan {
base "network-type";
description "Vlan network.";
tailf:info "Vlan network.";
}
identity trunk {
base "network-type";
description "Trunk network.";
tailf:info "Trunk network.";
}
identity gre {
base "network-type";
description "GRE network.";
tailf:info "GRE network.";
}
identity vxlan {
base "network-type";
description "VXLAN network.";
tailf:info "VXLAN network.";
}
identity entity-status {
description "Based identity from which network status are " +
"derived.";
}
// TODO: move to lower case
identity ACTIVE {
base "entity-status";
description "Entity is active.";
tailf:info "Entity is active.";
}
// TODO: move to lower case
identity DOWN {
base "entity-status";
description "Entity is down.";
tailf:info "Entity is down.";
}
// TODO: move to lower case
identity BUILD {
base "entity-status";
description "Entity is being built.";
tailf:info "Entity is being built.";
}
identity binding-type {
description "Based identity from which port binding types " +
"are derived.";
}
identity ovs {
base "binding-type";
description "Ovs port binding type.";
tailf:info "Ovs port binding type.";
}
identity unbound {
base "binding-type";
description "No binding provided.";
tailf:info "No binding provided.";
}
// TODO: Consider semantics of a "failed" type. Mind we have port-status.
// move to "-" vs "_"
identity binding_failed {
base "binding-type";
description "Port binding failed.";
tailf:info "Port binding failed.";
}
identity switch-platform {
description "Based identity from which switch platform types " +
"are derived.";
}
identity N3K {
base "switch-platform";
description "Cisco N3K.";
tailf:info "Cisco N3K.";
}
identity N6K {
base "switch-platform";
description "Cisco N6K.";
tailf:info "Cisco N6K.";
}
identity N7K {
base "switch-platform";
description "Cisco N7K.";
tailf:info "Cisco N7K.";
}
identity N9K {
base "switch-platform";
description "Cisco N9K.";
tailf:info "Cisco N9K.";
}
identity ASR9K {
base "switch-platform";
description "Cisco ASR9K.";
tailf:info "Cisco ASR9K.";
}
identity switch-role {
description "Based identity from which switch role types " +
"are derived.";
}
// TODO: move following identities to lower case
identity LEAF {
base "switch-role";
description "The device is acting as a leaf.";
tailf:info "Leaf.";
}
identity SPINE {
base "switch-role";
description "The device is acting as a spine.";
tailf:info "Spine.";
}
identity BORDER-LEAF {
base "switch-role";
description "The device is acting as a border-leaf.";
tailf:info "Border-eaf.";
}
identity DCI {
base "switch-role";
description "The device is acting as a DCI.";
tailf:info "DCI.";
}
identity BGP-RR {
base "switch-role";
description "The device is acting as a BGP RR.";
tailf:info "BGP-RR.";
}
identity network-layer {
description "Based identity from which network layers are " +
"derived.";
}
identity L2 {
base "network-layer";
description "L2.";
tailf:info "L2.";
}
identity L3 {
base "network-layer";
description "L3.";
tailf:info "L3.";
}
identity L2-mode {
description "Based identity from which L2 modes are " +
"derived.";
}
identity L2-access {
base "L2-mode";
description "Access mode.";
tailf:info "Access.";
}
identity L2-trunk {
base "L2-mode";
description "Trunk mode.";
tailf:info "Trunk.";
}
identity server-type {
description "Based identity from which server types are " +
"derived.";
}
identity baremetal {
base "server-type";
description "Baremetal server.";
tailf:info "Baremetal.";
}
identity virtual-server {
base "server-type";
description "Virtual server.";
tailf:info "Virtual server.";
}
identity peer-type {
description "Based identity from which connection peer types " +
"are derived.";
}
identity server {
base "peer-type";
description "Server.";
tailf:info "Server.";
}
identity fabric {
base "peer-type";
description "Fabric node.";
tailf:info "Fabric node.";
}
identity port-channel-type {
description "Based identity from which port channel types " +
"are derived.";
}
identity vPC {
base "port-channel-type";
description "Virtual port channel type.";
tailf:info "Virtual port channel.";
}
identity none {
// TODO: reconsider the need for this
base "port-channel-type";
description "None.";
tailf:info "None.";
}
grouping common-network {
description "Set of common data nodes for virtual networks.";
leaf admin-state-up {
description "The network administrative state is UP.";
tailf:info "Administrative state up.";
type boolean;
default "true";
}
leaf name {
description "Network name.";
tailf:info "Name.";
type vts:string128;
}
leaf provider-physical-network {
description "Physical network.";
tailf:info "Physical network.";
type vts:string128;
}
leaf provider-segmentation-id {
description "Segmentation identifier.";
tailf:info "Segmentation ID.";
type vts:string128;
}
leaf provider-network-type {
description "Network type.";
tailf:info "Network type.";
type identityref {
base "vts:network-type";
}
}
leaf router-external {
description "External network.";
tailf:info "External network.";
type boolean;
default "false";
}
leaf shared {
description "Shared network.";
tailf:info "Shared.";
type boolean;
default "false";
}
leaf status {
description "Network status.";
tailf:info "Status.";
type identityref {
base "vts:entity-status";
}
mandatory true;
}
}
grouping common-subnetwork {
description "Set of common data nodes for virtual subnetworks.";
list allocation-pools {
description "List of allocation pools.";
tailf:info "Allocation pool.";
key start;
// TODO: add "must" constraint so that pools do not overlap
leaf start {
description "Allocation pool's first IP address.";
tailf:info "Pool's first IP address.";
type inet:ip-address;
}
leaf end {
description "Allocation pool's last IP address.";
tailf:info "Pool's last IP address.";
type inet:ip-address;
must "../start <= ../end" {
error-message "The end of the allocation pool " +
"must cannot be less than or " +
"equal to the start";
tailf:dependency "../start";
}
}
}
leaf name {
description "Subnetwork name.";
tailf:info "Name.";
type vts:string128;
}
leaf cidr {
description "Subnetwork address.";
tailf:info "Subnetwork address.";
type tailf:ipv4-address-and-prefix-length;
mandatory true;
}
leaf-list dns-nameservers {
description "List of DNS name servers.";
tailf:info "DNS name server.";
type inet:ip-address;
}
leaf enable-dhcp {
description "Enable DHCP.";
tailf:info "Enable DHCP.";
type boolean;
default "true";
}
leaf gateway-ip {
description "Gateway IP address.";
tailf:info "Gateway IP address.";
type inet:ip-address;
mandatory true;
}
list host-routes {
description "List of host routes.";
tailf:info "Host route.";
key destination;
leaf destination {
description "Route's destination.";
tailf:info "Destination.";
type tailf:ipv4-address-and-prefix-length;
}
leaf nexthop {
description "Route's nexthop gateway.";
tailf:info "Nexthop gateway.";
type inet:ip-address;
}
}
leaf ip-version {
description "IP version.";
tailf:info "IP version.";
type enumeration {
enum 4;
enum 6;
}
default 4;
}
leaf shared {
description "Shared subnetwork.";
tailf:info "Shared.";
type boolean;
default "false";
}
}
grouping common-port {
description "Set of common data nodes for virtual ports.";
leaf name {
description "Port name.";
tailf:info "Name.";
type vts:string128;
}
leaf admin-state-up {
description "The network administrative state is UP.";
tailf:info "Administrative state up.";
type boolean;
default "true";
}
leaf status {
description "Port status.";
tailf:info "Status.";
type identityref {
base "vts:entity-status";
}
mandatory true;
}
leaf mac-address {
description "Port MAC address.";
tailf:info "MAC address.";
type yang:mac-address;
}
leaf device-id {
description "Device Identifier.";
tailf:info "Device Identifier.";
type vts:string128;
}
leaf device-owner {
description "Device owner.";
tailf:info "Device owner.";
type vts:string128;
}
leaf binding-vif-type {
description "Binding VIF type.";
tailf:info "Binding VIF type.";
type identityref {
base "vts:binding-type";
}
default vts:ovs;
}
leaf binding-host-id {
description "Host identifier";
tailf:info "Host identifier";
type vts:string128;
}
// NOTE: security-groups subtree may move in the future.
// It is an "extra" in our driver that is not part of
// the ML2 driver API. If ML2 adds official support we
// likely move this tree to match.
list security-groups {
description "List of security groups.";
tailf:info "Security group.";
key id;
leaf id {
description "Security group identifier.";
tailf:info "Identifier.";
type vts:uuid;
}
leaf name {
description "Security group name.";
tailf:info "Name.";
type vts:string128;
}
leaf tenant-id {
//TODO: do we need this? the leafref to the network may suffice
description "Tenant identifier. The value of the field should be the name of the tenant. This is Mandatory";
tailf:info "Tenant ID.";
type vts:string128;
mandatory true;
// TODO: consider moving to leafref
//type leafref {
// path "/tenant:tenant/tenant:tenant-info/" +
// "tenant:vmm-tenant-id";
//}
}
leaf tenant-name {
// TODO: do we need to name too? The tenant-id may suffice
description "Tenant name.";
tailf:info "Tenant name.";
type vts:string128;
}
leaf description {
description "Security group description.";
tailf:info "Description.";
type vts:string128;
}
list security-group-rules {
description "List of security group rules.";
tailf:info "Security group rule.";
key id;
leaf id {
description "Security group rules identifier.";
tailf:info "ID.";
type vts:uuid;
}
leaf remote-group-id {
description "Remote group identifier.";
tailf:info "Remote group ID.";
type vts:string128;
}
leaf direction {
description "Direction.";
tailf:info "Direction.";
type vts:string128;
// TODO: reconsider as an identity
}
leaf remote-ip-prefix {
description "Remote IP address prefix.";
tailf:info "Remote IP address prefix.";
type inet:ip-prefix;
}
leaf protocol {
description "Protocol.";
tailf:info "Protocol.";
type vts:string128;
// TODO: reconsider as an identity
}
leaf ethertype {
description "Ethertype.";
tailf:info "Ethertype.";
type vts:string128;
// TODO: reconsider as an identity
}
leaf port-range-max {
description "Upper bound of the port range.";
tailf:info "Port range (maximum).";
type uint32;
}
leaf port-range-min {
description "Lower bound of the port range.";
tailf:info "Port range (minimum).";
type uint32;
must "../port-range-min <= ../port-range-max" {
error-message "The minimum in the port range cannot be " +
"greater than the maximum";
tailf:dependency "../port-range-max";
}
}
leaf security-group-id {
description "Security group indentifier.";
tailf:info "Security group ID.";
// TODO: reconsider a maximum lenght for this leaf.
type string;
}
}
}
}
grouping common-physical-port {
description "Set of common data nodes for physical ports.";
leaf portname {
description "Port name.";
tailf:info "Name.";
type vts:string128;
}
leaf local-mac {
description "Mac address of the port.";
tailf:info "Mac address.";
type yang:mac-address;
}
leaf connection-type {
description "The type of the connection. That is, to " +
"what type of device this port is connected " +
"to.";
tailf:info "Type of device this port is connected to.";
type identityref {
base "vts:peer-type";
}
}
leaf port-mode {
description "Mode of the port.";
tailf:info "Port mode.";
type identityref {
base "vts:network-layer";
}
}
leaf L3-mode {
// TODO: semantics of an enumeration w/ one enum
// TODO typo in the enum
tailf:info "L3 mode of port - ipaddress";
type enumeration {enum ipaddess;}
}
}
grouping vni-range-grouping {
description "The grouping defines a vni range.";
leaf start {
description "Range start value.";
tailf:info "Start.";
type vni;
}
leaf end {
description "Range end value.";
tailf:info "End.";
type vni;
must "../end >= ../start" {
error-message "The (vni) range start value must be less " +
"than or equal to the range end value";
tailf:dependency "../start";
}
}
}
grouping vlan-range-grouping {
description "The grouping defines a vlan range.";
leaf start {
description "Range start value.";
tailf:info "Start.";
type vlan-id;
}
leaf end {
description "Range end value.";
tailf:info "End.";
type vlan-id;
must "../end >= ../start" {
error-message "The (vlan) range start value must be less " +
"than or equal to the range end value";
tailf:dependency "../start";
}
}
}
grouping pool-allocations-grouping {
description "List of allocations from the pool.";
list allocation {
description "List of pool allocations.";
tailf:info "Pool allocation.";
tailf:cli-suppress-mode;
key "id";
leaf id {
description "Pool allocation identifier.";
tailf:info "ID.";
type uint32;
}
list owner {
description "List of owners of the pool allocation.";
tailf:info "Owner of the pool allocation.";
key owner_name;
leaf owner_name {
description "Name of the owner of the pool allocation.";
tailf:info "Name.";
type vts:string128;
}
}
}
}
grouping mcast-addr-with-mask-grouping {
description "The grouping defines a multicast IP address with " +
"mask.";
leaf address {
description "Multicast IP address.";
tailf:info "IP address.";
type string {
pattern '(((22[5-9]|23[0-9])\.)' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}' +
'([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' +
'|' +
'(224\.)' +
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.)' +
'(([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.)' +
'([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))';
}
}
leaf cidrmask {
description "CIDR mask.";
tailf:info "CIDR mask.";
type uint16 {
range "4..32";
}
}
}
}
module n9k-extension {
namespace "http://cisco.com/ns/yang/services/n9k-extension";
prefix n9k-extension;
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the management
of the Cisco N9K devices.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
augment "/ncs:devices/ncs:device" {
when "ncs:device-type/ncs:cli/ncs:ned-id='cisco-nx-id:cisco-nx'";
container device-info {
presence "Creates device info";
// TODO: remove. This is a copy of another leaf in the same container w/ the same name
leaf name {
tailf:info "Device name ( Switch )";
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
leaf platform {
// TODO: reconsider having a leaf saying this is a N9K on a N9k-specific extension
// consider we may different subtypes of N9K platforms
description "Device platform.";
tailf:info "Platform.";
type identityref {
base "vts:switch-platform";
}
default vts:N9K;
}
leaf OS {
description "Operating System.";
tailf:info "Operating System.";
type vts:string128;
}
leaf version {
description "Operating System version.";
tailf:info "Operating System version.";
type string;
}
leaf device-use {
description "Role of the switch. How it is being used.";
tailf:info "Usage (role) of the switch.";
type identityref {
base "vts:switch-role";
}
}
leaf group-id {
tailf:info "Group id";
type string;
}
leaf peering-mode {
tailf:info "Mode in which DC-GW operates";
type enumeration { enum VRF-PEERING; enum INTEGRATED; }
}
leaf vrf-capacity {
tailf:info "Vrf Capacity of the device";
default 510;
type uint32;
}
container bgp-peering-info {
description "BGP peering information.";
tailf:info "BGP peering information.";
leaf bgp-asn {
description "BGP ASN number.";
tailf:info "BGP ASN number.";
type uint16;
}
leaf loopback-if-num {
description "BGP loopback interface number.";
tailf:info "BGP loopback interface number.";
type uint16;
}
leaf loopback-if-ip {
description "BGP loopback interface IP address.";
tailf:info "A.B.C.D/LEN;;IP prefix and network mask " +
"length in format x.x.x.x/m";
type inet:ip-prefix;
}
}
list port {
description "List of switch ports.";
tailf:info "Switch port.";
key portname;
uses vts:common-physical-port;
leaf L2-mode {
description "Port's L2 mode of operation.";
tailf:info "L2 mode of port.";
type identityref {
base "vts:L2-mode";
}
when "../port-mode = L2" {
tailf:dependency "../port-mode";
}
}
leaf port-channel-membership {
// TODO: remove
description "Port channel membership.";
tailf:info "Port channel membership.";
type vts:string128;
// TODO: consider semantics of this default
default "none";
}
leaf remote-interface-name {
description "Interface name of the remote node connected " +
"to the port.";
tailf:info "Interface name of the remote node connected " +
"to the port.";
type vts:string128;
}
leaf remote-mac {
description "MAC address of the remote node connected " +
" to the port.";
tailf:info "Remote MAC address.";
type yang:mac-address;
}
leaf remote-type {
description "Type of the remote server connected " +
"to the port.";
tailf:info "Type of the remote server connected " +
"to the port.";
type identityref {
base "vts:server-type";
}
}
leaf remote-server-id {
description "Identifier of the remote server connected " +
"to the port.";
tailf:info "ID of the remote server connected " +
"to the port.";
type vts:string128;
}
} //port
container vpc {
leaf vpc-id {
tailf:info ";;<1-1000> Domain id.";
type uint16 {
range "1..1000";
}
}
container vpc-peer {
leaf vpc-peer-ip {
tailf:info "Specify destination ip address of peer switch.";
type inet:ipv4-address;
}
leaf vpc-peer-name {
tailf:info "Specify peer switch name.";
type vts:string128;
}
}
leaf vpc-peer-link {
description "Peer link of the virtual port channel.";
tailf:info "<1-4096>;;Port Channel number.";
type uint16 {
range "1..4096";
}
}
} // container vpc
list port-channel {
description "List of port channel the switch belongs to.";
tailf:info "Port channel.";
key name;
leaf name {
description "Port channel name.";
tailf:info "<1-4096>;;Port Channel number.";
// TODO: reconsider this into an integer
type uint16 {
range "1..4096";
}
}
leaf-list ports {
description "Set of ports belonging to the port channel.";
tailf:info "Port inthe port channel.";
type vts:string128;
}
leaf type {
description "Type of port channel.";
tailf:info "Type.";
type identityref {
base "vts:port-channel-type";
}
}
} //port-channel-list
container servers {
description "Servers connected to the switch.";
tailf:info "Servers.";
list server {
description "List of servers connected to the switch.";
tailf:info "Server.";
key server-id;
leaf server-id {
description "Server identifier.";
tailf:info "ID.";
type vts:string128;
}
list nic {
description "List of network controller interfaces on " +
"the server.";
tailf:info "NIC.";
key id;
leaf id {
description "Identifier of the network controller " +
"interface";
tailf:info "ID.";
type vts:string128;
}
leaf mac {
// TODO: note how the same data is in multiple places
description "MAC address of the network controller " +
"interface";
tailf:info "MAC.";
type leafref {
path "../../../../port/remote-mac" ;
}
}
leaf ip {
description "IP address of the network controller " +
"interface";
tailf:info "IP.";
type inet:ip-address;
}
leaf remote-mac {
// TODO: note how the same data is in multiple places
description "MAC address of the switch port the " +
"server NIC is connected to";
tailf:info "Switch port MAC.";
type leafref {
path "../../../../port/local-mac" ;
}
}
} //nic
} //server
} //servers
} //device-info
} //augment
} //module
module asr9k-extension {
namespace "http://cisco.com/ns/yang/services/asr9k-extension";
prefix asr9k-extension;
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the management
of the Cisco ASR9K devices.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
augment "/ncs:devices/ncs:device" {
when "ncs:device-type/ncs:cli/ncs:ned-id='cisco-ios-xr-id:cisco-ios-xr'";
container device-info {
presence "Creates device info";
// TODO: remove. This is a copy of another leaf in the same container w/ the same name
leaf name {
tailf:info "Device name ( Switch )";
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
leaf platform {
// TODO: reconsider having a leaf saying this is a ASR9K on a ASR9k-specific extension
// consider we may different subtypes of ASR9K platforms
description "Device platform.";
tailf:info "Platform.";
type identityref {
base "vts:switch-platform";
}
default vts:ASR9K;
}
leaf OS {
description "Operating System.";
tailf:info "Operating System.";
type vts:string128;
}
leaf version {
description "Operating System version.";
tailf:info "Operating System version.";
type string;
}
leaf device-use {
description "Role of the switch. How it is being used.";
tailf:info "Usage (role) of the switch.";
type identityref {
base "vts:switch-role";
}
}
leaf group-id {
tailf:info "Group id";
type string;
}
leaf peering-mode {
tailf:info "Mode in which DC-GW operates";
type enumeration { enum VRF-PEERING; enum INTEGRATED; }
}
leaf vrf-capacity {
tailf:info "Vrf Capacity of the device";
default 510;
type uint32;
}
container bgp-peering-info {
description "BGP peering information.";
tailf:info "BGP peering information.";
leaf bgp-asn {
description "BGP ASN number.";
tailf:info "BGP ASN number.";
type uint16;
}
leaf loopback-if-num {
description "BGP loopback interface number.";
tailf:info "BGP loopback interface number.";
type uint16;
}
leaf loopback-if-ip {
description "BGP loopback interface IP address.";
tailf:info "A.B.C.D/LEN;;IP prefix and network mask " +
"length in format x.x.x.x/m";
type inet:ip-prefix;
}
}
list port {
description "List of switch ports.";
tailf:info "Switch port.";
key portname;
uses vts:common-physical-port;
leaf L2-mode {
description "Port's L2 mode of operation.";
tailf:info "L2 mode of port.";
type identityref {
base "vts:L2-mode";
}
when "../port-mode = L2" {
tailf:dependency "../port-mode";
}
}
leaf port-channel-membership {
// TODO: remove
description "Port channel membership.";
tailf:info "Port channel membership.";
type vts:string128;
// TODO: consider semantics of this default
default "none";
}
leaf remote-interface-name {
description "Interface name of the remote node connected " +
"to the port.";
tailf:info "Interface name of the remote node connected " +
"to the port.";
type vts:string128;
}
leaf remote-mac {
description "MAC address of the remote node connected " +
" to the port.";
tailf:info "Remote MAC address.";
type yang:mac-address;
}
leaf remote-type {
description "Type of the remote server connected " +
"to the port.";
tailf:info "Type of the remote server connected " +
"to the port.";
type identityref {
base "vts:server-type";
}
}
leaf remote-server-id {
description "Identifier of the remote server connected " +
"to the port.";
tailf:info "ID of the remote server connected " +
"to the port.";
type vts:string128;
}
} //port
container vpc {
leaf vpc-id {
tailf:info ";;<1-1000> Domain id.";
type uint16 {
range "1..1000";
}
}
container vpc-peer {
leaf vpc-peer-ip {
tailf:info "Specify destination ip address of peer switch.";
type inet:ipv4-address;
}
leaf vpc-peer-name {
tailf:info "Specify peer switch name.";
type vts:string128;
}
}
leaf vpc-peer-link {
description "Peer link of the virtual port channel.";
tailf:info "<1-4096>;;Port Channel number.";
type uint16 {
range "1..4096";
}
}
} // container vpc
list port-channel {
description "List of port channel the switch belongs to.";
tailf:info "Port channel.";
key name;
leaf name {
description "Port channel name.";
tailf:info "<1-4096>;;Port Channel number.";
// TODO: reconsider this into an integer
type uint16 {
range "1..4096";
}
}
leaf-list ports {
description "Set of ports belonging to the port channel.";
tailf:info "Port inthe port channel.";
type vts:string128;
}
leaf type {
description "Type of port channel.";
tailf:info "Type.";
type identityref {
base "vts:port-channel-type";
}
}
} //port-channel-list
container servers {
description "Servers connected to the switch.";
tailf:info "Servers.";
list server {
description "List of servers connected to the switch.";
tailf:info "Server.";
key server-id;
leaf server-id {
description "Server identifier.";
tailf:info "ID.";
type vts:string128;
}
list nic {
description "List of network controller interfaces on " +
"the server.";
tailf:info "NIC.";
key id;
leaf id {
description "Identifier of the network controller " +
"interface";
tailf:info "ID.";
type vts:string128;
}
leaf mac {
// TODO: note how the same data is in multiple places
description "MAC address of the network controller " +
"interface";
tailf:info "MAC.";
type leafref {
path "../../../../port/remote-mac" ;
}
}
leaf ip {
description "IP address of the network controller " +
"interface";
tailf:info "IP.";
type inet:ip-address;
}
leaf remote-mac {
// TODO: note how the same data is in multiple places
description "MAC address of the switch port the " +
"server NIC is connected to";
tailf:info "Switch port MAC.";
type leafref {
path "../../../../port/local-mac" ;
}
}
} //nic
} //server
} //servers
} //device-info
} //augment
} //module
module cisco-vts-port-server {
namespace "http://cisco.com/yang/ns/vts/services/port-server";
prefix port-server;
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the inventory
of the physical topology.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
list deviceport-server {
description "List of switches with the servers connected " +
"to them.";
tailf:info "Device (Switch) Port - Server mapping.";
ncs:servicepoint portserver;
uses ncs:service-data;
key name;
leaf name {
description "The switch name.";
tailf:info "Device (Switch) name.";
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
list port {
description "List of physical ports on the switch.";
tailf:info "Device (switch) port.";
key portname;
uses vts:common-physical-port;
leaf L2-mode {
description "Port's L2 mode of operation.";
tailf:info "L2 mode of port.";
type identityref {
base "vts:L2-mode";
}
}
container server {
description "Server connected to the switch port.";
tailf:info "Server connected to the port.";
leaf server-id {
description "Server identifier.";
tailf:info "Server ID.";
type vts:string128;
mandatory true;
}
leaf type {
description "Type of server.";
tailf:info "Type of server.";
type identityref {
base "vts:server-type";
}
}
leaf mac {
description "Mac address of the server interface " +
"connected to this switch port.";
tailf:info "Mac address of the server interface " +
"connected to this switch port.";
type yang:mac-address;
}
leaf interface-name {
description "Name of the server interface connected " +
"to this switch port.";
tailf:info "Name of the server interface connected " +
"to this switch port.";
type vts:string128;
}
leaf ip {
description "IP address of the server interface " +
"connected to this switch port.";
tailf:info "IP address of the server interface " +
"connected to this switch port.";
type inet:ip-address;
}
leaf connid {
tailf:info "Unique ID for port server mapping";
type vts:uuid;
mandatory false;
}
}
}
}
}
module cisco-vts-network-cfs {
namespace "http://cisco.com/ns/yang/vts/services/network-cfs";
prefix vtsNetworkCFS;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
import cisco-vts-tenant {
prefix tenant;
}
import resource-allocator {
prefix ralloc;
}
import vni-allocator {
prefix vnialloc;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the
management of virtual networks.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
container vts_network_cfs_policy {
description "VTS Network CFS Policy Service.";
tailf:info "VTS Network CFS Policy Service.";
list network {
description "List of Networks.";
tailf:info "Network.";
ncs:servicepoint vts-network-servicepoint;
key id;
leaf id {
description "Network identifier.";
tailf:info "ID.";
type vts:uuid;
}
uses ncs:service-data;
leaf-list subnets {
description "Identifiers of the associated subnetworks.";
tailf:info "Identifier of an associated subnetwork.";
type vts:uuid;
}
uses vts:common-network;
leaf tenant-id {
description "Tenant identifier.";
tailf:info "Tenant ID. The value of the field should be the name of the tenant. This is Mandatory ";
type leafref {
path "/tenant:tenant/tenant:tenant-info/tenant:name";
}
mandatory true;
}
leaf tenant-name {
// TODO: do we need to name too? The tenant-id may suffice. Keeping it for the time being.
description "Tenant name.";
tailf:info "Tenant name.";
type vts:string128;
}
leaf vni_pool {
description "Vni pool name.";
tailf:info "Vni pool name.";
type vts:string128;
// TODO: consider using a leafref to the pool
default "vnipool";
}
leaf vni_number {
description "Vni number assigned to the network.";
tailf:info "Vni number assigned to the network.";
type vts:vni;
must "1 = count(/ralloc:resource-pools/ralloc:vni-pool/vnialloc:range[" +
"vnialloc:start <= current()/../vni_number " +
"and vnialloc:end >= current()/../vni_number])" {
error-message "Vni allocation requires the existence " +
"of an associated vni range";
tailf:dependency "/ralloc:resource-pools/ralloc:vni-pool/vnialloc:range";
}
}
leaf multicast_pool {
description "Multicast pool name.";
tailf:info "Multicast pool name.";
type vts:string128;
// TODO: consider using a leafref to the pool
default "multicastpool";
}
leaf multicast_address {
description "Multicast address assigned to the network.";
tailf:info "Multicast address assigned to the network.";
type inet:ipv4-address;
}
} // network
} // vts_network_cfs_policy
} // module
module cisco-vts-subnetwork-cfs {
namespace "http://cisco.com/ns/yang/vts/services/subnetwork-cfs";
prefix vtsSubnetCFS;
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
import cisco-vts-tenant {
prefix tenant;
}
import cisco-vts-network-cfs {
prefix vtsNetworkCFS;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the management of
virtual subnetworks.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
container vts_subnet_cfs_policy {
description "VTS Subnetwork CFS Policy Service.";
tailf:info "VTS Subnetwork CFS Policy Service.";
list subnet {
description "List of subnetworks. Each subnetwork is " +
"associated to one network.";
tailf:info "List of subnetworks. Each subnetwork is " +
"associated to one network.";
ncs:servicepoint vts-subnet-servicepoint;
key id;
leaf id {
description "Subnetwork identifier.";
tailf:info "ID.";
type vts:uuid;
}
uses ncs:service-data;
leaf network-id {
description "Identifier of the associated network.";
tailf:info "ID of the associated network.";
type leafref {
path "/vtsNetworkCFS:vts_network_cfs_policy" +
"/vtsNetworkCFS:network/vtsNetworkCFS:id";
}
mandatory true;
}
uses vts:common-subnetwork;
leaf tenant-id {
//TODO: do we need this? the leafref to the network may suffice. Keeping it for time being
description "Tenant identifier.";
tailf:info "Tenant identifier. The value of the field should be the name of the tenant. This is Mandatory ";
type leafref {
path "/tenant:tenant/tenant:tenant-info/tenant:name";
}
mandatory true;
}
leaf tenant-name {
// TODO: do we need to name too? The tenant-id may suffice. Keeping it for the time being
description "Tenant name.";
tailf:info "Tenant name.";
type vts:string128;
}
} // subnets
} // vts_subnet_cfs_policy
} // module
module cisco-vts-port-cfs {
namespace "http://cisco.com/ns/yang/vts/services/port-cfs";
prefix vtsPortCFS;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
import cisco-vts-tenant {
prefix tenant;
}
import cisco-vts-network-cfs {
prefix vtsNetworkCFS;
}
import cisco-vts-port-server {
prefix psMap;
}
import resource-allocator {
prefix ralloc;
}
import vlan-allocator {
prefix vlanalloc;
}
import cisco-vts-uuid-server {
prefix uuid-server;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management. Specifically, for the
management of virtual ports.
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
/*
* Identities
*/
identity tagging-requirement-type {
description "Based identity from which tagging requirements " +
"types are derived.";
}
identity optional {
base "tagging-requirement-type";
description "Tagging is optional.";
tailf:info "Tagging is optional.";
}
identity mandatory {
base "tagging-requirement-type";
description "Tagging is mandatory.";
tailf:info "Tagging is mandatory.";
}
identity network-tag-type {
description "Based identity from which network tag types are " +
"derived.";
}
identity vlan {
base "network-tag-type";
description "Vlan tagging.";
tailf:info "Vlan tagging.";
}
identity tag-scope-type {
description "Based identity from which tag scope types are " +
"derived.";
}
identity global {
base "tag-scope-type";
description "The scope of the tag is global.";
tailf:info "The scope of the tag is global.";
}
identity port {
base "tag-scope-type";
description "The scope of the tag is the port.";
tailf:info "The scope of the tag is the port.";
}
container vts_port_cfs_policy {
description "VTS Port CFS Policy Service.";
tailf:info "VTS Port CFS Policy Service.";
list port {
description "List of ports.";
tailf:info "Port.";
ncs:servicepoint vts-port-servicepoint;
key id;
leaf id {
description "Port identifier.";
tailf:info "ID.";
type vts:uuid;
}
uses ncs:service-data;
leaf network-id {
description "Identifier of the associated network.";
tailf:info "ID of the associated network.";
type leafref {
path "/vtsNetworkCFS:vts_network_cfs_policy" +
"/vtsNetworkCFS:network/vtsNetworkCFS:id";
}
mandatory "true";
}
uses vts:common-port;
list fixed-ips {
// TODO: this list needs to be revisited
// 1) is the IP address mandatory?
// 2) subnet-id comes from OS as a list of subnets
// our template concatenates them into the subnet-id leaf.
// How is this used? Needs to be revisited
description "List of fixed IP addresses.";
tailf:info "Fixed IP address.";
key ip-address;
leaf ip-address {
description "IP address.";
tailf:info "IP address.";
type inet:ip-address;
}
leaf subnet-id {
description "Subnetwork identifier.";
tailf:info "Subnetwork ID.";
type vts:string128;
}
}
leaf tenant-id {
//TODO: do we need this? the leafref to the (sub)network may suffice. Keeping it for the time being.
description "Tenant identifier.";
tailf:info "Tenant ID.";
type leafref {
path "/tenant:tenant/tenant:tenant-info" +
"/tenant:name";
}
mandatory true;
}
leaf tenant-name {
// TODO: do we need to name too? The tenant-id may suffice. Keeping it for the time being.
description "Tenant name.";
tailf:info "Tenant name.";
type vts:string128;
}
container binding-capabilities {
description "List of port binding capabilities.";
tailf:info "Binding capability.";
leaf port-filter {
description "Port filter.";
tailf:info "Port filter.";
type boolean;
default "false";
}
}
leaf vlan_number {
// TODO: reconsider whether to hide or not
description "Vlan assigned to the port.";
tailf:info "Vlan assigned to the port.";
type vts:vlan-id;
must "1 = count(/ralloc:resource-pools/ralloc:vlan-pool[" + // There must be a vlan pool associated to the device the port is connected to
"ralloc:name = " + // The key of a vlan pool (i.e., the name) is the name of the associated device
"/uuid-server:uuid-server[" + // The next three lines map from connection id to device name using the uuid-server model
"uuid-server:connid = current()/../connid/id]" +
"/uuid-server:torname]" +
"/vlanalloc:range[" + // That vlan pool must have a range that contains the vlan associated to this port
"vlanalloc:start <= current()/../vlan_number " +
"and vlanalloc:end >= current()/../vlan_number])" {
error-message "Vlan allocation requires the existence " +
"of an associated vlan range";
tailf:dependency "/ralloc:resource-pools/ralloc:vlan-pool";
}
}
//Baremetal-specific fields
leaf type {
description "Type of server port.";
tailf:info "Type of server port.";
type identityref {
base "vts:server-type";
}
default vts:virtual-server;
}
leaf ignore-trunk-vlan {
description "Flag to ignore L2 config push to Tor ports";
tailf:info "Flag to ignore L2 config push to Tor ports";
type boolean;
default false;
when "../type = 'vts:baremetal'";
}
leaf tagging {
description "Indicates whether a baremetal server tags " +
"the packets it sends.";
tailf:info "Indicates whether a baremetal server tags " +
"the packets it sends.";
type identityref {
base "tagging-requirement-type";
}
when "../type = 'vts:baremetal'";
}
leaf network-tag {
description "Type of network tag used by a baremetal " +
"server.";
tailf:info "Type of network tag used by a baremetal " +
"server.";
type identityref {
base "network-tag-type";
}
default vlan;
when "../type = 'vts:baremetal'";
}
leaf tag-scope {
description "Scope of the network tag used by a baremetal " +
"server.";
tailf:info "Scope of the network tag used by a baremetal " +
"server.";
type identityref {
base "tag-scope-type";
}
default global;
when "../type = 'vts:baremetal'";
}
list connid {
key id;
leaf id {
tailf:info "Unique ID for a tor name, tor port, server name and server port";
type vts:uuid;
}
}
} // port
} // vts_port_cfs_policy
} // module
module cisco-vts-l3 {
namespace "http://cisco.com/ns/yang/vts/services/l3";
prefix l3;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
import cisco-vts {
prefix vts;
}
import cisco-vts-openstack {
prefix openstack;
}
import cisco-vts-subnetwork-cfs {
prefix vtsSubnetCFS;
}
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 533-NETS
E-mail: TBD@cisco.com";
description
"This module contains a collection of YANG definitions
for Cisco's VTS's management.
Specifically, for the management of Layer 3 objects
Copyright (c) 2015 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-02-28" {
description
"Initial revision.";
}
/*
* Identities
*/
identity port-creation {
tailf:info "Based identity from which port creation options are derived.";
}
identity none {
base "port-creation";
tailf:info "No port creation.";
}
identity create {
base "port-creation";
tailf:info "Create port.";
}
container l3 {
list router {
description "List of routers.";
tailf:info "Router.";
uses ncs:service-data;
ncs:servicepoint openstack-router-servicepoint;
key id;
unique "tenant-id name";
leaf id {
description "Router identifier.";
tailf:info "Router ID.";
type vts:uuid;
}
leaf name {
description "Router name.";
tailf:info "Name.";
type vts:string15;
}
leaf router-gateway {
description "Router gateway.";
tailf:info "Router gateway.";
type string;
}
leaf status {
description "Router status.";
tailf:info "Router status.";
type identityref {
base "vts:entity-status";
}
mandatory true;
}
leaf tenant-id {
description "Tenant identifier. The value of the field should be the name of the tenant. This is Mandatory ";
tailf:info "Tenant ID.";
type vts:string128;
mandatory true;
}
// TODO: change name to vni-number for consistency
// TODO: consistency for network/subnet/port, config set by VTS in not
// included in the Openstack module
leaf vni_number {
description "Assigned VNI Number.";
tailf:info "Assigned VNI Number.";
type vts:vni;
}
}
list interfaces {
description "List of (router) interfaces.";
tailf:info "Router interfaces.";
ncs:servicepoint openstack-interface-servicepoint;
uses ncs:service-data;
key subnet-id;
leaf subnet-id {
description "Subnetwork identifier.";
tailf:info "Subnetwork ID.";
type leafref {
path "/vtsSubnetCFS:vts_subnet_cfs_policy/vtsSubnetCFS:subnet/vtsSubnetCFS:id";
}
mandatory "true";
}
leaf router-id {
description "Router identifier.";
tailf:info "Router ID.";
type leafref {
path "/l3:l3/l3:router/l3:id";
}
mandatory "true";
}
leaf ip-address {
description "Router interface IP address.";
tailf:info "IP address.";
type inet:ip-address;
}
leaf port-create {
description "Port create operation";
tailf:info "Port create operation";
type identityref {
base "l3:port-creation";
}
default "none";
}
} // list interfaces
} // container l3
}