Groups

Groups facilitate faster customization of Arista APs by allowing you to apply custom configuration (e.g., SSIDs, Radio Settings, and Device Settings) to APs located across different branches of a hierarchical location tree. Using groups API you can create a new group, update the existing one, fetch details of an existing group or delete the group.

JSON Table

Attribute Data Type Description
groups application/json
groups/createdAtLocationId application/json Specifies the location at which the group is created.
groups/deviceTemplateId int Specifies the device template id used in the group.
groups/mnctemplate boolean A true or false value indicating if the group was created on cluster parent or not.
groups/id int Specifies the system generated unique identifier of the group.
groups/name String Specifies the name of the group.
groups/mncId int
previousLink String Link for the previous page of results.
nextLink String Link for the next page of results.
totalCount int The total number of groups retrieved based on the filter criteria.

Copy Sample JSON
Sample JSON
{
	"previousLink": null,
	"nextLink": null,
	"totalCount": 0,
	"groups": [{
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 0,
			"childId": 2
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 2,
		"name": "Test 1_1",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 0,
			"childId": 2
		},
		"deviceTemplateId": 44,
		"mnctemplate": false,
		"id": 3,
		"name": "Test 2",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 0,
			"childId": 2
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 4,
		"name": "Training",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 0,
			"childId": 2
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 5,
		"name": "Training s",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 0,
			"childId": 2
		},
		"deviceTemplateId": 52,
		"mnctemplate": false,
		"id": 6,
		"name": "Root Location Template_O-70_C-55_C-60",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "locallocationid",
			"id": 0
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 2,
		"name": "Test_Group",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "locallocationid",
			"id": 0
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 3,
		"name": "test",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "locallocationid",
			"id": 0
		},
		"deviceTemplateId": 38,
		"mnctemplate": false,
		"id": 4,
		"name": "Test manoj",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "locallocationid",
			"id": 45
		},
		"deviceTemplateId": null,
		"mnctemplate": false,
		"id": 1,
		"name": "Test Network Switch",
		"mncId": 0
	}, {
		"createdAtLocationId": {
			"type": "remotelocationid",
			"id": 14,
			"childId": 2
		},
		"deviceTemplateId": 31,
		"mnctemplate": false,
		"id": 1,
		"name": "Russia Template_Universal Configuration_C-100",
		"mncId": 0
	}]
}
API Calls

/V6/groups

/V6/groups

/V6/groups

/V6/groups

Get Groups

Description Fetches the list of all the groups along with their details for the specified location.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/groups?locationid=<value>&nodeid=<value>&
fetchsubtreegroups=<value>&filter=<value>&operator=<value>&startindex=
<value>&pagesize=<value>&sortcolumn=<value>&sortascending=<value>
  • locationid

    It is an integer value specifying the location for which the list of groups is to be fetched.
    To retrieve the value for location id refer Location call.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

  • fetchsubtreegroups

    A true or false value indicating whether the groups available at the location as well as the
    ones created in the subtree should be returned or not. It takes a boolean value.

  • filter

    Is used to filter the results. Click Filter to view details of how filters need to be specified in the URL.
    For possible names of property attribute, datatypes, applicable values and whether the results can be sorted based on the parameter click Groups Filter.

  • operator

    It is an outer operator between the provided list of filters.

  • startindex

    An integer value indicating the start index for the list of records to be fetched. The default value is 0.

  • pagesize

    An integer value indicating the end index for the list of clients to be fetched.
    The maximum page size is 1000. It is a mandatory parameter.

  • sortcolumn

    An optional parameter used to sort the columns. It takes a string value. The default value is boxId.

  • sortascending

    Is used to sort requested managed devices list in ascending order.
    By default, the sort is descending. It takes a boolean value.

Sample code
GET https://training.mojonetworks.com/new/webservice/v6/groups?fetchsubtreegroups=true&sortascending=true&sortcolumn=name&filter
=%7B%0A%09%22property%22%3A%20%22name%22%2C%0A%09%22value%22%3A%20%5B%22Test_
Group%22%5D%2C%0A%09%22operator%22%3A%20%22contains%22%0A%7D%20
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains information about the available groups. The response is in the application/json format.

Update a Group

Description Updates the details of the Group.
Who Can Execute? Superuser and Administrator.
Syntax
PUT <Base_URL>/groups?locationid=<value>&nodeid=<value>&fields=<value>
  • locationid

    This API call requires the details of the AP to be modified, which are
    passed as parameters in the request body. The parameters are passed in
    the application/json format. You must provide appropriate values
    for the following attributes.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

  • fields

    List of selective fields which will be updated. It takes String value.

Sample code
PUT https://training.mojonetworks.com/new/webservice/v6/groups?locationid=0&nodeid=2&fields=name
Request Body This API call requires the details of the group to be modified, which are
passed as parameters in the request body. The parameters are passed in
the application/json format.A sample request body is as follows:

{
	"createdAtLocationId": {
		"type": "remotelocationid",
		"id": 0,
		"childId": 2
	},
	"deviceTemplateId": null,
	"mnctemplate": false,
	"id": 2,
	"name": "Test 1_1",
	"mncId": 0,
	"lowerCaseName": "test 1"
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains updated information about the groups. The response is in the application/json format.

Create a Group

Description Creates a new group.
Who Can Execute? Superuser and Administrator.
Syntax
POST <Base_URL>/groups?locationid=<value>&nodeid=<value>
  • locationid

    This API call requires the details of the AP to be modified, which are
    passed as parameters in the request body. The parameters are passed in
    the application/json format. You must provide appropriate values
    for the following attributes.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

Sample code
POST https://training.mojonetworks.com/new/webservice/v6/groups?locationid=0&nodeid=2
Request Body This API call requires the details of the group to be created, which are
passed as parameters in the request body. The parameters are passed in
the application/json format.A sample request body is as follows:

{
	"name": "doc",
	"createdAtLocationId": {
		"type": "locallocationid",
		"id": 0
	},
	"deviceTemplateId": null
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains information about the newly created group. The response is in the application/json format.

Delete a Group

Description Deletes a group.
Who Can Execute? Superuser and Administrator.
Syntax
DELETE <Base_URL>/groups/{groupid}?locationid=<value>&nodeid=<value>&
  • groupid

    The unique ID of the group to be deleted. It takes an integer value.

  • locationid

    This API call requires the details of the AP to be modified, which are
    passed as parameters in the request body. The parameters are passed in
    the application/json format. You must provide appropriate values
    for the following attributes.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

Sample code
DELETE https://training.mojonetworks.com/new/webservice/v6/groups/5?locationid=0&nodeid=2
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 204.
The response body does not contain any other information.