Time-Range-Netconf
Time Range
Section titled “Time Range”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /time-ranges/{name} | Y | merge, replace, create, delete | — |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage time-range configurations on AsterNOS devices.
Create a new absolute time-range
Section titled “Create a new absolute time-range”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>Create a new cyclic time-range
Section titled “Create a new cyclic time-range”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>Get Time-range
Section titled “Get Time-range”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>Delete Specified Time-range
Section titled “Delete Specified Time-range”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>Properties Descriptions
Section titled “Properties Descriptions”Time Ranges
Section titled “Time Ranges”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-hhmmTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| time-ranges | M | Path-only node, has no configurable value. | |
| time-range | M | Path-only node, has no configurable value. The time-range instances. | |
| name | O | None | The name of time range instance. |
| start-date-time | O | yang:date-and-time | The 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-time | O | yang:date-and-time | The end date and time, same as the description in start-date-time |
| days-in-week | O | ”sunday" "monday" "tuesday" "wednesday" "thursday" "friday" "saturday” | A set of days-in-week flags, multiple inputs should be separated by spaces |
| start | O | Time 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. |
| end | O | Time 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. |