4.5
Distinct
The Distinct resource enables clients to retrieve distinct (unique) values from another MWS resource. For example, a client can request the list of all featuresReported across all nodes like this:
GET https://localhost:8080/mws/rest/distinct/nodes/featuresReported/?api-version=3
Supported Methods
Resource | GET | PUT | POST | DELETE |
---|---|---|---|---|
/rest/distinct/<resource>/<field> | Get Distinct Values | -- | -- | -- |
In this topic:
The HTTP GET method is used to retrieve distinct values from another MWS resource.
URLs and Parameters
GET https://localhost:8080/mws/rest/distinct/<resource>/<field>?api-version=3
Parameter | Required | Type | Value | Example |
---|---|---|---|---|
resource | Yes | String | The MWS resource to query. | nodes |
field | Yes | String | The field for which to return the distinct values. | featuresReported |
query | No | JSON | Determines the subset of objects from which to retrieve the distinct values. | query={"states.powerState": "On"} |

The Distinct resource has no access control of its own. Rather, it depends on the access control of the MWS resource being queried. For example, for a client to run a query like /rest/distinct/nodes/featuresReported, it must have GET rights on the Nodes resource. For more information, see Chapter 2: Access Control.
Example
Example 4-1: Get all featuresReported across all nodes
https://localhost:8080/mws/rest/distinct/nodes/featuresReported?api-version=3
------------------------------------
{
"totalCount": 1,
"resultCount": 1,
"results": ["vlan1"]
}