Commit 96d34e30 authored by scottma's avatar scottma
Browse files

Update _3gpp-5g-common-yang-types.yang

parent 311b92c0
Loading
Loading
Loading
Loading
+656 −98
Original line number Diff line number Diff line
module _3gpp-5g-common-yang-types {
module _3gpp-common-yang-types {
  yang-version 1.1;
  namespace "urn:3gpp:sa5:_3gpp-5g-common-yang-types";
  prefix "types5g3gpp";
  namespace "urn:3gpp:sa5:_3gpp-common-yang-types";
  prefix "types3gpp";
  
  
  import _3gpp-common-yang-types { prefix types3gpp; }
  import ietf-inet-types { prefix inet; }
  import ietf-yang-types { prefix yang; }

  organization "3GPP SA5";
  contact "https://www.3gpp.org/DynaReport/TSG-WG--S5--officials.htm?Itemid=464";
  description "The model defines common types for 5G networks and 
  description "The model defines a YANG mapping of the top level 
    information classes used for management of 5G networks and 
    network slicing.";
  reference "3GPP TS 28.541";
  reference "3GPP TS 28.623";

  revision 2022-01-03 { reference "CR-0144"; }
  revision 2021-11-01 { reference "CR-0141"; }
  revision 2021-09-30 {
    description "Added Longitude, Latitude, TenthOfDegrees, OnOff.";
    reference "CR-0138";
  }

  revision 2020-11-06 {
    description "Removed incorrect S-NSSAI definitions.";
    reference "CR-0118";
  }

  revision 2020-03-10 {
    description "Removed faulty when statements.";
    reference "SP-200229";
  }
 
  revision 2019-10-25 {
    description "Added ManagedNFProfile.";
    reference "S5-194457";
  }

  revision 2019-10-16 {
    description "Added SAP and usageState.";
    reference "S5-193518";
  }

  revision 2019-06-23 {
    reference  "Initial version.";
  }

  typedef EnabledDisabled {
    type enumeration {
      enum DISABLED ;
      enum ENABLED ;
    }
  }
  
  grouping JobMonitor {
    description "Provides attributes to monitor the progress of a job.
      
      The attributes in this clause are defined in a generic way. 
      Specialisations may be provided when specifying a concrete job.

      The progess of the job is described by the 'status' and
      'progressPercentage' attributes.
      
      When the associated job is created, the 'status' is set to 'NOT_RUNNING' 
      and the 'progressPercentage' to '0'. The MnS producer decides when to 
      start exceting the job and to transition into the 'RUNNING' state. This 
      time is captured in the 'startTime' attribute. During the 'RUNNING' 
      state the 'progressPercentage' attribute may be repeatedly updated. The 
      exact semantic of this attribute is subject to further specialisation. 
      The 'progessInfo' attribute may be used to provide additional textual 
      information in the 'NOT_RUNNING', 'CANCELLING' and 'RUNNING' states. 
      Further specialisation of 'progressInfo' may be provided where this data 
      type is used.
      
      Upon successful completion of the job, the 'status' attribute is set to 
      'FINISHED', the 'progressPercentage' to 100%. The time is captured in the 
      'endTime' attribute. Additional textual information may be provided in the 
      'resultInfo' attribute. The type of 'resultInfo' in this data type 
      definition is 'String'. Further specialisation of 'resultInfo' may be 
      provided where this data type is used.
      
      In case the job fails to complete, the 'status' attribute is set to 
      'FAILURE' or - PARTIALLY_FAILED, the current value of 'progressPercentage' 
      is frozen, and the time captured in 'endTime'. The 'resultInfo' specifies 
      the reason for the failure. Specific failure reasons may be specified 
      where the data type defined in this clause is used. The exact semantic of 
      failure may be subject for further specialisation as well.

      In case the job is cancelled, the 'status' attribue is first set to 
      'CANCELLING' and when the job is really cancelled to 'CANCELLED'. The 
      transition to 'CANCELLED' is captured in the 'endTime' attribute. 
      The value of 'progressPercentage' is frozen. Additional textual 
      information may be provided in the 'resultInfo' attribute.

      The job may have to be completed within a certain time after its creation, 
      for example because required data may not be available any more after a 
      certain time, or the job outcome is needed until a certain time and when 
      not provided by this time is not needed any more. The time until the MnS 
      producer automatically cancels the job is indicated by the 'timer' 
      attribute.

      If a management operation results in starting an assosiacted job it 
      should also result in the setting and updating of an attribute named 
      'jobMonitor' that has the type 'JobMonitor'. The jobMonitor attribute 
      may be accompanied by use-case specific additional data items.";
      
    leaf id {
      type string;
      mandatory true;
      description "Id of the associated job. It is unique within a single 
        multivalue attribute of type JobMonitor.";
    }
    
    leaf status { 
      type enumeration {
        enum NOT_STARTED ;
        enum RUNNING ;
        enum SUSPENDED ;
        enum CANCELLING ;
        enum FINISHED ;
        enum FAILURE ;
        enum PARTIALLY_FAILED ;
        enum CANCELLED ;
      }
      config false;
      default  RUNNING;
      description "Represents the status of the associated job, 
        whether it fails, succeeds etc. 
        It does not represent the returned values of a successfully finished 
        job. 
        Even a successfully finished job may report back, the task for which 
        it was started is unsuccessful. 
        E.g. a reserve-resource-job finished the reservation process 
        successfully, but it reports back that the resource is not available.";
    }

    leaf progressPercentage {
      type uint8 {
        range 0..100;
      }
      config false;
      description "Progress of the associated job as percentage";
    }

    leaf-list progressInfo {
      type string;
      config false;
      description "Additional textual information about the state and progress 
        of the associated job. The attribute is updated during the 
        'NOT_STARTED', 'CANCELLING' and 'RUNNING' states.
        Specific jobs may define specific well-defined strings to be used 
        in this attribute using e.g. string patterns or enums.";
    }

    leaf resultInfo {
      type string;
      config false;
      description "Additional textual information about the final result of 
        the associated job. The attribute is populated when transitioning in 
        the 'FINISHED', 'FAILURE', 'PARTIALLY_FAILED' or 'CANCELLED' state. 
        In the failure state it shall provide the failure reasons.
        
        This attribue shall not be used to make the outcome of the job 
        available for retrieval, if any. For this purpose, dedicated 
        attributes shall be specified when specifying a specific job.
        
        Specific jobs may define specific well-defined strings to be used 
        in this attribute using e.g. string patterns or enums.";
    }

    leaf startTime {
      type yang:date-and-time;
      config false;
      description "Start time of the associated job, i.e. the time when the 
        status changed from 'NOT_STARTED' to 'RUNNING'.";
    }

    leaf endTime {
      type yang:date-and-time;
      config false;
      description "Date and time when status changed to 'SUCCESS', 'CANCELLED', 
        'FAILED' or 'PARTIALLY_FAILED'. 

        If the time is in the future, it is the estimated time 
        the job will end.";
    }

    leaf timer {
      type uint32;
      units minutes;
      description "Time until the associated job is automatically cancelled.
      If set, the system decreases the timer with time. When it reaches zero 
      the cancellation of the associated job is initiated by the MnS_Producer. 
      If not set, there is no time limit for the job.
      
      Once the timer is set, the consumer can not change it anymore. 
      If the consumer has not set the timer the MnS Producer may set it.";
    }
  }
  
  typedef TenthOfDegrees { 
    type uint16 { 
      range 0..3600; 
    }
    units "0.1 degrees";
    description "A single integral value corresponding to an angle in degrees 
      between 0 and 360 with a resolution of 0.1 degrees.";
  }

  typedef Latitude {
    type decimal64 {
      fraction-digits 4;
      range "-90.0000..+90.0000"; 
    }
    description "Latitude values";
  }

  typedef Longitude {
    type decimal64 {
      fraction-digits 4;
      range "-180.0000..+180.0000"; 
    }
    description "Longitude values";
  }

  typedef OnOff {
    type enumeration {
      enum ON;
      enum OFF;
    }
  }
  
  // grouping ManagedNFProfile will be removed as it is 
  //  being moved to _3gpp-5gc-nrm-nfprofile
  grouping ManagedNFProfile {
    description "Defines profile for managed NF";
    reference "3GPP TS 23.501";
    
    leaf idx { type uint32 ; }
    
    leaf nfInstanceID {
      config false;
      mandatory true;
      type yang:uuid ;
      description "This parameter defines profile for managed NF. 
        The format of the NF Instance ID shall be a 
        Universally Unique Identifier (UUID) version 4, 
        as described in IETF RFC 4122 " ;
    }
    
    leaf-list nfType {
      config false;
      min-elements 1;
      type NfType;
      description "Type of the Network Function" ;
    }
    
    leaf hostAddr {
      mandatory true;
      type inet:host ;
      description "Host address of a NF";
    }
    
    leaf authzInfo {
      type string ;
      description "This parameter defines NF Specific Service authorization 
        information. It shall include the NF type (s) and NF realms/origins 
        allowed to consume NF Service(s) of NF Service Producer.";
      reference "See TS 23.501" ;
    }
    
    leaf location {
      type string ;
      description "Information about the location of the NF instance 
        (e.g. geographic location, data center) defined by operator";
      reference "TS 29.510" ;
    }
    
    leaf capacity {
      mandatory true;
      type uint16 ;
      description "This parameter defines static capacity information 
        in the range of 0-65535, expressed as a weight relative to other 
        NF instances of the same type; if capacity is also present in the 
        nfServiceList parameters, those will have precedence over this value.";
      reference "TS 29.510" ;
    }
      
    leaf nFSrvGroupId {
      type string ;
      description "This parameter defines identity of the group that is 
        served by the NF instance.
        May be config false or true depending on the ManagedFunction. 
        Config=true for Udrinfo. Config=false for UdmInfo and AusfInfo. 
        Shall be present if ../nfType = UDM or AUSF or UDR. ";
      reference "TS 29.510" ;
    }
    
    leaf-list supportedDataSetIds {
      type enumeration {
        enum SUBSCRIPTION;
        enum POLICY;
        enum EXPOSURE;
        enum APPLICATION;
      }
      description "List of supported data sets in the UDR instance. 
        May be present if ../nfType = UDR";
      reference "TS 29.510" ;
    }
    
    leaf-list smfServingAreas {
      type string ;
      description "Defines the SMF service area(s) the UPF can serve. 
        Shall be present if ../nfType = UPF";
      reference "TS 29.510" ;
    }
    
    leaf priority {
      type uint16;
      description "This parameter defines Priority (relative to other NFs 
        of the same type) in the range of 0-65535, to be used for NF selection; 
        lower values indicate a higher priority. If priority is also present 
        in the nfServiceList parameters, those will have precedence over 
        this value. Shall be present if ../nfType = AMF ";
      reference "TS 29.510" ;
    }
  }
  
  typedef usageState {
    type enumeration {
      enum IDLE;
      enum ACTIVE;
      enum BUSY;
    }
    description "It describes whether or not the resource is actively in 
      use at a specific instant, and if so, whether or not it has spare 
      capacity for additional users at that instant. The value is READ-ONLY.";
    reference "ITU T Recommendation X.731";
  }
  
  revision 2021-08-05 { reference S5-214053/CR-0518; }
  revision 2020-11-05 { reference CR-0412 ; }
  revision 2019-10-20 { reference "Initial version."; }
  grouping SAP {
    leaf host {
      type inet:host;
      mandatory true;
    }
    leaf port {
      type inet:port-number;
      mandatory true;
    }
    description "Service access point.";
    reference "TS 28.622";
  }
  
  grouping SNssai {
    description 
      "Single Network Slice Selection Assistance Information(S-NSSAI)";
    reference "3GPP TS 23.003";
  typedef Mcc {
    description "The mobile country code consists of three decimal digits, 
      The first digit of the mobile country code identifies the geographic 
      region (the digits 1 and 8 are not used):";
    type string {
      pattern '[02-79][0-9][0-9]';
    }
    reference "3GPP TS 23.003 subclause 2.2 and 12.1";
  }

    leaf sd {
      description "Slice Differentiator
        If not needed, the value can be set to FFFFFF.";
  typedef Mnc {
    description "The mobile network code consists of two or three 
      decimal digits (for example: MNC of 001 is not the same as MNC of 01)";
    type string {
        length 6;
      pattern '[0-9][0-9][0-9]|[0-9][0-9]';
    }
    reference "3GPP TS 23.003 subclause 2.2 and 12.1";
  }

  grouping PLMNId {
    leaf mcc {
      mandatory true;
      type Mcc;
    }
    leaf mnc {
      mandatory true;
      type Mnc;
    }
    reference "TS 23.658";
  }
  
  typedef Nci {
    description "NR Cell Identity. The NCI shall be of fixed length of 36 bits 
      and shall be coded using full hexadecimal representation. 
      The exact coding of the NCI is the responsibility of each PLMN operator";
    reference "TS 23.003";
    type union {
      type string {
        length 36;
        pattern '[01]+';
      }
      type string {
        length 9;
        pattern '[a-fA-F0-9]*';
      }
      reference "3GPP TS 23.003";
    }
  }
    
    leaf sst {
      type uint8;
      description "Slice/Service Type.
         Values 0 to 127 belong to standardized SST range and are defined in 
         3GPP TS 23.501. Values 128 to 255 belong to operator-specific range.";
  typedef OperationalState {
    reference "3GPP TS 28.625 and ITU-T X.731";
    type enumeration {
      enum DISABLED {
        value 0;
        description "The resource is totally inoperable.";
      }

      enum ENABLED {
        value 1;
        description "The resource is partially or fully operable.";
      }

  grouping PLMNInfo {
    description "The PLMNInfo data type define a S-NSSAI member in a specific 
      PLMNId, and it have two attributes PLMNId and S-NSSAI (PLMNId, S-NSSAI). 
      The PLMNId represents a data type that is comprised of mcc 
      (mobile country code) and mnc (mobile network code), (See TS 23.003 
      subclause 2.2 and 12.1) and S-NSSAI represents an data type, that is 
      comprised of an SST (Slice/Service type) and an optional 
      SD (Slice Differentiator) field";
    uses types3gpp:PLMNId;
    uses SNssai;
    }
  }
  
  typedef CommModelType {
    reference "3GPP TS 23501";
  typedef AdministrativeState {
    reference "3GPP TS 28.625 and ITU-T X.731";
    type enumeration {
      enum DIRECT_COMMUNICATION_WO_NRF {
      enum LOCKED {
        value 0;
        description "Directly communicate to other pre-configured NF service.";
        description "The resource is administratively prohibited from performing
                 services for its users.";
      }

      enum DIRECT_COMMUNICATION_WITH_NRF {
      enum UNLOCKED {
        value 1;
        description "Directly communicate to other NF service discovered 
          by NRF.";
        description "The resource is administratively permitted to perform
          services for its users. This is independent of its inherent
          operability.";
      }

      enum INDIRECT_COMMUNICATION_WO_DEDICATED_DISCOVERY {
      enum SHUTTINGDOWN {
        value 2;
        description "Communicate to pre-configured other NF service through 
          SCP as a proxy.";
        description "Use of the resource is administratively permitted to
          existing instances of use only. While the system remains in
          the shutting down state the manager or the managed element 
          may at any time cause the resource to transition to the 
          locked state.";
      }
    }
  }
  
      enum INDIRECT_COMMUNICATION_WITH_DEDICATED_DISCOVERY {
        value 3;
        description "Communication to NF service discovered by NRF through SCP 
          as a proxy.";
  typedef AvailabilityStatus {
      type enumeration {
          enum IN_TEST;
          enum FAILED;                           
          enum POWER_OFF;                           
          enum OFF_LINE;                           
          enum OFF_DUTY;                           
          enum DEPENDENCY;                           
          enum DEGRADED;                           
          enum NOT_INSTALLED;                           
          enum LOG_FULL;                           
       }
  }
  
  typedef CellState {
      type enumeration {
        enum IDLE;
        enum INACTIVE;              
        enum ACTIVE;              
     }
  }

  grouping CommModel {
    leaf groupId {
      type uint16;   
  typedef Nrpci {
    type uint32;
    description "Physical Cell Identity (PCI) of the NR cell.";
    reference "TS 36.211 subclause 6.11";
  }
    leaf commModelType {
      type CommModelType;

  typedef Tac {
    type int32 {
      range 0..16777215 ;
    }
    leaf-list targetNFServiceList {      
      type types3gpp:DistinguishedName;    
    description "Tracking Area Code";
    reference "TS 23.003 clause 19.4.2.3";
  }

  typedef AmfRegionId {
    type union { 
      type uint8 ;
      type string {
        length 8;
        pattern '[01]*';
      }
    leaf commModelConfiguration {
      type string;
    }
    reference "clause 2.10.1 of 3GPP TS 23.003";
  }

  grouping SupportedFunc {
    leaf function {
      type string;   
  typedef AmfSetId {
    type union { 
      type uint16 {
        range '0..1023';
      }
    leaf policy {
      type string;
      type string {
        length 8;
        pattern '[01]*';
      }
    }
    reference "clause 2.10.1 of 3GPP TS 23.003";
  }

  typedef EnergySavingLoadThresholdT {
    type uint32 {
      range 0..10000;
  typedef AmfPointer {
    type union { 
      type uint8 {
        range '0..63';
      }
      type string {
        length 6;
        pattern '[01]*';
      }
    }
    units 1/10000;
    reference "clause 2.10.1 of 3GPP TS 23.003";
  }
        
  typedef EnergySavingTimeDurationT {
    type uint32 {
      range 0..900;
  grouping AmfIdentifier {        
    leaf amfRegionId {
      type AmfRegionId;
    }
    leaf amfSetId {
      type AmfSetId;
    }
    units seconds;
    leaf amfPointer {
      type AmfPointer;
    } 
    description "The AMFI is constructed from an AMF Region ID, 
      an AMF Set ID and an AMF Pointer. 
      The AMF Region ID identifies the region, 
      the AMF Set ID uniquely identifies the AMF Set within the AMF Region, and 
      the AMF Pointer uniquely identifies the AMF within the AMF Set. "; 
  }    

// type definitions especially for core NFs

  typedef PhysCellID {
    type uint32 { 
      range "0..1007"; 
  typedef NfType {
    type enumeration {
      enum NRF;
      enum UDM;
      enum AMF;
      enum SMF;
      enum AUSF;
      enum NEF;
      enum PCF;
      enum SMSF;
      enum NSSF;
      enum UDR;
      enum LMF;
      enum GMLC;
      enum 5G_EIR;
      enum SEPP;
      enum UPF;
      enum N3IWF;
      enum AF;
      enum UDSF;
      enum BSF;
      enum CHF;
    }          
    reference "clause 7.4.2 of TS 38.211";
  }
  
  typedef UTC24TimeOfDayT {
    description "Time of day in HH:MM or H:MM 24-hour format per UTC 
      time zone.";
    type string {
      pattern "(([01]?[0-9])|(2[0-3])):([0-5][0-9])";
  typedef NotificationType {
    type enumeration {
      enum N1_MESSAGES;
      enum N2_INFORMATION;
      enum LOCATION_NOTIFICATION;
    }      
  }
  
  typedef DayOfWeekT {
  typedef Load {
    description "Latest known load information of the NF, percentage ";
    type uint8 {
      range 0..100;
    }
  }

  typedef N1MessageClass {
    type enumeration {
      enum 5GMM;
      enum SM;
      enum LPP;
      enum SMS; 
    }      
  }
  
  typedef N2InformationClass {
    type enumeration {
      enum SM;
      enum NRPPA;
      enum PWS;
      enum PWS_BCAL;
      enum PWS_RF;
    }              
  }
  
  grouping DefaultNotificationSubscription {
    
    leaf notificationType {
      type NotificationType;
    }
    
    leaf callbackUri {
      type inet:uri;
    }
    
    leaf n1MessageClass {
      type N1MessageClass;
    }
    
    leaf n2InformationClass {
      type N2InformationClass;
    }    
  }  
        
  grouping Ipv4AddressRange {
  leaf start {
    type inet:ipv4-address;
    }
  leaf end {
    type inet:ipv4-address;
    }    
  }
    
  grouping Ipv6PrefixRange {
  leaf start {
    type inet:ipv6-prefix;
    }
  leaf end {
    type inet:ipv6-prefix;
    }    
  }
     
  typedef NsiId {
    type string;
  }
    
  typedef UeMobilityLevel {
    type enumeration {
      enum Monday;
      enum Tuesday;
      enum Wednesday;
      enum Thursday;
      enum Friday;
      enum Saturday;
      enum Sunday;
      enum STATIONARY;
      enum NOMADIC;
      enum RESTRICTED_MOBILITY;
      enum FULLY_MOBILITY;
    }
  }
      
  typedef ResourceSharingLevel {
      type enumeration {
        enum SHARED;
        enum NOT_SHARED;
      }
  }
      
  typedef TxDirection {
      type enumeration {
        enum DL;
        enum UL;
        enum DL_AND_UL;
      }
  }
      
  grouping AddressWithVlan {
    leaf ipAddress {
      type inet:ip-address;   
    }
    leaf vlanId {
       type uint16;
    }  
  }
  
  typedef DistinguishedName {    // TODO is this equivalent to TS 32.300 ?
    type string {
      pattern '([a-zA-Z][a-zA-Z0-9-]*=(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,# ])'
        + '((\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,])*'
        + '(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+, ]))?'
        + '[,\+])*[a-zA-Z][a-zA-Z0-9-]*=(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,# ])'
        + '((\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})'
        + '|[^\\><;"+,])*(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+, ]))?';  
    }
    description "Represents the international standard for the representation 
      of Distinguished Name (RFC 4512). 
      The format of the DistinguishedName REGEX is:
      {AttributeType = AttributeValue}   

      AttributeType consists of alphanumeric and hyphen (OIDs not allowed). 
      All other characters are restricted.
      The Attribute value cannot contain control characters or the 
        following characters : \\ > < ; \" + , (Comma) and White space
      The Attribute value can contain the following characters if they 
        are excaped : \\ > < ; \" + , (Comma) and White space
      The Attribute value can contain control characters if its an escaped 
        double digit hex number.
        Examples could be 
          UID=nobody@example.com,DC=example,DC=com
            CN=John Smith,OU=Sales,O=ACME Limited,L=Moab,ST=Utah,C=US";
    reference  "RFC 4512 Lightweight Directory Access Protocol (LDAP):
                      Directory Information Models";
  } // recheck regexp it doesn't handle posix [:cntrl:]
 
  typedef QOffsetRange  {
    type int8 { 
      range "-24 | -22 | -20 | -18 | -16 | -14 | -12 | -10 | -8 | -6 | " +
        " -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | " +
        " 12 | 14 | 16 | 18 | 20 | 22 | 24"; 
    }
    units dB;
  }
}