POST /resourceGroups

Use the POST method to create and populate a single resource group.

Note: This API requires Lenovo XClarity Administrator v2.0.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

POST https://<management_server_IP>/resourceGroups

Query parameters

None

Request body

Attributes Required / Optional Type Description
criteria Required if type is "dynamic" Object (Dynamic groups only) Information about a simple criteria object or criteria set that select which managed devices are members of the dynamic group
Simple criteria is a query (logical rule) that compares property values. The following example selects managed devices whose contact is John@company.com.
{
   "property": "contact",
   "operator": "equals",
   "value": "John@company.com",
}
A criteria set is the root of the tree structure that defines how the simple criteria are logically combined, using Boolean AND and OR relationships. The following example shows a criteria set that logically combines two simple criteria with an AND relationship. It selects managed devices whose contact is John@company.com and are in the Critical state.
{
   "operator": "AND",
   "criteria": [{
      "property": "contact",
      "operator": "equals",
      "value": "John@company.com"
   },
   {
      "property": "overallHealthState",
      "operator": "equals",
      "value": "Critical"
   }]
}
  criteria Required only for criteria sets Array of objects Nested criteria that defines the members of the dynamic group. Array elements can be a combination of simple criteria or criteria set objects.
  id Required String ID of the simple criteria or criteria set object
  operator Required String Operator

For criteria, you can obtain a list of valid operator values for each property using GET /resourceGroups/criteriaProperties.

For criteria sets, this can be one of the following values:
  • AND. Members must satisfy all specified values.

  • OR. Members must satisfy one or more of the specified values.

  parent Required String ID of the parent criteria set. This is "root" when the criteria or criteria set is not nested.
  property Required only for simple criteria String Inventory property. To obtain a list of properties, use GET /resourceGroups/criteriaProperties.
  value Required only for simple criteria String Value of the property
description Required String Description of the resource group
members Required if type is "static" Array of strings (Static groups only) Zero or more URIs for all managed devices that are members of this resource group

URIs that are specified for devices that are not managed by Lenovo XClarity Administrator are not included in the group. Check the members response attribute to determine the members that were added to the group.

name Required String Unique name of the resource group. The name can be 1 – 64 characters except the % & < > / characters.
preview Optional Boolean Indicates whether to return members of the resulting group without actually creating the group. This can be one of the following values.
  • true. Returns a list of managed devices that are members of the resulting group without creating the group. For dynamic groups, the members consist of the managed devices that satisfy the criteria at the time that the GET request is performed.

  • false. (default) Creates the resource group.

type Required String The type of resource group. This can be one of the following values.
  • static

  • dynamic

Request example

The following example creates a static group with two members.
{
   "description": "Business application VMware clusters",
   "members": [
      "nodes/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "nodes/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" 
   ],
   "name": "e-Commerce Servers",
   "type": "static",
}
The following example returns members of a dynamic group based on a set of criteria without creating the group.
{
   "criteria": {
      "criteria": [{
         "id": "1000",
         "operator": "equals",
         "parent": "root",
         "property": "overallHealthState",
         "value": "Critical"
      },
      {
         "id": "1002",
         "operator": "contains",
         "parent": "root",
         "property": "location.location",
         "value": "Lab10"
      },
      {
         "id": "1002",
         "operator": "contains",
         "parent": "root",
         "property": "location.rack",
         "value": "rack1"
      },
      {
         "criteria": [{
            "id": "1004",
            "operator": "contains",
            "parent": "1003",
            "property": "machineType",
            "value": "7X07"
         },
         {
            "id": "1005",
            "operator": "contains",
            "parent": "1003",
            "property": "machineType",
            "value": "7X08"
         }],
         "id": "1003",
         "operator": "OR",
         "parent": "root"
      }],
      "id": "root",
      "operator": "AND",
      "parent": "root"
   },
   "description": "All ThinkSystem SR530 servers in room 1 in Lab10 that have critical errors",
   "members": null,
   "name": "Critical SR530 servers",
   "preview": true,
   "type": "dynamic"
}

Response codes

Code Description
200 OK
400 Bad request
401 Unauthorized
403 Forbidden
404 Not found
409 Conflict
500 Internal server error

Response body

Attributes Type Description
criteria Object (Dynamic groups only) Information about a simple criteria object or criteria set that select which managed devices are members of the dynamic group
Simple criteria is a query (logical rule) that compares property values. The following example selects managed devices whose contact is John@company.com.
{
   "property": "contact",
   "operator": "equals",
   "value": "John@company.com",
}
A criteria set is the root of the tree structure that defines how the simple criteria are logically combined, using Boolean AND and OR relationships. The following example shows a criteria set that logically combines two simple criteria with an AND relationship. It selects managed devices whose contact is John@company.com and are in the Critical state.
{
   "operator": "AND",
   "criteria": [{
      "property": "contact",
      "operator": "equals",
      "value": "John@company.com"
   },
   {
      "property": "overallHealthState",
      "operator": "equals",
      "value": "Critical"
   }]
}
  criteria Array of objects Nested criteria or criteria set that defines the members of the dynamic group. Array elements can be a combination of simple criteria or criteria set objects.
  id String ID of the simple criteria or criteria set object
  operator String Operator

For criteria, you can obtain a list of valid operator values for each property using GET /resourceGroups/criteriaProperties.

For criteria sets. This can be one of the following values.
  • AND. Members must satisfy all specified values.

  • OR. Members must satisfy one or more of the specified values.

  parent String ID of the parent criteria set. This is "root" when the criteria or criteria set is not nested.
  property String Inventory property. To obtain a list of properties, use GET /resourceGroups/criteriaProperties.
  value String Value of the property
description String Description of the resource group
healthStatus String Status of the device with the highest severity. This can be one of the following values.
  • Normal
  • Non-Critical
  • Warning
  • Minor-Failure
  • Major-Failure
  • Non-Recoverable
  • Critical
  • Unknown
members Array of strings URIs for all managed devices that are members of this resource group

Members are automatically removed from the group if the device is not managed by Lenovo XClarity Administrator. For dynamic groups, the members consist of the managed devices that satisfy the criteria at the time that the GET request is done.

memberUuids Array of strings UUIDs for all managed devices that are members of this resource group
name String Unique name of the resource group
preview Boolean (Preview mode only) This value is always true, indicating that preview was specified and that the response is a list of members of the resulting group, but the group was not actually created
type String Type of resource group. This can be one of the following values.
  • static

  • dynamic

uuid String Resource group UUID

Response example

The following example is returned for a static group.
{
   "criteria": null,
   "description": "Business application VMware clusters",
   "healthStatus": "Normal",
   "members": [
      "nodes/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "nodes/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" 
   ],
   "memberUuids": [
      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
   ],
   "name": "e-Commerce Servers",
   "query": null
   "rsql": null,
   "type": "static",
   "uuid": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
}
The following example is returned to preview the members of a dynamic group.
{
   "criteria": {
      "criteria": [{
         "id": "1000",
         "operator": "equals",
         "parent": "root",
         "property": "overallHealthState",
         "value": "Critical"
      },
      {
         "id": "1002",
         "operator": "contains",
         "parent": "root",
         "property": "location.location",
         "value": "Lab10"
      },
      {
         "id": "1002",
         "operator": "contains",
         "parent": "root",
         "property": "location.rack",
         "value": "rack1"
      },
      {
         "criteria": [{
            "id": "1004",
            "operator": "contains",
            "parent": "1003",
            "property": "machineType",
            "value": "7X07"
         },
         {
            "id": "1005",
            "operator": "contains",
            "parent": "1003",
            "property": "machineType",
            "value": "7X08"
         }],
         "id": "1003",
         "operator": "OR",
         "parent": "root"
      }],
      "id": "root",
      "operator": "AND",
      "parent": "root"
  },
   "description": "All ThinkSystem SR530 servers in room 1 in Lab10 that have critical errors",
   "healthStatus": "Normal",
   "members": [
      "nodes/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "nodes/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", 
      "nodes/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
   ],
   "memberUuids": [
      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", 
      "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
   ],
   "name": "Critical SR530 servers",
   "preview": true,
   "type": "dynamic",
   "uuid": "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"
}