JSON format objects reference

Contents

Overview

When using custom checks and alerts with Smart Check, you include a script in your check blueprint that generates a JSON file to define the components in your Site that you want to target and the content that Smart Check should display when an alert is triggered. You specify these items using entities and references. Entities are the alerts (errors or warnings), update alerts, machines, Sites, Machine Catalogs, or Delivery Groups you want to specify. References are the strings or numbers that refer to one or more entities.

Your JSON-generating script should create output that follows the format in the example below:

{
  "alerts": {
    "ref": 0,
    "alrtId": "ee55b223-38eb-430f-bfc3-2cc157425472"
  },
  "machines": {
    "ref": 0,
    "fqdn": "machine.example.com"
  },
  "activateAlerts": 0
} 

To create this output, you use the following objects:

Object Name  Description 
alerts Optional. One (specified as a value) or more (specified as an array) alert objects.
updateAlerts Optional. One (specified as a value) or more (specified as an array) updateAlert objects.
machines Optional. One (specified as a value) or more (specified as an array) machine objects.
xdSites Optional. One (specified as a value) or more (specified as an array) xdSite objects.
xdMcats Optional. One (specified as a value) or more (specified as an array) xdMcat objects.
xdDgrps Optional. One (specified as a value) or more (specified as an array) xdDgrp objects.
refs Optional. One (specified as a value) or more (specified as an array) ref arrays. A ref array has at least two items. The first item is a reference that is defined or extended. Only references defined by an entity's ref field can be extended. The reference can be defined or extended only once. The second and subsequent items are references that are exposed through new or extended references. 
activateAlerts Optional. One (specified as a value) or more (specified as an array) references. An alert and a target are required to activate successfully, so the reference should point to at least one alert or update alert and to at least one machine, Site, Machine Catalog, or Delivery Group. References to other entities are ignored and will not cause an error.
deactivateAlerts Optional. One (specified as a value) or more (specified as an array) references. An alert and a target are required to deactivate successfully, so the reference should point to at least one alert or update alert and to at least one machine, Site, Machine Catalog, or Delivery Group. References to other entities are ignored and will not cause an error.
deactivateTargets Optional. One (specified as a value) or more (specified as an array) references. A target is required to deactivate successfully, so the reference should point to at least one machine, Site, Machine Catalog, or Delivery Group. References to other entities are ignored and will not cause an error.

Examples

Example 1: Raising an alert for a machine

{
"alerts": {
"ref": 0,
"alrtId": "ee55b223-38eb-430f-bfc3-2cc157425472"
},
"machines": {
"ref": 1,
"fqdn": "machine.example.com"
},
"refs": ["ref1", 0, 1],
"activateAlerts": "ref1"
}

Example 2: Raising and lowering multiple alert types

In this example, the JSON file raises and lowers alerts for issues and for updates.

{
"alerts": [{
"ref": 0,
"alrtId": "d261e6e6-dbce-489f-b190-6f466af4575d"
}, {
"ref": 0,
"alrtId": "ee55b223-38eb-430f-bfc3-2cc157425472"
}],
"updateAlerts": {
"ref": 1,
"htfxId": "XA650W2K8R2X64R06"
},
"machines": [{
"ref": 2,
"fqdn": "machine-a.example.com"
}, {
"ref": 3,
"fqdn": "machine-b.example.com"
}],
"xdSites": {
"ref": 2,
"id": "c5baa3f1-fef6-46c0-9249-bb94506ecebf"
},
"refs": [
["ref1", 1, 3],
["ref2", 2, 0]
],
"activateAlerts": "ref1",
"deactivateAlerts": "ref2"
}

Example 3: Raise and lower alerts for multiple entities

In this example, the JSON file raises and lowers alerts targeting several components including machine, Site, and Machine Catalogs.

{
"alerts": {
"ref": 0,
"alrtId": "ee55b223-38eb-430f-bfc3-2cc157425471"
},
"machines": {
"ref": 1,
"fqdn": "machine.example.com"
},
"xdSites": {
"ref": 2,
"id": "ce55b223-38eb-430f-bfc3-2cc157425472",
"configId": "ce55b223-38eb-430f-bfc3-2cc157425473",
"brokerId": "ce55b223-38eb-430f-bfc3-2cc157425474",
"name": "xdSite-site-c"
},
"xdMcats": {
"ref": 3,
"id": "ae55b223-38eb-430f-bfc3-2cc157425475",
"configId": "ae55b223-38eb-430f-bfc3-2cc157425473",
"brokerId": "ae55b223-38eb-430f-bfc3-2cc157425474",
"name": "xdMcat-site-a"
},
"xdDgrps": {
"ref": 4,
"id": "be55b223-38eb-430f-bfc3-2cc157425475",
"name": "xdDgrp-site-b",
"xdSiteId": "be55b223-38eb-430f-bfc3-2cc157425476",
"xdSiteConfigId": "be55b223-38eb-430f-bfc3-2cc157425477",
"xdSiteBrokerId": "be55b223-38eb-430f-bfc3-2cc157425478",
"type": "rds",
"vdaCount": 2,
"availVdaCount": 2,
"unregVdaCount": 2,
"maintVdaCount": 0,
"busyVdaCount": 0,
"poffVdaCount": 0
},
"refs": ["ref1", 0, 1, 2, 3, 4],
"activateAlerts": "ref1"
}

JSON objects

alert object

Name  Data type Description
ref string or number Required. One (specified as a value) or more (specified as an array) references.
alrtId string Required. The alert ID is a UUID or GUID. Example: ee55b223-38eb-430f-bfc3-2cc157425472
data object Optional. Some alerts have an instance property bag attached to them. Each alert defines its own contents of this field. New properties can be added to the bag if the alert has new versions, but existing properties cannot be removed or change or their types or semantics. This field is used for displaying alert details and, in some cases, fix details in the Site's health report in Smart Check.

updateAlert object 

Name  Data type Description
ref string or number  Required. One (specified as a value) or more (specified as an array) references.
htfxId string  Required. The ID is the name of the update package. Example: XA650W2K8R2X64R06

machine object 

Name  Data type Description
ref string or number Required. One (specified as a value) or more (specified as an array) references.
fqdn string Required. Any valid FQDN string, in lowercase.
xdRoles string[] Optional. Allowed valued: "ddc", "vda"
xdSiteId string Optional. GUID string. Same as "id" property in xdSite object.
xdSiteConfigId string Optional. GUID string. Same as "configId" property in xdSite object.
xdSiteBrokerId string Optional. GUID string. Same as "brokerId" property in xdSite object.
xdMcatId string Optional. GUID string. xdMcatId is the XenDesktop Machine Catalog Identifier.
xdDgrpId string Optional. GUID string. xdDgrpId is the XenDesktop Delivery Group Identifier

xdSite object 

Name  Data type Description

ref

string or number  Required. One (specified as a value) or more (specified as an array) references.
id  string Optional*. GUID string. XenDesktop Site ID. Can be retrieved using Get-ConfigSite -> SiteGuid
configid  string Optional*. GUID string. XenDesktop Site Configuration Service group ID. Can be retrieved using Get-ConfigSite -> ConfigurationServiceGroupUid or Get-BrokerSite -> ConfigurationServiceGroupUid.
brokerid string Optional*. GUID string. XenDesktop Site Broker Service group ID. Can be retrieved using Get-BrokerSite -> BrokerServiceGroupUid.
name  string Optional. Site name.

* At least one of the ID fields is required (id, configid, or brokerid).

xdMcat object

Name  Data type Description
ref string or number Required. One (specified as a value) or more (specified as an array) references.
id string Required. GUID string. XenDesktop Machine Catalog Identifier.
name string Optional. XenDesktop Machine Catalog Name.
xdSiteId string Optional. GUID string. Same as "id" property in xdSite object.
xdSiteConfigId  string  Optional. GUID string. Same as "configId" property in xdSite object.
xdSiteBrokerId  string  Optional. GUID string. Same as "brokerId" property in xdSite object

xdDgrp object

Name Data type Description
ref string or number Required. One (specified as a value) or more (specified as an array) references.
id string Required. GUID string. XenDesktop Delivery Group Identifier.
name string Optional. XenDesktop Delivery Group Name.
xdSiteId string Optional. GUID string. Same as "id" property in xdSite object.
xdSiteConfigId string Optional. GUID string. Same as "configId" property in xdSite object.
xdSiteBrokerId string Optional. GUID string. Same as "brokerId" property in xdSite object.
type string Optional. One of "rds" (multi-session) or "vdi" (single-session).
vdaCount number Optional. Total number of VDAs in the Delivery Group. Natural number (0, 1, 2, 3 ...).
availVdaCount  number Optional. Total number of available VDAs in the Delivery Group. Natural number (0, 1, 2, 3 ...).
unregVdaCount  number Optional. Total number of unregistered VDAs in the Delivery Group. Natural number (0, 1, 2, 3 ...).
maintVdaCount number Optional. Total number of VDAs under maintenance in the Delivery Group. Natural number (0, 1, 2, 3 ...).
busyVdaCount number Optional. Total number of busy (in use, fully loaded) VDAs in the Delivery Group. Natural number (0, 1, 2, 3 ...).
poffVdaCount number Optional. Total number of powered off VDAs in the delivery group. Natural number (0, 1, 2, 3 ...).

0 Comments