跳转到内容
Ask AI

Time-Range-Netconf

此内容尚不支持你的语言。

YANG Pathget/get-configedit-configrpc
/time-ranges/{name}Ymerge, replace, create, delete—

This chapter provides examples on how to use Netconf to manage time-range configurations on AsterNOS devices.

Request example to create absolute time-range from 2021.1.1 12:00:00 to 2022.1.1 13:30:00 via edit-config

<config>
<top>
<time-ranges>
<time-range operation="create">
<name>aaa</name>
<start-date-time>2021-01-01T12:00:00+00:00</start-date-time>
<end-date-time>2022-01-01T13:30:00+00:00</end-date-time>
</time-range>
</time-ranges>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2f880f91-868f-4b78-aa54-a94afa785a98">
<ok/>
</rpc-reply>

Request example to create cyclic time-range from 12:00:00 to 13:30:00 on every Sunday and Monday via edit-config

<config>
<top>
<time-ranges>
<time-range operation="create">
<name>bbb</name>
<days-in-week>sunday monday</days-in-week>
<start>12:00</start>
<end>13:30</end>
</time-range>
</time-ranges>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6b4b5b1a-1e93-4cc4-8043-714b2ff288b0">
<ok/>
</rpc-reply>

Request example to get time-range via get-config

<filter type="subtree">
<top>
<time-ranges/>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e0bd9579-b5b7-4133-8695-9c0c8308c36f">
<data>
<top>
<time-ranges xmlns="http://asterfusion.com/ns/yang/asternos-time-range">
<time-range>
<name>aaa</name>
<start-date-time>2021-01-01T12:00:00+00:00</start-date-time>
<end-date-time>2022-01-01T13:30:00+00:00</end-date-time>
</time-range>
<time-range>
<name>bbb</name>
<days-in-week>sunday monday</days-in-week>
<start>12:00</start>
<end>13:30</end>
</time-range>
</time-ranges>
</top>
</data>
</rpc-reply>

Request example to delete aaa time-range via edit-config

<config>
<top>
<time-ranges>
<time-range operation="delete">
<name>aaa</name>
</time-range>
</time-ranges>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:72d8d2b5-f28a-4e90-bde7-0469f2970b40">
<ok/>
</rpc-reply>

Tree Diagram

module: asternos-time-range
+--rw time-ranges
+--rw time-range* [name]
+--rw name string
+--rw (absolute-cyclic)?
+--:(absolute-range)
| +--rw start-date-time? yang:date-and-time
| +--rw end-date-time? yang:date-and-time
+--:(cyclic-range)
+--rw days-in-week? bits
+--rw start? time-hhmm
+--rw end? time-hhmm

Table of Properties

NameRequiredType/RangeDescription
time-rangesMPath-only node, has no configurable value.
time-rangeMPath-only node, has no configurable value.
The time-range instances.
nameONoneThe name of time range instance.
start-date-timeOyang:date-and-timeThe start date and time.

The format can be two types:

1.2023-10-05T14:48:30.123+08:00, it means 14:48:30.123 on October 5, 2023, East 8th District time.

2.2023-10-05T14:48:00Z, it means 14:48:00 on October 5, 2023, UTC time.

Limitation: second, microsecond and timezone is not supported.
end-date-timeOyang:date-and-timeThe end date and time, same as the description in start-date-time
days-in-weekO”sunday"
"monday"
"tuesday"
"wednesday"
"thursday"
"friday"
"saturday”
A set of days-in-week flags, multiple inputs should be separated by spaces
startOTime string with format ‘hh:mm’. ‘hh’ is hour, ‘mm’ is minute. Its range is from 00:00 to 23:59.The start time of a day.
endOTime string with format ‘hh:mm’. ‘hh’ is hour, ‘mm’ is minute. Its range is from 00:00 to 23:59.The end time of a day.