ESET Online Help

Search
Select the topic

Examples of JSON messages

And some of their responses (some fields are described)

Start ServerApi:

Request: {"Era.ServerApi.StartRequest":{}}

Response: {"Era.ServerApi.SimpleResponse": {"result":true} }

result : true – it is ok

Create connection:

Request: {"Era.ServerApi.CreateConnectionRequest":{"host":"127.0.0.1","port":2223}}

hostname: identifies host i.e: localhost, 127.0.0.1, wayne.hq.eset.com

port: port for ConsoleApi - default: 2223

Response: {"Era.ServerApi.VerifyUserRequest":{"result":"111111111111111111111111asdsaas"} }

result: certificate chain

Verify certificate chain:

Request: {"Era.ServerApi.VerifyUserResponse":{"VerifyResult":true}}

VerifyResult: true means I accept certificate chain

Response: {"Era.ServerApi.SimpleResponse": {"result":true} }

Authentication:

Request: {"Era.Common.NetworkMessage.ConsoleApi.SessionManagement.RpcAuthLoginRequest" : {"username":"Administrator", "password":"secret", "isDomainUser":false, "locale":"en-US"}}

isDomainUser: if username is domain user- true else false

locale: localization

Response: {"Era.Common.NetworkMessage.ConsoleApi.SessionManagement.RpcAuthLoginResponse": {"userUuid":{"uuid":"00000000-0000-0000-7002-000000000002"}} }

Create computers:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcCreateComputerRequest":{"parentGroupUuid":{"uuid":"00000000-0000-0000-7001-000000000002"},"computerNames":["computer1"],"commonDescription":"first","collisionsHandling":1}}

parentGroupUuid: is uuid of parent group. In this case it is lost&found. Uuid for some other group “group1” can be obtained, when group1 is created.

collisionsHandling: default is 1, do not change

Response: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcCreateComputerResponse": {"results":[{"result":1,"requestIndex":0,"staticObjectIdentification":{"uuid":{"uuid":"0a7042bf-2cca-4568-9093-cd9c26cc842b"},"versionGuard":129},"staticObjectData":{"name":"computer1","description":"first"}}]} }

staticObjectIdentification: this is uuid assigned to computer. It can be used to delete computer.

Modify computer:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcModifyComputerRequest":{"staticObjectIdentification":{"uuid":{"uuid":"0a7042bf-2cca-4568-9093-cd9c26cc842b"},"versionGuard":129},"staticObjectData":{"name":"computer1","description":"modified"}}}

staticObjectIdentification: uuid is uuid of created computer

versionGuard: received from creating response

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcModifyComputerResponse": {"staticObjectIdentification":{"uuid":{"uuid":"0a7042bf-2cca-4568-9093-cd9c26cc842b"

},"versionGuard":133}} }

Remove computer:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcRemoveComputerRequest":{"staticObjectIdentification":[{"uuid":{"uuid":"0a7042bf-2cca-4568-9093-cd9c26cc842b"},"versionGuard":133}]} }

staticObjectIdentification: uuid is uuid of modified computer

versionGuard: received from modifying response

{"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcRemoveComputerResponse": {} }

Create group:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcCreateStaticGroupRequest":{"staticObjectData":{"name":"scenarioCreateAndRemoveStaticGroup","description":"description"},"parentGroupUuid":{"uuid":"00000000-0000-0000-7001-000000000001"}}}

Fields have similar meaning as in the create computers request

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcCreateStaticGroupResponse":{"staticObjectIdentification":{"uuid":{"uuid":"1c7f092c-0853-45ad-badd-6a6b949d8163"},"versionGuard":169},"staticObjectData":{"name":"scenarioCreateAndRemoveStaticGroup","description":"description"},"staticGroupRelations":{"parentGroup":{"uuid":"00000000-0000-0000-7001-000000000001"}}} }

Fields have similar meaning as in the create computers response

Move computer:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcMoveComputerRequest":{"staticObjectIdentification":[{"uuid":{"uuid":"0d767e6e-b35b-4d31-b411-51ceecb605b6"},"versionGuard":170}],"newParentGroupUuid":{"uuid":"507c5dba-791a-4b30-9940-9f5e7ad28a19"}}}

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcMoveComputerResponse": {"staticObjectIdentification":{"uuid":{"uuid":"0d767e6e-b35b-4d31-b411-51ceecb605b6"},"versionGuard":174}} }

Remove group:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcRemoveStaticGroupRequest":{"staticObjectIdentification":{"uuid":{"uuid":"507c5dba-791a-4b30-9940-9f5e7ad28a19"},"versionGuard":1000}}}

Fields have similar meaning as in the remove computers request

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Groups.RpcRemoveStaticGroupResponse": {} }

Create policy:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcCreatePolicyRequest":{"staticObjectData":{"name":"scenarioCreatePolicyModifyAndRemoveIt","description":"Desciption"},"policyData":{"data":"","product":"agent"}}}

Response{"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcCreatePolicyResponse": {"staticObjectIdentification":{"uuid":{"uuid":"a86078af-480f-4848-a7ee-f521d05acaee"},"versionGuard":177}} }

Modify policy:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcModifyPolicyRequest":{"staticObjectIdentification":{"uuid":{"uuid":" a86078af-480f-4848-a7ee-f521d05acaee"},"versionGuard":177},"staticObjectData":{"name":"scenarioCreatePolicyModifyAndRemoveIt","description":"Modified"},"policyData":{"data":"","product":"Agent"}}}}

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcModifyPolicyResponse": {"staticObjectIdentification":{"uuid":{"uuid":"a86078af-480f-4848-a7ee-f521d05acaee"},"versionGuard":178}} }

Remove policy:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcRemovePolicyRequest":{"staticObjectIdentification":{"uuid":{"uuid":" a86078af-480f-4848-a7ee-f521d05acaee "},"versionGuard":178}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcRemovePolicyResponse": {} }

Assign policy to computer:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcSetComputerPoliciesRequest":{"computerUuid":{"uuid":"e8e50609-b3bf-4a36-a736-7e411391d2a4"},"versionGuard":0,"policiesUuids":[{"uuid":"880b523b-7fa8-48f2-83eb-2f3dbf01e5b2"}]}}

Response:

{"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcSetComputerPoliciesResponse": {"versionGuard":195} }

Create update client task:

Request: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcCreateClientTaskRequest":{"staticObjectData":{"name":"scenarioUpdateClient","description":"description"},"clientTaskConfiguration":{"taskType":5,"taskUpdate":{}}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcCreateClientTaskResponse": {"staticObjectIdentification":{"uuid":{"uuid":"6e7fc02b-d76c-414d-9f83-9e952c8d449c"},"versionGuard":196}} }

Create scan client task:

Request: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcCreateClientTaskRequest":{"staticObjectData":{"name":"scenarioScanClient","description":"description"},"clientTaskConfiguration":{"taskType":1,"taskOnDemandScan":{"scanProfile":0,"customProfileName":"","scanTargets":["eset:\/\/AllTargets"],"cleaningEnabled":false}}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcCreateClientTaskResponse": {"staticObjectIdentification":{"uuid":{"uuid":"8a45cf4f-b548-47f5-966c-53cccfe9b181"},"versionGuard":198}} }

Add client task now:

Request:

{"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcAddClientTaskTargetRequest":{"clientTaskUuid" : {"uuid" : "8a45cf4f-b548-47f5-966c-53cccfe9b181"},"targetUuid" : {"uuid" : "e8e50609-b3bf-4a36-a736-7e411391d2a4"},"clientTriggerConfiguration" : {"triggerType" : 4,"triggerThrottle" : {},"asapTriggerCfg" : {}}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcAddClientTaskTargetResponse": {"clientTriggerStaticObjectIdentification":{"uuid":{"uuid":"d18bc6ab-14f9-4b05-bc5d-7354bd248ae3"},"versionGuard":212}} }

Remove client task target:

Request: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcRemoveClientTaskTargetRequest":{"staticObjectIdentification":{"uuid":{"uuid":"726e84b5-de89-46e5-b006-f47cf0612074"},"versionGuard":10000}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcRemoveClientTaskTargetResponse": {} }

Remove task:

Request: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcRemoveClientTaskRequest":{"staticObjectIdentification":{"uuid":{"uuid":"4ed41225-bd0c-4002-94b5-6dab2a01d239"},"versionGuard":10000}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.TasksTriggers.RpcRemoveClientTaskResponse": {} }

Create report template category:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcCreateReportTemplateCategoryRequest" : {"staticObjectData" : {"name" : "TestReportTemplateCategory","description" : "description"}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcCreateReportTemplateCategoryResponse": {"staticObjectIdentification":{"uuid":{"uuid":"edc28ace-f8d2-4c62-b50f-cc18fd53f0b5"},"versionGuard":223}} }

Create report template:

Request:

{"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcCreateReportTemplateRequest" : {"staticObjectData" : {"name" : "scenarioGenerateReport","description" : "description"},"reportTemplate" : {"data" : {"used_symbol" : [{"column_id" : 0,"symbol_id" : 644,"aggregation_parameter" : {}}],"query_usage_definition_id" : 22},"rendering" : {"draw_chart" : false,"draw_table" : true,"table" : {"type_id" : 101,"columns" : [{"column_id" : 0,"order" : 0,"width" : 1,"label" : {"type" : 1,"res_id" : 508906757892866218,"literal" : "Computer name"}}]}}},"categoryUuid" : {"uuid" : "edc28ace-f8d2-4c62-b50f-cc18fd53f0b5"}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcCreateReportTemplateResponse": {"staticObjectIdentification":{"uuid":{"uuid":"5064a4c1-d7ac-4ab6-b6f1-473d277b17a2"},"versionGuard":224}} }

Generate report from report template uuid:

Request:

{"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcGenerateReportRequest" : {"reportTemplateUuid" : {"uuid" : "5064a4c1-d7ac-4ab6-b6f1-473d277b17a2"}}}

Response:

{"Era.ServerApi.ReportCSVResponse": {"reportCSV":"Computer name\nera-latest\nzmazma\ncomputer1"} }

Generate report from report template:

Request:

{"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcGenerateReportRequest" : {"reportTemplate" : {"data" : {"used_symbol" : [{"column_id" : 0,"symbol_id" : 644,"aggregation_parameter" : {}}],"query_usage_definition_id" : 22},"rendering" : {"draw_chart" : false,"draw_table" : true,"table" : {"type_id" : 101,"columns" : [{"column_id" : 0,"order" : 0,"width" : 1,"label" : {"type" : 1,"res_id" : 508906757892866218,"literal" : "Computer name"}}]}}}}}

Response:

{"Era.ServerApi.ReportCSVResponse": {"reportCSV":"Computer name\nera-latest\nzmazma\ncomputer1"} }

Remove report template:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcRemoveReportTemplateRequest" : {"staticObjectIdentification" : {"uuid" : {"uuid" : "5064a4c1-d7ac-4ab6-b6f1-473d277b17a2"},"versionGuard" : 224}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcRemoveReportTemplateResponse": {} }

Remove report template category:

Request: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcRemoveReportTemplateCategoryRequest" : {"staticObjectIdentification" : {"uuid" : {"uuid" : "edc28ace-f8d2-4c62-b50f-cc18fd53f0b5"},"versionGuard" : 223}}}

Response: {"Era.Common.NetworkMessage.ConsoleApi.Reports.RpcRemoveReportTemplateCategoryResponse": {} }

Close connection:

Request:

{"Era.ServerApi.CloseConnectionRequest":{}}

Response:

{"Era.ServerApi.SimpleResponse": {"result":true} }

Stop ServerApi:

Request:

{"Era.ServerApi.StopRequest":{}}

Response:

{"Era.ServerApi.SimpleResponse": {"result":true} }