Summary:
Inspect, add or delete View objects.
URL:
http(s)://{server hostname}/api/views/{id}/objects
Methods summary
- GET Method - list View objects.
- PUT Method - add objects to a View.
- DELETE Method - remove objects from a View.
GET Method detail
Method returns objects contained in a View.
Request:
Name | Description |
---|---|
indirect |
set to a special value “include” to return objects from Subviews as well. By default, objects from Subviews are not included. |
includedTypes | specify the types of object to include in the returned list of StormWorks type names, e.g. Service, VPNDevice. Can be used in conjunction with excludedTypes below. |
excludedTypes | specify the types of object to exclude from the returned list of StormWorks type names. Can be used in conjunction with includedTypes above. |
Response:
List of items. Each item has the following properties:
Name | Description |
---|---|
displayName |
name of the object. |
id | object id unique to the server. |
serverId | Entuity server ID on which resource resides. |
typeDisplayName | user-friendly name of the object type. |
typeName | name of the object type. |
Examples:
INPUT
curl -u admin:admin https://localhost/api/views/49/objects?media=json
OUTPUT
{
"items" : [ {
"serverId" : "821c3e87-bcdf-4fef-a5e8-7d2524928d96",
"id" : 769,
"typeName" : "ManagedHost",
"typeDisplayName" : "Managed Host",
"displayName" : "localhost"
} ],
"count" : 1
}
INPUT
curl -u admin:admin https://localhost/api/views/49/objects?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="1">
<item xsi:type="viewContentItem" displayName="localhost" typeDisplayName="Managed
Host" typeName="ManagedHost" id="769" serverId="821c3e87-bcdf-4fef-a5e8-7d2524928d96" />
</items>
To return all devices:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&includedTypes=BasicDevice
To return only services and VPN devices:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&included Types=Service,VPNDevice
To return all devices except VPN devices:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&includedTypes=BasicDevice&excludedTypes=VPNDevice
PUT Method detail
Request:
Name | Description |
---|---|
id |
item ID. This parameter can appear multiple times. |
Response:
Same as the 'GET Method - Response' above, with objects added.
Example:
Add two items (2024 and 3279) to a View:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&id=2024&id=3279 -X PUT
DELETE Method detail
Request:
Name | Description |
---|---|
id |
item ID. This parameter can appear multiple times. |
include
|
can have a special value "all" to empty a View completely. If specified, any 'id' parameters are ignored. |
Response:
The updated list of View objects, as would be received from the 'GET Method' above.
Examples:
Remove two objects (2024 and 3279) from a View:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&id=2024&id=3279 -X DELETE
Remove all items from a View:
curl -u admin:admin https://localhost/api/views/49/objects?media=json&include=all -X DELETE
Comments
0 comments
Please sign in to leave a comment.