No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Time Management

Time Management

This section describes the configuration model of time management and provides examples of XML packets.

Data Model

The configuration model file matching time management is ietf-system.yang.

Table 2-63  Configuring time management

Object

Description

Value Remarks

/ietf-system:system/clock/timezone/timezone-utc-offset/timezone-utc-offset

Indicates the timezone offset.

The value is an integer that range from -720 to 840, unit is minutes.

NA

/ietf-system:set-current-datetime/current-datetime

Indicates the current system date and time.

The format is as follows:
  • YYYY-MM-DDTHH:MM:SS+HH:MM
  • YYYY-MM-DDTHH:MM:SS-HH:MM
  • YYYY-MM-DDTHH:MM:SSZ
In the preceding formats:
  • YYYY specifies the year. The value is an integer that ranges from 2000 to 2037.
  • MM indicates the month. The value is an integer that ranges from 1 to 12.
  • DD indicates the day. The value is an integer that ranges from 1 to 31.
  • T indicates the time following the year, month, and day.
  • HH indicates the hour. The value is an integer that ranges from 0 to 23.
  • MM indicates the minute. The value is an integer that ranges from 0 to 59.
  • SS indicates the second. The value is an integer that ranges from 0 to 59.
  • + indicates the hour and minute later than the time followed by it.
  • - indicates the hour and minute earlier than the time followed by it.
  • Z indicates that the time followed by it is the time in time zone 0.

NA

Configuring the System Time Zone

This section describes how to configure the timezone using the create method.

Table 2-64  Configuring the system time zone

Operation

XPATH

edit-config:create

/ietf-system:system/clock/timezone/timezone-utc-offset/timezone-utc-offset

Data requirement

Table 2-65  Configuring the system time zone

Item

Data

Description

Timezone offset

480 minutes.

Indicates the timezone GMT+08:00.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="39" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <sys:system xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system">
        <sys:clock>
          <sys:timezone-utc-offset>480</sys:timezone-utc-offset>
        </sys:clock>
      </sys:system>
    </config>
  </edit-config>
</rpc>

Response example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="39">
  <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="40">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error
</rpc-reply>

Configuring the System Date and Time

This section provides a sample of configuring the system date and time using the rpc method.

Table 2-66  Configuring the system time

Operation

XPATH

rpc

/ietf-system:set-current-datetime/current-datetime

Data Requirements

Table 2-67  Configuring the system time

Item

Data

Description

System data and time

2000-01-01T00:00:00-12:00

Set the system date and time to 2000-01-01 12:00:00.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6fa5610f-6adf-11e7-8676-879e0ca0e2bd">
 <sys:set-current-datetime xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system">
  <sys:current-datetime>2000-01-01T00:00:00-12:00</sys:current-datetime>
 </sys:set-current-datetime>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6fa5610f-6adf-11e7-8676-879e0ca0e2bd">
 <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="40">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-10-18

Document ID: EDOC1000178028

Views: 5141

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next