Time‑Range
此内容尚不支持你的语言。
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>