Object
Object is an entity within which a monitoring process is going on. Objects can receive and store metrics, have types (Classes), Properties, Owner, State, and more.
An object can represent:
-
a physical device (server, processor, router)
-
a program module (database, web server)
-
a higher-level element relating to business processes (service, platform)
Objects can have an unlimited number of child objects and parents. Objects form a hierarchy with unlimited number of levels.
Object Model
Field | Type | Description |
---|---|---|
background |
String |
Object’s background image. |
created |
Integer |
A timestamp when the object was created. |
class_id |
String |
The ID of an object class. |
child_ids |
Array<String> |
An array of object’s child objects IDs. |
child_link_ids |
Array<String> |
An array of object’s child links IDs. |
child_ref_ids |
Array<String> |
An array of object’s child references IDs. |
client_data |
String |
Object’s client data. See a detailed description below. |
discovery_id |
String |
Object’s discovery ID. See a detailed description below. |
entityType |
Integer |
Entity Type. For an object, entity type is |
geoposition |
Array<Float> |
Object’s position on a map. It’s specified as an array of two float numbers, where the first number is longitude, the second one is latitude. |
geopositionRadius |
Integer |
The radius of an object’s area displayed on a map. |
id |
String |
Object’s ID. |
last_state_update |
Integer |
A timestamp when object’s state was last updated. |
manual_state |
Object’s manual state. |
|
mute_alert |
Object |
Object containing information about muting alarms on this object. |
mute_alert.reason |
String |
Comment with the reason for muting alarms. |
mute_alert.by |
String |
ID of the user, that muted alarms from this object. |
name |
String |
Object’s name. |
operations |
Array<Operation> |
An array of object’s operations. |
owner_id |
String |
The ID of a user who owns the object. |
parent_id |
Array<String> |
The IDs of an object’s parents. |
properties |
Array<Property> |
An array of object’s properties. |
state_id |
String |
The ID of an object state. |
tags |
Array<Tag> |
An array of object’s tags. |
updated |
Integer |
A timestamp when the object was last updated. |
_version |
Integer |
Version of the object. Version increases by 1 every time any field changes in an object. |
weight |
Integer |
Object’s weight. |
Root Object
There is always Object with id:1 and class_id:1. It’s called Root Object. It can be modified, but not deleted.
{
"id": 1,
"class_id": 1,
"name": "Root",
"parent_id": 0,
...
}
Child Object
Object can have one or several Child Objects.
{
"id": 1,
"name": "Root",
"child_ids": [
2341,
"56778c7251ed68d360e9e8fa"
],
...
}
Parent Object
Object can have one or several Parent Objects.
{
"id": "5b0e9a961b77787888970d8c",
"name": "Cat",
"parent_id": [
1011,
"5ac73d88edff0739fbd963de"
],
...
}
Multi-parent and Reference
You can set several parents for a single object. This is called multi-parent
SAYMON object hierarchy can be compared to a file system:
-
a multi-parent is comparable to a hard link;
-
a Reference is comparable to a symbolic or soft link.
When you delete Object with multi-parent all other entries of this Object are still remain in SAYMON.
When you delete Object with Reference all References are deleted.
When you delete Reference, nothing happens with Object.
Discovery ID
This field can be used along with the Create Object method. If discovery ID is specified in a request body, the method works as follows: if an object with the specified discovery ID doesn’t exist, a new object with this ID will be created. If an object with the specified discovery ID already exists, the object’s body will be updated. Thus, this field can be used as an external ID created by the user and utilized thereafter to work with an object.
Any method, which uses the object’s ID, can also use the object’s discovery ID instead. To do that it’s necessary to replace <id> with discovery id:<discovery_id> in the request URL.
Example
Clone the object with id = 6013d0c604ab1a73eda738f5 and discovery id = Qwerty:
by ID: http://<saymon_hostname>/node/api/objects/6013d0c604ab1a73eda738f5/clone
by discovery ID: http://<saymon_hostname>/node/api/objects/discovery_id:Qwerty/clone
Discovery ID must not contain the / symbol. |
Discovery ID is case-sensitive.
Client data
Client data is a set of fields that correspond to various object’s UI settings. The fields are specified in the JSON format and stored on a server as a string. The table below contains a description of all fields from the set:
Field | Type | Description |
---|---|---|
charts |
Array<Array<String>> |
An array of plots. Each plot is stored as an array, the first element of which is the ID of the plot, the second one is a mathematical formula for metrics to be displayed on the plot. |
collapseSections |
Map<String, Boolean> |
A collection of object’s metrics names whose plots should be collapsed. Each record of the collection is a pair, the first element of which is a metric’s title, the second one is a boolean value. If the value set to |
custom_style.height |
Integer |
Object’s height (in pixels). Should be specified with the px suffix. |
custom_style.left |
Integer |
Object’s margin from the left (in pixels). Should be specified with the px suffix. |
custom_style.top |
Integer |
Object’s margin from the top (in pixels). Should be specified with the px suffix. |
custom_style.width |
Integer |
Object’s width (in pixels). Should be specified with the px suffix. |
custom_style.zIndex |
Integer |
Object’s Z-index. The index specifies how overlapping objects should be displayed in the standard view. For example, if there are two overlapping objects, an object with a greater Z-index will be shown above the other object with a smaller Z-index. In other words, objects with greater Z-index are shown above objects with smaller Z-index. |
headlinePropIds |
Array<String> |
An array of properties' keys whose values should be displayed on an object’s headline. |
joinedGraphs |
Array<String> |
An array of plots' IDs displayed on a joined plot. |
nonPinnedSections |
Map<String, Boolean> |
A collection of object’s sections names that should be unpinned. Each record of the collection is a pair, the first element of which is a section name, the second one is a boolean value. If the value is set to |
widgets |
Array<Widget> |
An array of widgets configured for the object. |