Reorder a Queued Item

Description:

This API method provides the ability to reorder a queued item. Four reorder operations are supported:
  • up (move up by one rank)
  • down (move down by one rank)
  • first (move to the top of the queue)
  • last (move to the bottom of the queue)
In the API responses, the rank field only changes if an operation was successfully performed. A rank of 0 indicates the queued item is on top of the queue.

Usage: Search for an Item in a Specific Queue

The queued item provided in the URL must be a string match to the queued item in the database.

XML response:
http://localhost/aspera/orchestrator/api/reorder_queued_item?queue_name=CP_ENT_FFMPEG&format=xml&queued_item=test&login=admin&password=aspera&operation=up
Sample response (XML):
<Queue>
    <Queue_metadata>
        <comments>ad_hoc creation for QueueStager #37</comments>
        <administrators></administrators>
        <name>CP_ENT_FFMPEG</name>
        <paused>false</paused>
    </Queue_metadata>
    <Queued_items>
        <Queued_item>
            <updated_at>Wed Apr 29 22:06:50 UTC 2015</updated_at>
            <originator_type/>
            <id>26</id>
            <created_at>Wed Apr 29 22:06:50 UTC 2015</created_at>
            <queued_item>test</queued_item>
            <position>100</position>
            <rank>0</rank>
            <weight>0</weight>
            <originator_id>1217</originator_id>
            <item_description>test</item_description>
            <priority>100</priority>
        </Queued_item>
    </Queued_items>
</Queue>
JSON response:
http://localhost/aspera/orchestrator/api/reorder_queued_item?queue_name=CP_ENT_FFMPEG&format=json&queued_item=test&login=admin&password=aspera&operation=first
Response example (JSON):
{
   "queue":{
      "comments":"ad_hoc creation for QueueStager #21",
      "administrators":{
         "users":[],
         "groups":[
            1,
            2,
            4,
            5,
            6
         ]
      },
      "name":"Dev_QC_Action",
      "paused":false
   },
   "queued_items":[
      {
         "updated_at":"2015-12-04T08:22:40Z",
         "originator_type":null,
         "id":28,
         "created_at":"2015-12-04T08:22:40Z",
         "queued_item":"test_add",
         "position":100,
         "rank":0,
         "weight":0,
         "originator_id":null,
         "item_description":"",
         "priority":100
      }
   ]
}

Usage: Search by a Queued Item ID

The value of a queued item ID can be obtained from the Fetch Queued Items From a Queue API method or the Look Up an Item in a Queue API method.

XML response:
http://localhost/aspera/orchestrator/api/reorder_queued_item?format=xml&queued_item_id=29&login=admin&password=aspera&operation=down
Response example (XML):
<Queue>
    <Queue_metadata>
        <comments>ad_hoc creation for QueueStager #21</comments>
        <administrators>
            <group>1</group>
            <group>2</group>
            <group>4</group>
            <group>5</group>
            <group>6</group>
        </administrators>
        <name>Dev_QC_Action</name>
        <paused>false</paused>
    </Queue_metadata>
    <Queued_items>
        <Queued_item>
            <originator_type/>
            <created_at>Fri Dec 04 08:23:49 UTC 2015</created_at>
            <position>110</position>
            <rank>1</rank>
            <updated_at>Fri Dec 04 08:23:49 UTC 2015</updated_at>
            <originator_id/>
            <priority>100</priority>
            <weight>0</weight>
            <queued_item>test_add1</queued_item>
            <item_description/>
            <id>29</id>
        </Queued_item>
    </Queued_items>
</Queue>
JSON request:
http://localhost/aspera/orchestrator/api/reorder_queued_item?format=json&queued_item_id=29&login=admin&password=aspera&operation=down
Response example (JSON):
{
   "queued_items":[
      {
         "originator_type":null,
         "created_at":"2015-12-04T08:23:49Z",
         "position":110,
         "rank":1,
         "updated_at":"2015-12-04T08:23:49Z",
         "originator_id":null,
         "priority":100,
         "weight":0,
         "queued_item":"test_add1",
         "item_description":"",
         "id":29
      }
   ],
   "queue":{
      "comments":"ad_hoc creation for QueueStager #21",
      "administrators":{
         "users":[],
         "groups":[
            1,
            2,
            4,
            5,
            6
         ]
      },
      "name":"Dev_QC_Action",
      "paused":false
   }
}