SAYMON REST API
Search…
SAYMON REST API
General
Methods
Agents [WIP]
Authentication
Bulks [?]
Classes
Configuration
Dictionaries [?]
Event Log
Flows
History Annotations
Incidents
Incident Levels
Jobs
Limits
Links
Metric Tokens [?]
MQTT
Notification Templates [?]
Objects
Add Object's Document [*]
Clone Object
Clone Object in Background
Create Object
Check If Object's State Conditions Exist
Delete Object by ID
Delete Object's Document
Delete Object's Incident Conditions
Delete Object's State Conditions
Get All Objects
Get Object by ID
Get Object's Audit Log
Get Object's Children
Get Object's Children Links
Get Object's Config Log
Get Object's Config Log Item
Get Object's Document
Get Object's Incident Conditions
Get Object's Metrics History
Get Objects' Properties Names
Get Object's Stat
Get Object's Stat Metadata
Get Object's Stat Metrics
Get Object's State Conditions
Get Object's State History
Get Object's State Triggers
Get Number of Pages in Object's Document
Search Objects
Set Object's Incident Conditions
Set Object's Manual State
Set Object's Stat
Set Object's Stat Metadata
Set Object's State
Set Object's State Conditions
Set Object's State Triggers
Update Object
Operations
Presets
Properties
References
Reports [?]
Scripts
Service
Stat
Stat Rules
State History
States
Tags
Users
User Groups
Models
Misc
Powered By
GitBook
Clone Object
POST /node/api/objects/:id/clone
Clones an object and returns its JSON representation.
Permissions
: create-object | manage-objects.
Request parameters
Path parameters
Parameter
Type
Description
id
String
required
The ID or
discovery ID
of the object to be cloned.
Response description
See the
Object
model.
Examples
Request examples
Bash
JavaScript
NodeJS
Python
1
login
=<
..
.
>
2
password
=<
..
.
>
3
saymon_hostname
=<
..
.
>
4
object_id
=<
..
.
>
5
url
=
https://
$saymon_hostname
/node/api/objects/
$object_id
/clone
6
​
7
curl
-X POST
$url
-u
$login
:
$password
Copied!
1
let
login
=
<...>
2
let
password
=
<...>
3
let
saymonHostname
=
<...>
4
let
objectId
=
<...>
5
let
path
=
"/node/api/objects/"
+
objectId
+
"/clone"
;
6
let
auth
=
"Basic "
+
btoa
(
login
+
":"
+
password
);
7
​
8
let
headers
=
new
Headers
();
9
headers
.
append
(
"Content-Type"
,
"application/json"
);
10
headers
.
append
(
"Authorization"
,
auth
);
11
​
12
let
requestOptions
=
{
13
method
:
"POST"
,
14
headers
:
headers
15
};
16
​
17
fetch
(
saymonHostname
+
path
,
requestOptions
)
18
.
then
(
response
=>
response
.
text
())
19
.
then
(
result
=>
console
.
log
(
result
))
20
.
catch
(
error
=>
console
.
log
(
"error"
,
error
));
Copied!
1
const
http
=
require
(
"http"
);
2
​
3
let
login
=
<...>
4
let
password
=
<...>
5
let
saymonHostname
=
<...>
6
let
objectId
=
<...>
7
let
path
=
"/node/api/objects/"
+
objectId
+
"/clone"
;
8
let
auth
=
"Basic "
+
Buffer
.
from
(
login
+
":"
+
password
).
toString
(
"base64"
);
9
​
10
let
options
=
{
11
"method"
:
"POST"
,
12
"hostname"
:
saymonHostname
,
13
"headers"
:
{
14
"Authorization"
:
auth
15
},
16
"path"
:
path
17
};
18
​
19
let
req
=
http
.
request
(
options
,
function
(
res
)
{
20
let
chunks
=
[];
21
​
22
res
.
on
(
"data"
,
function
(
chunk
)
{
23
chunks
.
push
(
chunk
);
24
});
25
​
26
res
.
on
(
"end"
,
function
(
chunk
)
{
27
let
body
=
Buffer
.
concat
(
chunks
);
28
console
.
log
(
body
.
toString
());
29
});
30
​
31
res
.
on
(
"error"
,
function
(
error
)
{
32
console
.
error
(
error
);
33
});
34
});
35
​
36
req
.
end
();
Copied!
1
import
requests
2
​
3
login
=
<
...
>
4
password
=
<
...
>
5
saymon_hostname
=
<
...
>
6
object_id
=
<
...
>
7
url
=
"https://"
+
saymon_hostname
+
"/node/api/objects/"
+
\
8
object_id
+
"/clone"
9
​
10
response
=
requests
.
request
(
"POST"
,
url
,
auth
=
(
login
,
password
))
11
print
(
response
.
text
)
Copied!
Response example
1
{
2
"id": "5e79baae6ec5ea28e5105caa",
3
"name": "Updated Object",
4
"owner_id": "5e21b752308c3c66d64e072c",
5
"client_data": "{...}",
6
"object_groups": [],
7
"geoposition": [],
8
"child_ref_ids": [],
9
"child_link_ids": [],
10
"child_ids": [],
11
"parent_id": "1",
12
"weight": 1,
13
"tags": [],
14
"last_state_update": 1585035950051,
15
"updated": 1585035950051,
16
"created": 1585035085802,
17
"state_id": 1,
18
"class_id": 13,
19
"_stateConditionRefs": [],
20
"operations": [],
21
"properties": []
22
}
Copied!
Previous
Add Object's Document [*]
Next
Clone Object in Background
Last modified
1mo ago
Copy link
Contents
POST /node/api/objects/:id/clone
Request parameters
Path parameters
Response description
Examples
Request examples
Response example