On this page...

YANG schema

module vm-types {
    yang-version 1.1;
    namespace "http://metaswitch.com/yang/tas-vm-build/vm-types";
    prefix "vm-types";

    import ietf-inet-types {
        prefix "ietf-inet";
    }

    organization "Metaswitch Networks";
    contact "rvt-schemas@metaswitch.com";
    description "Types used by the various virtual machine schemas.";

    revision 2019-11-29 {
        description
            "Initial revision";
        reference
            "Metaswitch Deployment Definition Guide";
    }

    // If you change this range, please update MIN_NODE_ID in tasvmcommon/components.py.
    typedef rhino-node-id-type {
        type uint8 {
            range "1 .. 254";
        }
        description "The Rhino node identifier type.";
    }

    typedef rhino-cluster-id-type {
        type uint16 {
            range "1 .. 32767";
        }
        description "The Rhino cluster identifier type.";
    }

    typedef sgc-cluster-name-type {
        type string;
        description "The SGC cluster name type.";
    }

    typedef deployment-id-type {
        type string {
            pattern "[a-zA-Z0-9-]{1,15}";
        }
        description "Deployment identifier type. May only contain upper and lower case letters 'a'"
                    + " through 'z', the digits '0' through '9' and hyphens. Must be between 1 and"
                    + " 15 characters in length, inclusive.";
    }

    typedef site-id-type {
        type string {
            pattern "[a-zA-Z0-9]+";
        }
        description "Site identifier type. May only contain upper and lower case letters 'a'"
                    + " through 'z' and the digits '0' through '9'. Minimum length of 1.";
    }

    typedef node-type-suffix-type {
        type string {
            pattern "[a-zA-Z0-9]*";
        }
        description "Node type suffix type. May only contain upper and lower case letters 'a'"
                    + " through 'z' and the digits '0' through '9'. May be empty.";
    }

    typedef trace-level-type {
        type enumeration {
            enum debug {
                description "The 'debug' trace level.";
            }
            enum info {
                description "The 'info' trace level.";
            }
            enum warn {
                description "The 'warn' trace level.";
            }
            enum error {
                description "The 'error' trace level.";
            }
        }
        description "The Rhino trace level type";
    }

    typedef sip-uri-type {
        type string {
            pattern 'sip:.*';
        }
        description "The SIP URI type.";
    }

    typedef tel-uri-type {
        type string {
            pattern "tel:.*";
        }
        description "The Tel URI type.";
    }

    typedef sip-or-tel-uri-type {
        type union {
            type sip-uri-type;
            type tel-uri-type;
        }
        description "A type allowing either a SIP URI or a Tel URI.";
    }

    typedef number-string {
        type string {
            pattern "[0-9]+";
        }
        description "A type that permits a non-negative integer value.";
    }

    typedef sccp-address-type {
        type string {
            pattern "^(.*,)*type=(A|C|CH|J)7.*";
            pattern "^(.*,)*ri=(gt|ssn|pcssn).*";
            pattern "^.*=.*(,.*=.*)*$";
        }
        description "The SCCP address string type, as used by some Rhino RAs, such as CGIN and"
                    + " SIS.";
    }

    typedef ss7-address-string-type {
        type string {
            pattern "^(.*,)*address=.*";
            pattern "^.*=.*(,.*=.*)*$";
        }
        description "The SS7 address string type.";
    }

    grouping rhino-cluster-grouping {
        leaf cluster-id {
            type rhino-cluster-id-type;
            mandatory true;
            description "The Rhino cluster identifier.";
        }
        description "Rhino cluster configuration.";
    }

    grouping base-interfaces {
        leaf management.ipv4 {
            type ietf-inet:ipv4-address-no-zone;
            mandatory true;
            description "The IPv4 address of the management interface.";
        }
        leaf signaling.ipv4 {
            type ietf-inet:ipv4-address-no-zone;
            mandatory true;
            description "The IPv4 address of the signaling interface.";
        }
        description "Base network interfaces: management and signaling";
    }

    grouping diameter-configuration-grouping {
        leaf origin-realm {
            type ietf-inet:domain-name;
            mandatory true;
            description "The Diameter origin realm.";
        }

        leaf destination-realm {
            type ietf-inet:domain-name;
            mandatory true;
            description "The Diameter destination realm.";
        }

        list destination-peers {
            key "destination-hostname";

            min-elements 1;

            leaf protocol {
                type enumeration {
                    enum aaa {
                        description "The Authentication, Authorization and Accounting (AAA)"
                                    + " transport protocol.";
                    }
                    enum aaas {
                        description "The Authentication, Authorization and Accounting with Secure"
                                    + " Transport (AAAS) transport protocol.";
                    }
                }
                default aaa;
                description "The Diameter transport protocol.";
            }

            leaf destination-hostname {
                type ietf-inet:domain-name;
                mandatory true;
                description "The destination hostname.";
            }

            leaf port {
                type ietf-inet:port-number;
                default 3868;
                description "The destination port number.";
            }

            description "Diameter destination peer(s).";
        }

        description "Diameter configuration.";
    }

    grouping sas-configuration-grouping {
        leaf enabled {
            type boolean;
            default true;
            description "'true' enables the use of SAS, 'false' disables.";
        }

        container sas-connection {
            when "../enabled = 'true'";

            leaf system-type {
                type string;
                description "The SAS system type.";
            }

            leaf system-version {
                type string;
                description "The SAS system version. "
                            + "Will use the service version if not specified.";
            }

            leaf-list servers {
                type ietf-inet:ipv4-address-no-zone;
                min-elements 1;
                description "The list of SAS servers to send records to.";
            }

            description "Configuration for connecting to SAS.";
        }

        description "SAS configuration.";
    }

    grouping sas-instance-configuration-grouping {
        leaf system-name {
            type string;
            description "The SAS system name.";
        }

        description "SAS per-instance configuration.";
    }

    grouping plmn-id-grouping {
        leaf mcc {
            type number-string {
                length "3";
            }
            mandatory true;
            description "The Mobile Country Code (MCC).";
        }

        leaf mnc {
            type number-string {
                length "2..3";
            }
            mandatory true;
            description "The Mobile Network Code (MNC).";
        }

        description "The Public Land Mobile Network (PLMN) identity.";
    }
}
Previous page Next page