---
title: Time‑Range
slug: enterprise-v6p1/timerange
createdAt: 2025-12-18T08:44:46.315Z
---

# <font color="#1d50a2">AsterNOS-Time-Range</font>

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

## <font color="#1d50a2">Create a new absolute time-range</font>

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

```xml
<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

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

## <font color="#1d50a2">Create a new cyclic time-range</font>

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

```xml
<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

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

## <font color="#1d50a2">Get Time-range</font>

Request example to get time-range via **get-config**

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

Response example

```xml
<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>
```

## <font color="#1d50a2">Delete Specified Time-range</font>

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

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

Response example

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

