Skip to main content
Matrix42 Self-Service Help Center

Rest API – Logical Groups

How to crate, update, query and delete logical groups in SPM using the FireScope REST API.

Overview

The REST API allows you to work with Logical Groups in FireScope SPM using a REST client in lieu of the SPM user interface.

  • Retrieve
  • Search
  • Create or Update
  • Delete

Retrieve

To retrieve the current information about a Logical Group as a JSON document, send a GET request with the following URL format:

http://localhost:38050/web_services/...name=Databases

Note: Don’t forget to change the domain name (localhost) and query parameter values (account and name) to match your environment and data.

 Query Parameter Descriptions

Parameter Description Type Required
account Name of the SPM Account. String Yes
name Name of the SPM Logical Group. String Yes

Search

Searching provides for the ability to return multiple results in a single call using various filter criteria. To accomplish this, a GET request is sent with a parameter search=true. Every other field besides account is optional and is used to further filter the results. Pagination is mandatory and accomplished using the page and size parameters. The JSON response will wrap the result list and also display the page and the size. The size in the response represents the number of results actually returned, not the size in the request. The response does not contain a count of the total number of pages or the total number of records for performance reasons. The client is expected to keep querying, increasing the page each time, until the result size is less than the requested size, indicating no more results.

http://localhost:38050/web_services/...age=0&size=100

Note: Don’t forget to change the domain name (localhost) and query parameter values (search, account, servicegroup, name, page and size) to match your environment and data.

Search Parameter Descriptions

Parameter Description Type Default Required
account Name of the SPM Account. String   Yes
search Enable searching by setting to true. Setting to false will revert functionality to retrieving a single result. Boolean FALSE Yes
page Indicates which result set is being returned starting at zero and increasing until there are no more results Number 0 Yes
size Indicates how many results are returned in a single page. A max of 250 results is supported. Number 100 Yes
name Filter the results by a case-insensitive substring search of the name field. String   No
servicegroup Filter the results by a Service Group’s exact name. String   No

 Example Search Results Response

{
   "account_id": "firescope",
   "entity": "logicalgroup",
   "page": 0,
   "size": 2,
   "results": [
      {
         "account_id": "firescope",
         "name": "Databases",
         "ci": [{"edge_device" : "edge1", "ci" : "10.0.2.1"}]
      }, {
         "account_id": "firescope",
         "name": "Web Servers",
         "ci" : []
      }
   ]
}

Create or Update

To create or update a Logical Group, POST a JSON document with the specific information for that Logical Group to the following URL:

http://[SPM IP address]:38050/web_services/logicalgroup

Use the following example as a guide, but note that it may not include all optional properties.

{
  "account_id" : "firescope",
  "name" : "LG1",
  "ci": [{
    "edge_device" : "edge1",
    "ci" : "10.0.2.1"
  }]
}

Property Descriptions

Property Description Type Default Value Required
account_id Name of the SPM Account. String   Yes
name Name of the SPM Logical Group. String   Yes
ci Array of CI instances.Example: [{“edge_device” : “Edge 1”, “ci” : “SWEB2 OpSource”}]
PropertyDescriptionTypeDefault ValueRequirededge_deviceName of existing Edge Device for this CI.String YesciName of existing CI to relate.String Yes
Object[] [] No

Delete

To delete a Logical Group, send an HTTP DELETE request with the same query parameters as the GET request.See the Retrieve for the URL format and query parameter descriptions.

  • Was this article helpful?