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 V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG 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 Range Management

Time Range Management

If some services or functions need to be started at intervals or periodically, time ranges can be configured. This section describes the configuration model of time range management and provides examples of XML packets.

Data Model

The configuration model file for time range management is huawei-time-range.yang.

Table 2-251  Time Range management

Object

Description

Value

Remarks

/huawei-time-range:time-ranges/time-range/name

Indicates the name of a time range.

The value is a string of 1 to 32 case-sensitive characters without spaces and must begin with a letter. In addition, the word all cannot be specified as a time range name.

N/A

/huawei-time-range:time-ranges/time-range/vsys

Indicates the vsys name.

The value is a string of 1 to 31 characters.

N/A

/huawei-time-range:time-ranges/time-range/period-time/start

Indicates the start time of the time range.

The value is in the format of hh:mm:ss.
  • 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.

N/A

/huawei-time-range:time-ranges/time-range/period-time/end

Indicates the end time of the time range.

The value is in the format of hh:mm:ss.
  • 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.

The end time must be later than the start time.

/huawei-time-range:time-ranges/time-range/period-time/weekday

Indicates the validity period of the time range.

The value is the enumerated type and case-sensitive. The options include sunday, monday, tuesday, wednesday, thursday, friday, and saturday.

N/A

/huawei-time-range:time-ranges/time-range/absolute-time/start

Indicates the start time in a day.

It is a UTC time in the format of YYYY-MM-DD hh:mm:ss.
  • YYYY indicates the year. The value is an integer that ranges from 1970 to 2099.
  • 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.
  • 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.

N/A

/huawei-time-range:time-ranges/time-range/absolute-time/end

Indicates the end time in a day.

It is a UTC time in the format of YYYY-MM-DD hh:mm:ss.
  • YYYY indicates the year. The value is an integer that ranges from 1970 to 2099.
  • 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.
  • 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.

The end time must be later than the start time. If no end time is configured, the device uses the allowed maximum value.

Configuring a Time Range

This section describes how to configure, modify, and delete a time range using the edit-config method.

Table 2-252  Configuring an ACL rule

Operation

XPATH

edit-config:create

edit-config:replace

edit-config:delete

  • /huawei-time-range:time-ranges/time-range/name
  • /huawei-time-range:time-ranges/time-range/period-time
  • /huawei-time-range:time-ranges/time-range/absolute-time
Data Requirement 1: Creating Time Range test

Item

Data

Description

Time range name

test

Create a time range named test.

Start time of the time range

8:00:00

Set the start time of the time range to 8:00:00.

End time of the time range

17:30:00

Set the end time of the time range to 17:30:00.

Validity period

wednesday

Configure the ACL rule to take effect on every Wednesday.

Start time in a day

2013-11-11T11:11:11+08:00

Set the start time in a day to 2013-11-11T11:11:11+08:00.

End time in a day

2017-11-11T11:11:11+08:00

Set the end time in a day to 2017-11-11T11:11:11+08:00.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-time-range:time-ranges xmlns:hw-time-range="urn:huawei:params:xml:ns:yang:huawei-time-range">
        <hw-time-range:time-range>
          <hw-time-range:vsys>public</hw-time-range:vsys>
          <hw-time-range:name>test</hw-time-range:name>
          <hw-time-range:period-time>
            <hw-time-range:start>8:00:00</hw-time-range:start>
            <hw-time-range:end>17:30:00</hw-time-range:end>
            <hw-time-range:weekday>wednesday</hw-time-range:weekday>
            <hw-time-range:weekday>thursday</hw-time-range:weekday>
          </hw-time-range:period-time>
          <hw-time-range:absolute-time>
            <hw-time-range:start>2013-11-11T11:11:11+08:00</hw-time-range:start>
            <hw-time-range:end>2017-11-11T11:11:11+08:00</hw-time-range:end>
          </hw-time-range:absolute-time>
        </hw-time-range:time-range>
      </hw-time-range:time-ranges>
    </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="3">
  <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="3">
  <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>
Data Requirement 2: Modifying the Validity Period of the Time Range test

The following provides only the item to be modified. For other items, see data requirement 1.

Item

Data

Description

Validity period

thursday

Modify the validity period from Wednesday to Thursday.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-time-range:time-ranges xmlns:hw-time-range="urn:huawei:params:xml:ns:yang:huawei-time-range">
        <hw-time-range:time-range>
          <hw-time-range:vsys>public</hw-time-range:vsys>
          <hw-time-range:name>test</hw-time-range:name>
          <hw-time-range:period-time>
            <hw-time-range:start>8:00:00</hw-time-range:start>
            <hw-time-range:end>17:30:00</hw-time-range:end>
            <hw-time-range:weekday xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="replace">thursday</hw-time-range:weekday>
          </hw-time-range:period-time>
          <hw-time-range:absolute-time>
            <hw-time-range:start>2013-11-11T11:11:11+08:00</hw-time-range:start>
            <hw-time-range:end>2017-11-11T11:11:11+08:00</hw-time-range:end>
          </hw-time-range:absolute-time>
        </hw-time-range:time-range>
      </hw-time-range:time-ranges>
    </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="3">
  <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>
Data Requirement 3: Deleting Time Range test

The following provides only the item to be modified. For other items, see data requirement 1.

Item

Data

Description

Time range name

test

N/A

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-time-range:time-ranges xmlns:hw-time-range="urn:huawei:params:xml:ns:yang:huawei-time-range">
        <hw-time-range:time-range xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
          <hw-time-range:vsys>public</hw-time-range:vsys>
          <hw-time-range:name>test</hw-time-range:name>
          <hw-time-range:period-time>
            <hw-time-range:start>8:00:00</hw-time-range:start>
            <hw-time-range:end>17:30:00</hw-time-range:end>
            <hw-time-range:weekday>thursday</hw-time-range:weekday>
          </hw-time-range:period-time>
          <hw-time-range:absolute-time>
            <hw-time-range:start>2013-11-11T11:11:11+08:00</hw-time-range:start>
            <hw-time-range:end>2017-11-11T11:11:11+08:00</hw-time-range:end>
          </hw-time-range:absolute-time>
        </hw-time-range:time-range>
      </hw-time-range:time-ranges>
    </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="3">
  <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="42">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>edit operation failed.</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 7247

Downloads: 8

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