GLYPH<SM590000> state : A string showing the completion status of the task. Values include: 

– inProgress : The task is in progress. If supported, the “percentComplete”  Task attribute shows how far along the task is and the duration  attribute shows how long the task has been running. 

– completed : The task completed successfully. 

– failed : The task failed. To find the reason for the failure, check the event list. 

– aborted : An LCC failover caused the task to be canceled automatically. 

– canceled : A user has manually canceled the task or the library has powered off. 

GLYPH<SM590000> startTime : The time the task was started. Time format is in ISO 8601 format of “YYYY-MM-DDThh:mm:ss+-hhmm” . For example, “2018-09-17T23:02:00-0700” . 

GLYPH<SM590000> lastUpdatedTime : The time this task’s state was last updated. Time format is in ISO 8601 format of “YYYY-MM-DDThh:mm:ss+-hhmm” . For example, “2018-09-17T23:02:00-0700” . 

GLYPH<SM590000> percentComplete : A percentage value accurate to one decimal place showing how close the task is to being complete. This is an estimate of the time the task will take, not a guarantee. This is null for tasks that do not report this. 

GLYPH<SM590000> duration : An integer representing the number of seconds this task has been running so far. 

GLYPH<SM590000> user : A string showing the name of the user whose action initiated the task. 

GLYPH<SM590000> volser : For event types of “verifyMedia”  this field shows the VOLSER being verified. For other event types, this is null. 

## Inventory Tier 0 and 1 

Execute an inventory scan on the library. This starts a long-running task in the library that is visible from the GUI. 

POST /v1/tasks {“type”: ”inventoryTier0and1”, ”location”: <”library” | ”frame_F<f>”>} 

## Request body parameters 

The following list describes the parameters: 

GLYPH<SM590000> type : A string representing the task type to run. In this case “inventoryTier0and1” . 

GLYPH<SM590000> location : This can have the value of “library” , for all frames, or the location of the frame to inventory, for example,  “frame_F4” . 

When the POST /v1/tasks {“type”: ”inventoryTier0and1”, ”location”: ”frame_F<f>”>} command runs successfully, the system returns output to your display as shown in Example 6-18. 

[root@TRON scripts]# /usr/bin/sg_write_buffer --id=0x10 --mode=2 --raw /dev/sg70<<<'POST /v1/tasks/ {"type": "inventoryTier0and1", "location": "frame_F1"}' /usr/bin/sg_read_buffer --id=0x11 --mode=2 --length=0x100000 --raw /dev/sg70 {"ID": "331"} 

Task ID 331 was generated and you can see that inventory has started for Frame 1 at the Web GUI. You can also determine the status and progress using the GET /v1/tasks/331 command. 

