cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
749
Views
0
Helpful
1
Replies

API equivalent to the commit-queue prune command

lightfep1
Level 1
Level 1

I am trying to figure out what the equivalent to the following command via the API or equivalent interface, any input is appreciated 

 

NCS# devices commit-queue prune device [ LAB-ASR901-1 ]

1 Accepted Solution

Accepted Solutions

lmanor
Cisco Employee
Cisco Employee

'Prune' is an action so checking the yang model, the device is and input parameter:

 

      tailf:action prune {
        description
          "Prune the portions of all queue items that contain
           any of the devices in the input. This is a useful action to
           run when a device has been taken off-line. When we do that
           we want to ensure that no queue item remain for that
           device, possibly blocking the queue. Devices which are
           currently being committed to will not be pruned, if not
           the 'force' option is used. Atomic queue items will
           not be affected.";
        tailf:info "Prune portions of all queue items in the queue";
        tailf:actionpoint ncsinternal {
          tailf:internal;
        }
        input {
          leaf-list device {
            type leafref {
              path "/devices/device/name";
            }
          }
 

Not sure which API you are needing... for RESTCONF it would look like this:

 

$ curl -X POST -u admin:admin  -H 'Content-Type: application/yang-data+json' http://127.0.0.1:8080/restconf/operations/devices/commit-queue/prune -d '{"input":{"device":["ios-0"]}}'
{
  "tailf-ncs:output": {
    "num-matched-queue-items": 0,
    "num-deleted-queue-items": 0
  }
}
 

View solution in original post

1 Reply 1

lmanor
Cisco Employee
Cisco Employee

'Prune' is an action so checking the yang model, the device is and input parameter:

 

      tailf:action prune {
        description
          "Prune the portions of all queue items that contain
           any of the devices in the input. This is a useful action to
           run when a device has been taken off-line. When we do that
           we want to ensure that no queue item remain for that
           device, possibly blocking the queue. Devices which are
           currently being committed to will not be pruned, if not
           the 'force' option is used. Atomic queue items will
           not be affected.";
        tailf:info "Prune portions of all queue items in the queue";
        tailf:actionpoint ncsinternal {
          tailf:internal;
        }
        input {
          leaf-list device {
            type leafref {
              path "/devices/device/name";
            }
          }
 

Not sure which API you are needing... for RESTCONF it would look like this:

 

$ curl -X POST -u admin:admin  -H 'Content-Type: application/yang-data+json' http://127.0.0.1:8080/restconf/operations/devices/commit-queue/prune -d '{"input":{"device":["ios-0"]}}'
{
  "tailf-ncs:output": {
    "num-matched-queue-items": 0,
    "num-deleted-queue-items": 0
  }
}