URL

POST https://{api-url}/api/v2/tenants/{tenantId}/serviceGroups

Sample URLs

https://{api-url}/api/v2/tenants/client_16/serviceGroups

Use this API to create a parent (root level) service group.

Parameters

FieldData TypeDescription
nameStringUnique name for the service group. The service group is identified with this name.
childTypeStringChild service group type.
Example: DEVICE, SERVICEGROUP, SNS, SQS
filterCriteria: Filter for resources that should be part of the service group with the below rules.
  • matchType
StringMatch Any or All of the filter rules:
  • To match ALL the rules, provide matchType: ALL
  • To match ANY of the rules, provide matchType: ANY
  • rules
    • key
    • operator
    • value
    • resourceType
StringFilter resources with help of specific attributes.
  • Attribute name. The attribute can be a resource attribute or a custom attribute. Use Get Custom Attributes by Entities API to retrieve custom attributes of Device, Client and Service Group.
    Example: Account Id, Agent Installed
  • Logical operator.Supported operators: Contains, Not Contains, Equals, Not Equals, Starts with, Ends with, Regex, Is. For operator Is, value should be true or false. For example, to filter resource on which Agent is installed, provide "key" as "agent_installed" and value as "true".
    Learn more of the details of using Regular Expressions (Regex).
  • Specific details of a resource.
    Example: redis-prod
  • kbArticleIds
StringAssign knowledge base articles to a device group.Note: To fetch a knowledge base article ID:
  1. Log into OpsRamp.
  2. Click Knowledge Base.
  3. Select the required article and then copy the article ID.
  4. Provide the article ID in "kbArticleIds" field.
    Example: "kbArticleIds": [22089].
Determine the service availability monitor with the following rules:
frequencyInteger(Optional)
thresholdTypeString(Optional) Define the availability status for a service group with below threshold types:
  • count: Define availability of a service group based on the number of resources in the group.
    For example, if 10 resources are down.
  • percentage: Percentage of resources or services that should be considered to determine the availability.
Below are the supported availability statuses:
  • Down: If resources or services down are greater than or equal to a specific value(count/percentage), then service is considered as Down.
  • Degraded: If resource or services down are less than a specific value(count/percentage), then service is considered as Degraded.
  • OK: If all resources or services are Up, then service is considered as OK.
For example, a user wants to define availability status as Down if 5 resources are down, then the values are provided as:
"thresholdType": "count","thresholdLimit": 5.
thresholdLimitInteger(Optional) Provide a specific threshold value to determine count or percentage.
typeString(Optional)
  • To generate an alert when the threshold limits are breached, provide type: alert.
  • To display the availability status without generating an alert, provide type: default.
alertBoolean(Optional) Generate an alert when the threshold limits are breached.
alertTypeInteger(Optional) Provide specific alertType value to set service availability monitor:
  • Service Availability Monitor will be set to Available, If alertType = 2.
  • Service Availability Monitor will be set to Any critical alert, If alertType = 0.
  • Service Availability Monitor will be set to Critical alert, If alertType = 1.

Sample request

[{
	"name": "Finance Inventory",
	"createdDate": "2018-06-20T11:33:08+0000",
	"updatedDate": "2018-06-20T11:33:08+0000",
	"childType": "DEVICE",
	"frequency": 5,
	"thresholdType": "count",
	"thresholdLimit": 1,
	"monitorNames": ["service.availability.metric"],
	"include": "ALL",
	"type": "alert",
	"alertType": 2,
	"alert": false,
	"metrics": [],
	"filterCriteria": {
		"matchType": "ANY",
		"rules": [{
			"key": "Name",
			"operator": "Contains",
			"value": "Windows",
			"resourceType": "DEVICE"
		}]
	}
}]

Sample response

[
    {
        "id": "SGP-d71e0398-f33b-48ba-a283-1fa11ebe3e17",
        "name": "Finance Inventory",
        "createdDate": "2018-06-20T11:33:08+0000",
        "updatedDate": "2018-06-20T11:43:17+0000",
        "childType": "DEVICE",
        "frequency": 5,
        "thresholdType": "count",
        "thresholdLimit": 1,
        "monitorNames": [
            "service.availability.metric"
        ],
        "include": "ALL",
        "type": "alert",
        "alertType": 2,
        "alert": false,
        "metrics": [
        ],
        "filterCriteria": {
            "matchType": "ANY",
            "rules": [
                {
                    "key": "Name",
                    "operator": "Contains",
                    "value": "Windows",
                    "resourceType": "DEVICE"
                }
            ],
            "actions": [
            ]
        }
    }
]