PATCH /resourceGroups/<UUID>

Use this PATCH method to add or remove devices from a static resource group.

Note: This API requires Lenovo XClarity Administrator 2.0.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

PATCH https://<management_server_IP>/resourceGroups/<UUID>

where <UUID> is the UUID of a resource group. To obtain the group UUID, use GET /resourceGroups.

Query parameters

None

Request body

Attributes Required / Optional Type Description
op Required String Action to take. This can be one of the following values.
  • add. Adds a member of the resource group

  • replace. Modifies the value of an existing property or replaces the entire member list with specified members.

  • remove. Removes a member of the resource group.

    Note:
    • When removing multiple members from an array, remove the member with the higher index first. When you remove a member from the array the members with a higher index are shifted so their index is reduced by one.

    • Lenovo XClarity Administrator verifies that the specified property value matches the property value of the managed device. If the test fails, the member is not removed from the resource group.

  • test. When removing a member, verifies that the specified URI of the managed device is the expected URI. If the test fails, the remove operation is not performed.

path Required String Property to modify, for example:
  • To modify all members, specify /members/-.

  • To modify the first member in the array, specify /members/0.

  • To modify the name, specify /name.

value Required String Value of the property

To specify a member, use the device URI (for example, nodes/AAAAAAAAAAAAAAAAAAAAAAAAAA).

Request example

The following example adds a server and a switch to a static group.
[{
   "op": "add",
   "path": "/members/-",
   "value": "nodes/8956762567765256727652765255"
},
{
   "op": "add",
   "path": "/members/-",
   "value": "switches/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA "
}]
The following example removes two servers from a static group.
[{
   "op": "test",
   "path": "/members/3",
   "value": "nodes/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB "
},
{
   "op": "remove",
   "path": "/members/3"
},
{
   "op": "test",
   "path": "/members/1",
   "value": "nodes/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC "
},
{
   "op": "remove",
   "path": "/members/1"
}]

Response codes

Code Description
200 OK
400 Bad request
403 Forbidden
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
query String Internal use only.
Deprecated: This attribute is deprecated and will be removed in a future release.
rsql String Internal use only.
Deprecated: This attribute is deprecated and will be removed in a future release.
type String Type of resource group. This can be one of the following values.
  • static

  • dynamic

uuid String Resource group UUID

Response example

{
   "criteria": null,
   "description": "Business application VMware clusters",
   "healthStatus": "Normal",
   "members": [
      "nodes/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "nodes/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" 
   ],
   "memberUuids": [
      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 
      "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
   ],
   "name": "e-Commerce Servers",
   "type": "static",
   "uuid": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
}