Summary:
List all OS Service rules, create a new rule or delete all rules.
URL:
http(s)://{server hostname}/api/objects/{swID}/attributes/{attributeName}
Methods summary
- GET Method - returns a list of all OS Services rules.
- POST Method - creates a new OS Services rule within the list.
- DELETE Method - deletes all OS Services rules.
GET Method detail
Returns a list of all OS Services rules.
Response:
Name | Description |
---|---|
id | ID number of the OS Service rule. |
serviceName |
the OS Service name that is being filtered for in the rule. |
description |
description of the OS Service, as entered by the user. |
filterUsing |
type of filter to apply to the service name, either:
|
operatingSystem |
operating system of the rule:
|
enabled |
if the OS Service rule is currently enabled, either 'true' or 'false'. |
Examples:
INPUT
curl –u admin:admin https://localhost/api/osService?media=json
OUTPUT
{
"serviceRules": [
{
"id": 1,
"serviceName": "EOTS",
"description": "Entuity",
"filterUsing": 0,
"operatingSystem": 0
"enabled": true
},
{
"id": 1,
"serviceName": "wuauserv",
"description": "Windows Update",
"filterUsing": 0,
"operatingSystem": 0
"enabled": false
},
{
"id": 1,
"serviceName": "CiscoAMP",
"description": "CiscoAMP. Version number follows name",
"filterUsing": 1,
"operatingSystem": 0
"enabled": true
}
]
}
INPUT
curl –u admin:admin https://localhost/api/osService?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<osServiceList xmlns:ns5="http://www.entuity.com/webrpc" xmlns:ns2="http://www.entuity.com/schemas/webUI" xmlns:ns4="http://www.entuity.com/schemas/eventengine" xmlns:ns3="http://www.entuity.com/schemas/flow">
<serviceRules>
<serviceRules description="Entuity" enabled="true" filterUsing="0" id="1" operatingSystem="0" serviceName="EOTS"/>
<serviceRules description="Windows Update" enabled="false" filterUsing="0" id="2" operatingSystem="0" serviceName="wuauserv"/>
<serviceRules description="CiscoAMP. Version number follows name" enabled="true" filterUsing="1" id="3" operatingSystem="0" serviceName="CiscoAMP"/>
</serviceRules>
</osServiceList>
POST Method detail
Creates a new OS Services rule within the list.
Request:
Name | Description |
---|---|
serviceName |
the OS Service name that is being filtered for in the rule. |
description |
description of the OS Service, as entered by the user. |
filterUsing |
type of filter to apply to the service name, either:
|
operatingSystem |
operating system of the rule:
|
enabled |
if the OS Service rule is currently enabled, either 'true' or 'false'. |
Response:
Lists and details all OS Services on the server, including the OS Service that has just been created.
Examples:
INPUT
curl -u admin:admin https://localhost/api/osService -X POST -H "content-type:application/json" -d
{
"serviceRules": [
{
"serviceName": "TestService3",
"description": "test service 3",
"filterUsing": 0,
"operatingSystem": 0
"enabled": true
}
]
}
OUTPUT
{
"serviceRules" : [ {
"id" : 1,
"serviceName": "TestService",
"description": "test service",
"filterUsing": 0,
"operatingSystem": 0,
"enabled": true,
"auditLogWriter" : 1
}, {
"id" : 2,
"serviceName": "TestService2",
"description": "test service 2",
"filterUsing": 0,
"operatingSystem": 1,
"enabled": true,
"auditLogWriter" : 1
}, {
"id" : 3,
"serviceName": "TestService3",
"description": "test service 3",
"filterUsing": 1,
"operatingSystem": 1,
"enabled": true,
"auditLogWriter" : 1
} ]
}
INPUT
curl –u admin:admin https://localhost/api/osService?media=xml -X POST -H "content-type:application/xml" -d \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<osServiceList>
<serviceRules>
<serviceRules description="test service 3" enabled="true" filterUsing="0" operatingSystem="0" serviceName="TestService3"/>
</serviceRules>
</osServiceList>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<osServiceList xmlns:ns5="http://www.entuity.com/webrpc" xmlns:ns2="http://www.entuity.com/schemas/webUI" xmlns:ns4="http://www.entuity.com/schemas/eventengine" xmlns:ns3="http://www.entuity.com/schemas/flow">
<serviceRules>
<serviceRules description="test service" enabled="true" filterUsing="0" id="1" operatingSystem="0" serviceName="TestService"/>
<serviceRules description="test service 2" enabled="true" filterUsing="0" id="2" operatingSystem="1" serviceName="TestService2"/>
<serviceRules description="test service 3" enabled="true" filterUsing="1" id="3" operatingSystem="1" serviceName="TestService3"/>
</serviceRules>
</osServiceList>
DELETE Method detail
Deletes all OS Services rules.
Response:
“Deleted {X} OS Service Rules” message if the device was removed successfully, an error message otherwise.
Examples:
INPUT
curl -u admin:admin https://localhost/api/osService?media=json –X DELETE
OUTPUT
{
"message": "Deleted 2 OS Service Rules"
}
INPUT
curl -u admin:admin https://localhost/api/osService?media=xml–X DELETE
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<result message="Deleted 2 OS Service Rules" xmlns:ns5="http://www.entuity.com/webrpc" xmlns:ns2="http://www.entuity.com/schemas/webUI" xmlns:ns4="http://www.entuity.com/schemas/eventengine" xmlns:ns3="http://www.entuity.com/schemas/flow"/>
Comments
0 comments
Please sign in to leave a comment.