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 
meta Optional. An object describing the document.
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.

Back to top

Examples

Example 1: Raising an alert for a Delivery Controller

{
"alerts": {
"ref": 0,
"alrtId": "ee55b223-38eb-430f-bfc3-2cc157425472"
},
"machines": {
"ref": 0,
"fqdn": "machine.example.com"
"xdRoles": ["ddc"],
"xdSiteId":"05e77702-3f9c-4cd4-b2eb-bffb1ae3ad61"
},

"activateAlerts": "0"
}

Example 2: Raising an alert for a Storefront server

{
"alerts": {
"ref": 0,
"alrtId": "ee55b223-38eb-430f-bfc3-2cc157425472"
},
"machines": {
"ref": 1,
"fqdn": "machine.example.com",
"xdRoles": ["sf"],
"xdSiteId": "05e77702-3f9c-4cd4-b2eb-bffb1ae3ad61"
},
  "refs": ["ref1", 0, 1],
"activateAlerts": "ref1"
}

Example 3: 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"
"xdRoles": ["ddc"],
"xdSiteId": "05e77702-3f9c-4cd4-b2eb-bffb1ae3ad61"
},
{
"ref": 3,
"fqdn": "machine-b.example.com"
"xdRoles": ["vda"],
"xdSiteId": "05e77702-3f9c-4cd4-b2eb-bffb1ae3ad61"
}
],
"xdSites": {
"ref": 2,
"id": "c5baa3f1-fef6-46c0-9249-bb94506ecebf"
},
"refs": [
["ref1", 1, 3],
["ref2", 2, 0]
],
"activateAlerts": "ref1",
"deactivateAlerts": "ref2"
}

Example 4: 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"
"xdRoles": ["ddc"],
"xdSiteId": "ae55b223-38eb-430f-bfc3-2cc157425472",
},
"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"
}

Back to top

JSON objects

meta object

Name  Data type Description
name string  Optional. Any string up to 128 characters long. Name of the report. Report is the output from the check or tool identified by "gen." There can be multiple reports from a single check or tool. This value is displayed in the UI, so it should be descriptive and make sense to the end-user.
gen string Optional. Any string up to 128 characters long. Name of the report generator. Typically, a name of the check or tool which could produce multiple reports. This value is displayed in the UI, so it should be descriptive and make sense to the end-user. 

Back to top

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 to the user in the Site's health report in Smart Check.

Certain properties added to the Data bag are used as arguments for placeholders in the alert text fields, in case the property name matches one in placeholder, as shown in the following example:

"Some Alert Text For {{ ArgumentName }}"

alert {
"data": { "ArgumentName" : "My String" }
}

When the alert is displayed {{ArgumentName}} will be substituted for "My String" (for example, "Some Alert Text For My String")

The value must be of a simple type, a string, a number, or an array of these. Complex data structures are not allowed.

If no matching argument is found in dataproperty bag, substitution is not performed, and text is displayed as-is (for example, "Some Alert Text For").

 

Back to top

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

Back to top

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 values: "ls", "sf", "pvs", "ddc", "vda." Specify only one role when using a single machine entity. To specify multiple roles for a single machine, you must specify each role using a separate machine entity. For example: 
"machines": {
"ref": 1,
"fqdn": "machine1.example.com"
"xdRoles": ["pvs"],
"xdSiteId": "ae55b223-38eb-430f-bfc3-2cc157425472",
},
"machines": {
"ref": 1,
"fqdn": "machine1.example.com"
"xdRoles": ["sf"],
"xdSiteId": "ae55b223-38eb-430f-bfc3-2cc157425472",
},
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

Back to top

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).

Back to top

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

Back to top

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 ...).

Back to top

0 Comments