huawei-cfg

Configuration management module.

  • Version: 2021-01-26

    huawei-cfg@2021-01-26


    
      module huawei-cfg {
    
        yang-version 1.1;
    
        namespace "urn:huawei:yang:huawei-cfg";
    
        prefix cfg;
    
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-ifm {
          prefix ifm;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description
          "Configuration management module.";
    
        revision "2021-01-26" {
          description "Add load configuration.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-18" {
          description "Fix units problems.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-21" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "config";
    
        typedef config-checkpoint-client {
          type enumeration {
            enum "cli" {
              value 0;
              description
                "The client that creates a configuration checkpoint is CLI.";
            }
            enum "netconf" {
              value 1;
              description
                "The client that generates a configuration checkpoint is NETCONF.";
            }
            enum "snmp" {
              value 2;
              description
                "The client that creates a configuration checkpoint is SNMP.";
            }
            enum "rollback" {
              value 3;
              description
                "The client that generates a configuration checkpoint is rollback. A configuration checkpoint is generated because a rollback command is run.";
            }
            enum "y2" {
              value 4;
              description
                "The client that generates a configuration checkpoint is y2. A configuration checkpoint is generated because the startup configuration of the system is different from the latest configuration checkpoint.";
            }
            enum "restore" {
              value 5;
              description
                "The client that generates a configuration checkpoint is restore. A configuration checkpoint is generated because the startup configuration of the system is different from the latest configuration checkpoint.";
            }
            enum "system" {
              value 6;
              description
                "The client that generates a configuration checkpoint is system. A configuration checkpoint is generated because the current user information cannot be obtained.";
            }
            enum "mml" {
              value 7;
              description
                "The client that generates a configuration checkpoint is mml. A configuration checkpoint is generated because the startup configuration of the system is different from the latest configuration checkpoint.";
            }
            enum "inner" {
              value 8;
              description
                "The client that generates a configuration checkpoint is inner. A configuration checkpoint is generated because the startup configuration of the system is different from the latest configuration checkpoint.";
            }
          }
          description "Client type.";
        }
    
        typedef cfg-transport-type {
          type enumeration {
            enum "ftp" {
              value 1;
              description "FTP protocol.";
            }
            enum "tftp" {
              value 2;
              description "TFTP protocol.";
            }
            enum "sftp" {
              value 3;
              description "SFTP protocol.";
            }
            enum "http" {
              value 5;
              description "HTTP protocol.";
            }
          }
          description "Server type.";
        }
    
        typedef cfg-server-type {
          type enumeration {
            enum "ftp" {
              value 1;
              description "FTP protocol.";
            }
            enum "tftp" {
              value 2;
              description "TFTP protocol.";
            }
            enum "sftp" {
              value 3;
              description "SFTP protocol.";
            }
          }
          description "Server type.";
        }
    
        typedef cfg-operation-type {
          type enumeration {
            enum "running2net" {
              value 1;
              description
                "Back up the device configuration to a server.";
            }
            enum "net2startup" {
              value 2;
              description
                "Configure the configuration file on the server as the next startup configuration file.";
            }
          }
          description "Operation type.";
        }
    
        typedef cfg-operation-state {
          type enumeration {
            enum "running" {
              value 1;
              description
                "The operation is being processed.";
            }
            enum "success" {
              value 2;
              description
                "The operation is successful.";
            }
            enum "invalid-operation" {
              value 3;
              description "Invalid operation.";
            }
            enum "invalid-server-address" {
              value 4;
              description
                "Invalid server IP address.";
            }
            enum "invalid-source-name" {
              value 5;
              description
                "Invalid source file name.";
            }
            enum "invalid-dest-name" {
              value 6;
              description
                "Invalid destination file name.";
            }
            enum "device-busy" {
              value 7;
              description "The device is busy.";
            }
            enum "device-full" {
              value 8;
              description
                "The disk space of the device is full.";
            }
            enum "file-open-error" {
              value 9;
              description
                "The file fails to be opened.";
            }
            enum "file-transfer-error" {
              value 10;
              description
                "The file fails to be transferred.";
            }
            enum "auth-fail" {
              value 11;
              description
                "The server authentication fails.";
            }
            enum "timeout" {
              value 12;
              description
                "File transfer timeout.";
            }
            enum "startup-file-locked" {
              value 13;
              description "Startup file locked.";
            }
            enum "unknown-failure" {
              value 14;
              description "Unknown error.";
            }
          }
          description "Operation state.";
        }
    
        typedef command-result {
          type enumeration {
            enum "unknown-command" {
              value 0;
              description
                "The failed reason of a configuration command is unknown command.";
            }
            enum "execute-failed" {
              value 1;
              description
                "The failed reason of a configuration command is executed failed.";
            }
            enum "execute-timeout" {
              value 2;
              description
                "The failed reason of a configuration command is executed timeout.";
            }
          }
          description "Command result.";
        }
    
        typedef cfg-hwcm-operation-type {
          type enumeration {
            enum "running2startup" {
              value 1;
              description
                "Save the running configuration to the next startup configuration file.";
            }
            enum "startup2running" {
              value 2;
              description
                "Load the next startup configuration file to the device.";
            }
            enum "running2net" {
              value 3;
              description
                "Back up the device configuration to a server.";
            }
            enum "net2running" {
              value 4;
              description
                "Download the configuration file from the server to the device and run it.";
            }
            enum "net2startup" {
              value 5;
              description
                "Configure the configuration file on the server as the next startup configuration file.";
            }
            enum "startup2net" {
              value 6;
              description
                "Back up the next startup configuration file to a server.";
            }
            enum "delstartup" {
              value 7;
              description
                "Delete the next startup configuration file.";
            }
          }
          description "HWCM operation type.";
        }
    
        typedef cfg-trial-status {
          type enumeration {
            enum "inactive" {
              value 0;
              description
                "The system is not in trial running mode.";
            }
            enum "active" {
              value 1;
              description
                "The system is in trial running mode.";
            }
            enum "canceling" {
              value 2;
              description
                "The system is reverting the trial configuration.";
            }
            enum "wait-cancel" {
              value 3;
              description
                "The system will revert to the previous configuration.";
            }
          }
          description "Trial status.";
        }
    
        typedef cfg-service-type {
          type enumeration {
            enum "common" {
              value 0;
              description "Common service type.";
            }
            enum "cfg" {
              value 4;
              description "CFG service type.";
            }
          }
          description "File service type.";
        }
    
        typedef load-config-type {
          type enumeration {
            enum "merge" {
              value 0;
              description
                "Merge contents with existing configuration.";
            }
            enum "replace" {
              value 1;
              description
                "Replace contents with existing configuration.";
            }
          }
          description "Load configuration type.";
        }
    
        typedef shareable-type {
          type enumeration {
            enum "password" {
              value 1;
              description "Password.";
            }
            enum "default" {
              value 2;
              description "Default.";
            }
          }
          description
            "The shareable type to operate a configuration file..";
        }
    
        container cfg {
          description
            "Configuration management module.";
          container autosave {
            presence "Enable autosave";
            description
              "Configure used for automatically saving configurations.";
            leaf interval-time {
              type uint32 {
                range "30..43200";
              }
              units "min";
              must
                "../interval-time > ../delay-time" {
                error-app-tag
                  "The interval time must be more than the delay time.";
              }
              default "30";
              description
                "The system automatically saves configurations every a specified interval.";
            }
    
            leaf delay-time {
              type uint32 {
                range "1..60";
              }
              units "min";
              must
                "../interval-time > ../delay-time" {
                error-app-tag
                  "The interval time must be more than the delay time.";
              }
              default "5";
              description
                "When the system configuration changes, the system automatically saves the configuration after a specified delay.";
            }
    
            leaf cpu-limit {
              type uint32 {
                range "1..100";
              }
              default "50";
              description
                "Upper limit of the CPU usage for automatically saving configurations.";
            }
          }  // container autosave
    
          container lock-by-users {
            description
              "List of lock configuration.";
            list lock-by-user {
              key "lock-username";
              max-elements 1;
              description
                "Configure lock configuration.";
              leaf lock-username {
                type string {
                  length "1..253";
                }
                description
                  "Name of a user who locks the configuration.";
              }
    
              leaf lock-time {
                type yang:date-and-time;
                config false;
                description
                  "Time when the configuration is locked.";
              }
    
              leaf identifier {
                type uint32;
                config false;
                description
                  "Unique ID of a configuration lock.";
              }
    
              leaf unlock-username {
                type string {
                  length "1..253";
                }
                config false;
                description
                  "Name of a user who unlocks the configuration.";
              }
    
              leaf unlock-time {
                type yang:date-and-time;
                config false;
                description
                  "Time when the configuration is unlocked.";
              }
            }  // list lock-by-user
          }  // container lock-by-users
    
          container checkpoints {
            config false;
            description
              "List of all configuration checkpoints in the system.";
            list checkpoint {
              key "commit-id";
              config false;
              max-elements 100;
              description
                "Operational state of configuration checkpoints in the system.";
              leaf commit-id {
                type string {
                  length "1..20";
                }
                config false;
                description
                  "Uniquely identify a configuration checkpoint.";
              }
    
              leaf user-label {
                type string {
                  length "1..256";
                }
                config false;
                description
                  "Label for identifying a configuration checkpoint, which is a character string that does not start with a digit.";
              }
    
              leaf username {
                type string {
                  length "1..253";
                }
                config false;
                description
                  "Name of the user who committed a configuration to trigger the generation of a configuration checkpoint.";
              }
    
              leaf line {
                type string {
                  length "1..85";
                }
                config false;
                description
                  "Instance of the terminal accessed by the user who committed a configuration to trigger the generation of a configuration checkpoint.";
              }
    
              leaf client {
                type config-checkpoint-client;
                config false;
                description
                  "Type of the tool agent accessed by the user who committed a configuration to trigger the generation of a configuration checkpoint.";
              }
    
              leaf timestamp {
                type yang:date-and-time;
                config false;
                description
                  "Time when a configuration checkpoint was created.";
              }
    
              leaf description {
                type string {
                  length "1..60";
                }
                config false;
                description
                  "Description of a configuration checkpoint. A user can set a description for a configuration checkpoint to be generated when committing a configuration.";
              }
    
              container current-point-changes {
                config false;
                description
                  "List of configuration change information recorded in all configuration checkpoints. List of the configuration change information recorded in each configuration checkpoint is separately displayed.";
                list current-point-change {
                  key "index";
                  config false;
                  description
                    "Operational state of configuration change between a specified configuration checkpoint and the previous configuration checkpoint.";
                  leaf index {
                    type uint32;
                    config false;
                    description
                      "Index of a configuration change. A configuration checkpoint records a configuration change after a configuration is committed. Each configuration change is identified by an index.";
                  }
    
                  leaf config-change {
                    type string {
                      length "1..3200";
                    }
                    config false;
                    description
                      "Configuration change command.";
                  }
                }  // list current-point-change
              }  // container current-point-changes
    
              container since-point-changes {
                config false;
                description
                  "List of configuration changes between a specified configuration checkpoint and the current configuration.";
                list since-point-change {
                  key "index";
                  config false;
                  description
                    "Operational state of configuration change between a specified configuration checkpoint and the current configuration.";
                  leaf index {
                    type uint32;
                    config false;
                    description
                      "Index of a configuration change. A configuration checkpoint records a configuration change after a configuration is committed. Each configuration change is identified by an index.";
                  }
    
                  leaf config-change {
                    type string {
                      length "1..3200";
                    }
                    config false;
                    description
                      "Configuration change command.";
                  }
                }  // list since-point-change
              }  // container since-point-changes
            }  // list checkpoint
          }  // container checkpoints
    
          container global-switch {
            description
              "Configure the globally configuration management feature.";
            leaf configuration-slave-detect-switch {
              type boolean;
              default "true";
              description
                "Enable/disable function to automatically verify the configurations of the master and slave main control boards.";
            }
    
            leaf appdata-detect-switch {
              type boolean;
              default "false";
              description
                "Enable/disable function to automatically verify application data.";
            }
    
            leaf checkpoint-switch {
              type boolean;
              default "true";
              description
                "Enable/disable switch of saving check ponit.";
            }
          }  // container global-switch
    
          container backup-and-recovery-states {
            config false;
            description
              "List of operation states delivered by the NMS.";
            list backup-and-recovery-state {
              key "index";
              config false;
              max-elements 5;
              description
                "Operational state of a configuration file.";
              leaf index {
                type uint32 {
                  range "1..2147483647";
                }
                config false;
                description "Operation ID.";
              }
    
              leaf operation-type {
                type cfg-hwcm-operation-type;
                config false;
                description
                  "Operation type delivered by the NMS.";
              }
    
              leaf state {
                type cfg-operation-state;
                config false;
                description "Operation result.";
              }
    
              leaf operate-progress {
                type uint32 {
                  range "0..100";
                }
                config false;
                description
                  "Operation progress.";
              }
    
              leaf start-time {
                type yang:date-and-time;
                config false;
                description
                  "Operation start time.";
              }
    
              leaf last-time {
                type pub-type:time-tick;
                config false;
                description
                  "Operation end time.";
              }
    
              leaf filename {
                ext:support-filter "true";
                type string {
                  length "5..64";
                }
                config false;
                description
                  "Name of a configuration file.";
              }
    
              leaf service-type {
                type cfg-service-type;
                config false;
                description "File service type.";
              }
            }  // list backup-and-recovery-state
          }  // container backup-and-recovery-states
    
          container autosave-checkpoint {
            description
              "Configure start-time for automatically saving checkpoint.";
            leaf start-time {
              type pub-type:time-hhmm {
                length "3..5";
                pattern
                  '(([0-1][0-9])|(2[0-3])|[0-9]):([0-5][0-9]|[0-9])';
              }
              units "min";
              default "02:00";
              description
                "The system automatically save checkpoint at a specified time of the day.";
            }
          }  // container autosave-checkpoint
    
          container configuration-operation-cpu-limit {
            description
              "Configure the CPU suppress on configuration operation.";
            leaf snmp-cpu-limit {
              when "../snmp-switch = 'true'";
              type uint32 {
                range "30..100";
              }
              default "100";
              description
                "CPU usage threshold that triggers rate limiting on users that access through SNMP.";
            }
    
            leaf snmp-switch {
              type boolean;
              default "false";
              description
                "Enable/disable function of CPU usage-based rate limiting for users that access through SNMP.";
            }
    
            leaf netconf-cpu-limit {
              when "../netconf-switch = 'true'";
              type uint32 {
                range "30..100";
              }
              default "100";
              description
                "CPU usage threshold that triggers rate limiting on users that access through NETCONF.";
            }
    
            leaf netconf-switch {
              type boolean;
              default "false";
              description
                "Enable/disable function of CPU usage-based rate limiting for users that access through NETCONF.";
            }
          }  // container configuration-operation-cpu-limit
    
          container backup-servers {
            description
              "List of backup servers. A maximum of five backup servers can be configured.";
            list backup-server {
              key "server-ip vpn-instance";
              max-elements 5;
              description
                "Configure backup server used for automatically saving uploaded files.";
              leaf server-ip {
                type inet:ip-address-no-zone;
                description
                  "IP address of the backup server.";
              }
    
              leaf vpn-instance {
                type string {
                  length "1..31";
                }
                description
                  "Name of a VPN instance.";
              }
    
              leaf transport-type {
                type cfg-server-type;
                mandatory true;
                description
                  "Type of the protocol for transporting the backup file.";
              }
    
              leaf username {
                when
                  "not(../transport-type='tftp')";
                type string {
                  length "1..64";
                }
                mandatory true;
                description
                  "User name for connecting the backup server.";
              }
    
              leaf password {
                when
                  "not(../transport-type='tftp')";
                type pub-type:password-extend {
                  length "1..432";
                }
                mandatory true;
                description
                  "Password for connecting the backup server.";
              }
    
              leaf path {
                type string {
                  length "1..64";
                }
                description
                  "Path for backing up the configuration file.";
              }
    
              leaf port {
                when
                  "not(../transport-type='tftp')";
                type uint16 {
                  range "1..65535";
                }
                description
                  "Port of a backup server.";
              }
            }  // list backup-server
          }  // container backup-servers
    
          container startup-infos {
            config false;
            description
              "List of information about system startup.";
            list startup-info {
              key "position";
              config false;
              description
                "Operational state of information about a system startup.";
              leaf position {
                type string {
                  length "0..32";
                }
                config false;
                description
                  "Position of the device.";
              }
    
              leaf configed-system-software {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "File name of the system software that is set by users for the current startup.";
              }
    
              leaf current-system-software {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "File name of the system software that is applied for the current startup.";
              }
    
              leaf next-system-software {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "File name of the system software that is applied for the next startup.";
              }
    
              leaf current-cfg-file {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "Name of the configuration file that is applied for the current startup.";
              }
    
              leaf next-cfg-file {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "Name of the configuration file that is applied for the next startup.";
              }
    
              leaf current-patch-file {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "Name of the patch file that is applied for the current startup.";
              }
    
              leaf next-patch-file {
                type string {
                  length "0..255";
                }
                config false;
                description
                  "Name of the patch file that is applied for the next startup.";
              }
            }  // list startup-info
          }  // container startup-infos
    
          container cfg-files {
            config false;
            description
              "List of configuration files.";
            list cfg-file {
              key "filename";
              config false;
              description
                "Operational state of the specified configuration file that a user can set for the next startup or the information about the difference to current configuration.";
              leaf filename {
                type string {
                  length "5..64";
                }
                config false;
                description
                  "Name of a configuration file.";
              }
    
              leaf size {
                type uint32;
                units "Byte";
                config false;
                description
                  "Size of a configuration file.";
              }
    
              leaf create-time {
                type yang:date-and-time;
                config false;
                description
                  "Time when a configuration file was created, for example, 2010-11-04 20:01:38 +08:00.";
              }
    
              container file-current-changes {
                config false;
                description
                  "List of differences between a specified configuration file and the current configuration.";
                list file-current-change {
                  key "index";
                  config false;
                  description
                    "Operational state of a specified configuration file different with the current configuration.";
                  leaf index {
                    type uint32;
                    config false;
                    description
                      "Index of the configuration difference. Each configuration difference has an index.";
                  }
    
                  leaf config-change {
                    type string {
                      length "1..3200";
                    }
                    config false;
                    description
                      "Configuration difference command.";
                  }
                }  // list file-current-change
              }  // container file-current-changes
            }  // list cfg-file
          }  // container cfg-files
    
          container config-rollback-result {
            config false;
            description
              "Operational state of rollbacking configuration result.";
            anydata result {
              description
                "The result of rollbacking configuration.";
            }
          }  // container config-rollback-result
    
          container config-recover-results {
            config false;
            description
              "List of all configuration restoration results in the system.";
            list config-recover-result {
              key "index";
              config false;
              description
                "Operational state of configuration restoration result in the system.";
              leaf index {
                type uint32;
                config false;
                description
                  "Index of a configuration command. Each failure command is identified by an index.";
              }
    
              leaf command {
                type string {
                  length "1..2047";
                }
                config false;
                description
                  "Configure the command that fails to be restored.";
              }
    
              leaf view {
                type string {
                  length "1..80";
                }
                config false;
                description
                  "View of a command that fails to be restored.";
              }
    
              leaf line {
                type uint32;
                config false;
                description
                  "Row number of a command that fails to be restored in a file.";
              }
    
              leaf reason {
                type command-result;
                config false;
                description
                  "Cause of the configuration restoration failure command.";
              }
    
              leaf time {
                type yang:date-and-time;
                config false;
                description
                  "The command failed to be executed during configuration restoration.";
              }
            }  // list config-recover-result
          }  // container config-recover-results
    
          container configuration-backup-to-file {
            presence
              "Enable configuration-backup-to-file";
            description
              "Configure the start-time and interval for cycle backup the current configuration operation.";
            leaf interval-time {
              type uint32 {
                range "1..7";
              }
              default "1";
              description
                "The system automatically backups configurations every a specified interval day.";
            }
    
            leaf start-time {
              type pub-type:time-hhmm {
                length "3..5";
                pattern
                  '(([0-1][0-9])|(2[0-3])|[0-9]):([0-5][0-9]|[0-9])';
              }
              units "min";
              default "05:00";
              description
                "The system automatically backups running configuration at a specified time of the day.";
            }
          }  // container configuration-backup-to-file
    
          container config-change {
            config false;
            description
              "Operational state of SN of a configuration change. The SN increases by 1 for each configuration change.";
            leaf flow-id {
              type uint32;
              config false;
              description
                "SN of the current configuration change of the system.";
            }
    
            leaf baseline-time {
              type yang:date-and-time;
              config false;
              description
                "Time when the system configuration has a major change, for example, 2012-07-19 14:57:44 +08:00.";
            }
          }  // container config-change
    
          container trial-status {
            config false;
            description
              "Operational state of trial running status of the system, including the status value and remaining time.";
            leaf status {
              type cfg-trial-status;
              config false;
              description
                "Including INACTIVE, ACTIVE, CANCELING, and WAITCANCEL.";
            }
    
            leaf time-left {
              type uint32;
              units "s";
              default "0";
              config false;
              description
                "Remaining trial running time.";
            }
    
            leaf persist-id {
              type string {
                length "1..256";
              }
              config false;
              description
                "Persistence id of test running.";
            }
          }  // container trial-status
        }  // container cfg
    
        rpc save {
          description
            "Save the current configuration to file.";
          input {
            leaf filename {
              type string {
                length "5..64";
              }
              mandatory true;
              description
                "Name of a configuration file.";
            }
    
            leaf shareable-mode {
              type shareable-type;
              description
                "Specifies the shareable type for encrypting a configuration file.";
            }
    
            leaf password {
              when
                "../shareable-mode = 'password'";
              type pub-type:password-extend {
                length "8..128";
              }
              description
                "Specifies the password for encrypting a configuration file.";
            }
          }
        }  // rpc save
    
        rpc cfg-file-backup-and-recovery {
          description
            "Back up the device configuration to a server or restore the configuration from a server to the next startup configuration file of the device.";
          input {
            leaf index {
              type uint32 {
                range "1..2147483647";
              }
              mandatory true;
              description "Operation ID.";
            }
    
            leaf operation-type {
              type cfg-operation-type;
              mandatory true;
              description
                "Back up the running configuration of the device to a specified server or restore the configuration from a specified server to the next startup file of the device.";
            }
    
            leaf filename {
              type string {
                length "5..128";
              }
              description
                "Name of a configuration file.";
            }
    
            leaf transport-type {
              type cfg-transport-type;
              mandatory true;
              description
                "Type of the protocol for transporting the backup file.";
            }
    
            leaf server-ip {
              when
                "not(../transport-type='http')";
              type inet:ip-address-no-zone;
              mandatory true;
              description
                "Server IP address for backing up the configuration file.";
            }
    
            leaf username {
              when
                "not(../transport-type='tftp')";
              type string {
                length "1..85";
              }
              description
                "User name for connecting a server, for example, an FTP server.";
            }
    
            leaf password {
              when
                "not(../transport-type='tftp')";
              type pub-type:password;
              description
                "Password for connecting a server, for example, an FTP server.";
            }
    
            leaf vpn-instance {
              type string {
                length "1..31";
              }
              description
                "Name of a VPN instance.";
            }
    
            leaf use-net-manager-vpn {
              type boolean;
              default "false";
              description
                "Whether a global VPN is used.";
            }
    
            leaf port {
              when
                "(../transport-type='ftp' or ../transport-type='sftp')";
              type uint16 {
                range "1..65535";
              }
              description
                "Port of a backup server.";
            }
    
            leaf url {
              when "../transport-type = 'http'";
              type string {
                length "1..256";
              }
              mandatory true;
              description
                "The URL path of the configuration file.";
            }
          }
        }  // rpc cfg-file-backup-and-recovery
    
        rpc clear-startup {
          ext:node-ref "/cfg/cfg-files/cfg-file";
          description
            "Cancel the startup file settings. The current and next startup file settings will be empty.";
        }  // rpc clear-startup
    
        rpc clear-interface-config {
          ext:node-ref "/ifm/interfaces/interface";
          description
            "Clear configurations on the interface.";
          input {
            leaf interface-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description "Interface name.";
            }
          }
        }  // rpc clear-interface-config
    
        rpc delete-checkpoint-by-oldest-num {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Delete the oldest checkpoints.";
          input {
            leaf checkpoint-num {
              type uint8 {
                range "1..80";
              }
              description
                "Number of configuration checkpoints that are deleted.";
            }
          }
        }  // rpc delete-checkpoint-by-oldest-num
    
        rpc rollback-by-commit-id {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Rollback the system configuration to a specified checkpoint.";
          input {
            leaf commit-id {
              type leafref {
                path "/cfg:cfg/cfg:checkpoints/cfg:checkpoint/cfg:commit-id";
              }
              description
                "ID of a configuration checkpoint.";
            }
          }
        }  // rpc rollback-by-commit-id
    
        rpc rollback-by-user-label {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Rollback the system configuration to a specified checkpoint by user label.";
          input {
            leaf commit-id {
              type leafref {
                path "/cfg:cfg/cfg:checkpoints/cfg:checkpoint/cfg:commit-id";
              }
              description
                "ID of a configuration checkpoint.";
            }
    
            leaf user-label {
              type leafref {
                path "/cfg:cfg/cfg:checkpoints/cfg:checkpoint/cfg:user-label";
              }
              description
                "Label of a configuration checkpoint.";
            }
          }
        }  // rpc rollback-by-user-label
    
        rpc rollback-by-last-num {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Rollback the configurations of several checkpoints.";
          input {
            leaf checkpoint-num {
              type uint8 {
                range "1..80";
              }
              description
                "Number of configuration checkpoints that are rolled back.";
            }
          }
        }  // rpc rollback-by-last-num
    
        rpc rollback-by-file {
          ext:node-ref "/cfg/cfg-files/cfg-file";
          description
            "Rollback the configuration with a specified configuration file.";
          input {
            leaf filename {
              type leafref {
                path "/cfg:cfg/cfg:cfg-files/cfg:cfg-file/cfg:filename";
              }
              mandatory true;
              description
                "Name of a configuration file.";
            }
          }
        }  // rpc rollback-by-file
    
        rpc save-all-virtual-systems {
          description
            "Saving all virtual-systems to the next startup file.";
        }  // rpc save-all-virtual-systems
    
        rpc set-startup {
          ext:node-ref "/cfg/cfg-files/cfg-file";
          description
            "Configure an existing configuration file as the startup file.";
          input {
            leaf filename {
              type leafref {
                path "/cfg:cfg/cfg:cfg-files/cfg:cfg-file/cfg:filename";
              }
              mandatory true;
              description
                "Name of a configuration file.";
            }
    
            leaf shareable-mode {
              type shareable-type;
              description
                "Specifies the shareable type for decrypting a configuration file.";
            }
    
            leaf password {
              when
                "../shareable-mode = 'password'";
              type pub-type:password-extend {
                length "8..128";
              }
              description
                "Specifies the password for decrypting a configuration file.";
            }
          }
        }  // rpc set-startup
    
        rpc set-user-label-by-commit-id {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Set the user label of a specified configuration checkpoint.";
          input {
            leaf commit-id {
              type leafref {
                path "/cfg:cfg/cfg:checkpoints/cfg:checkpoint/cfg:commit-id";
              }
              mandatory true;
              description
                "ID of a configuration checkpoint.";
            }
    
            leaf user-label {
              type string {
                length "1..256";
                pattern '.*[^\s]+.*';
              }
              mandatory true;
              description
                "Label of a configuration checkpoint.";
            }
          }
        }  // rpc set-user-label-by-commit-id
    
        rpc create-user-label-checkpoint {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Create the checkpoint of a specified label.";
          input {
            leaf user-label {
              type string {
                length "1..256";
                pattern '.*[^\s]+.*';
              }
              mandatory true;
              description
                "Label of a configuration checkpoint.";
            }
    
            leaf description {
              type string {
                length "1..60";
              }
              description
                "Description of a configuration checkpoint.";
            }
          }
        }  // rpc create-user-label-checkpoint
    
        rpc delete-user-label-checkpoint {
          ext:node-ref "/cfg/checkpoints/checkpoint";
          description
            "Delete the checkpoint of a specified label.";
          input {
            leaf commit-id {
              type leafref {
                path "/cfg:cfg/cfg:checkpoints/cfg:checkpoint/cfg:commit-id";
              }
              description
                "ID of a configuration checkpoint.";
            }
          }
        }  // rpc delete-user-label-checkpoint
    
        rpc load-configuration-to-candidate {
          description
            "Load local configuration file or the configuration file on a remote server and delivers configurations to the local device.";
          input {
            leaf config-type {
              type load-config-type;
              description
                "Type of loading configuration.";
            }
    
            choice server-type {
              description
                "Type of the protocol for loading the file.";
              case local {
                description "Local system.";
                leaf local-filename {
                  type string {
                    length "1..128";
                  }
                  description
                    "Configuration file name of the local system.";
                }
              }  // case local
    
              case ftp {
                description "FTP protocol.";
                leaf ftp-server-ip {
                  type inet:ip-address-no-zone;
                  description
                    "IP address of the remote FTP server.";
                }
    
                leaf ftp-username {
                  type string {
                    length "1..64";
                  }
                  description
                    "User name for logging in to the remote FTP server.";
                }
    
                leaf ftp-password {
                  type pub-type:password-extend {
                    length "1..432";
                  }
                  description
                    "Password for logging in to the remote FTP server.";
                }
    
                leaf ftp-vpn-instance {
                  type string {
                    length "1..31";
                  }
                  description
                    "VPN instance name of the remote FTP server.";
                }
    
                leaf ftp-filename {
                  type string {
                    length "1..128";
                  }
                  description
                    "Configuration file name of the remote FTP server.";
                }
              }  // case ftp
    
              case sftp {
                description "SFTP protocol.";
                leaf sftp-server-ip {
                  type inet:ip-address-no-zone;
                  description
                    "IP address of the remote SFTP server.";
                }
    
                leaf sftp-username {
                  type string {
                    length "1..64";
                  }
                  description
                    "User name for logging in to the remote SFTP server.";
                }
    
                leaf sftp-password {
                  type pub-type:password-extend {
                    length "1..432";
                  }
                  description
                    "Password for logging in to the remote SFTP server.";
                }
    
                leaf sftp-vpn-instance {
                  type string {
                    length "1..31";
                  }
                  description
                    "VPN instance name of the remote SFTP server.";
                }
    
                leaf sftp-filename {
                  type string {
                    length "1..128";
                  }
                  description
                    "Configuration file name of the remote SFTP server.";
                }
              }  // case sftp
    
              case http {
                description "HTTP protocol.";
                leaf http-url {
                  type string {
                    length "1..255";
                  }
                  description
                    "The URL of the remote HTTP server.";
                }
    
                leaf http-vpn-instance {
                  type string {
                    length "1..31";
                  }
                  description
                    "VPN instance name of the remote HTTP server.";
                }
              }  // case http
            }  // choice server-type
          }
        }  // rpc load-configuration-to-candidate
    
        rpc load-configuration-to-candidate-result {
          description
            "Operational state of loading configuration result.";
          output {
            anydata result {
              description
                "The result of loading configuration.";
            }
          }
        }  // rpc load-configuration-to-candidate-result
      }  // module huawei-cfg
    

© 2023 YumaWorks, Inc. All rights reserved.