List Attribute Examples
This page shows example requests for working with list attributes in the PowerTSM HTTP API. It covers list attribute units, their assignments, and the values of a list attribute unit.
List Attribute Units
Section titled “List Attribute Units”Create New Unit
Section titled “Create New Unit”Request
POST /repositories/TSM_SQLSERVER/lists/unitsRequest Body
{ "type": { "identifier": 2, "storageInformation": { "repositoryName": "TSM_SQLSERVER" } }, "name": "text list attribute unit2"}2 is the id of an attribute type.
Send the same request with GET, to see a list of all available list attribute units.
Get a Specific Unit
Section titled “Get a Specific Unit”Request
GET /repositories/TSM_SQLSERVER/lists/units/{unit}The path variable unit can be the name of a list attribute unit or its ID prefixed with id:.
Update a Specific Unit
Section titled “Update a Specific Unit”Request
PUT /repositories/TSM_SQLSERVER/lists/units/{unit}Request Body
{ "type": { "identifier": 2, "storageInformation": { "repositoryName": "TSM_SQLSERVER" } }, "name": "text list attribute unit3"}The path variable unit can be the name of a list attribute unit or its ID prefixed with id:.
Delete a Specific Unit
Section titled “Delete a Specific Unit”Request
DELETE /repositories/TSM_SQLSERVER/lists/units/{unit}The path variable unit can be the name of a list attribute unit or its ID prefixed with id:. When trying to delete a list attribute unit, the request will fail if there are still attributes assigned to it. In order to delete a list attribute unit and all of its assignments, the force query parameter can be used:
DELETE /repositories/TSM_SQLSERVER/lists/units/{unit}?force=trueAttribute Assignments
Section titled “Attribute Assignments”Assign Attribute
Section titled “Assign Attribute”Request
POST /repositories/TSM_SQLSERVER/lists/units/{unit}/assignmentsRequest Body
{ "identifier": 13, "storageInformation": { "repositoryName": "TSM_SQLSERVER" }}13 is the id of an attribute of type “List”, which will be assigned to the unit in the request path.
Send the same request with GET, to see a list of all attributes assigned to the unit in the request path.
Get a Specific Assignment
Section titled “Get a Specific Assignment”Request
GET /repositories/TSM_SQLSERVER/lists/units/{unit}/assignments/{attribute}Send the same request with DELETE, to delete an existing assignment.
Update the List Attribute Unit of a Specific Assignment
Section titled “Update the List Attribute Unit of a Specific Assignment”Request
PUT /repositories/TSM_SQLSERVER/timeSeries/{timeSeries}/assignments/attributes/{assignedAttribute}/unitRequest Body
{ "identifier": 119, "storageInformation": { "repositoryName": "TSM_SQLSERVER" }}119 is the id of a list attribute unit, that will be used for the target list attribute to time series assignment. If the assignment already has data, the request will fail, unless the force query parameter is used:
PUT /repositories/TSM_SQLSERVER/timeSeries/{timeSeries}/assignments/attributes/{assignedAttribute}/unit?force=trueList Attribute Values
Section titled “List Attribute Values”Create Value
Section titled “Create Value”Request
POST /repositories/TSM_SQLSERVER/lists/units/{unit}/valuesRequest Body
{ "unit": { "identifier": 119, "storageInformation": { "repositoryName": "TSM_SQLSERVER" } }, "value": "A", "description": "value A", "sortOrder": null}- 119 is the id of a list attribute unit, to which this value will be related.
- “A” is the value of the newly created list attribute value.
- “value A” is its description.
sortOrderis optional.
Send the same request with GET, to see a list of all list attribute values referring to that unit.
Get a Specific Value
Section titled “Get a Specific Value”Request
GET /repositories/TSM_SQLSERVER/lists/units/{unit}/values/{value}Send the same request with DELETE, to delete an existing value.
Update a Specific Value
Section titled “Update a Specific Value”Request
PUT /repositories/TSM_SQLSERVER/lists/units/{unit}/values/{value}All of the list attribute value’s properties can be updated including the unit it relates to.
Delete a Specific Value
Section titled “Delete a Specific Value”Request
DELETE /repositories/TSM_SQLSERVER/lists/units/{unit}/values/{value}When trying to delete a list attribute value, the request will fail if the value is still used in any list attribute assignment data. In order to delete a list attribute value and all references to it, the force query parameter can be used:
DELETE /repositories/TSM_SQLSERVER/lists/units/{unit}/values/{value}?force=true