How Can We Help?

This section describes the APIs for adding, updating, deleting, and fetching the batch job details from the Percona database.

API Request

API requests must contain the following:

SectionValue
MethodPOST, PUT, GET
URLhttps://<HEAL_IP_HostName>:<HEAL_Port>/appsone-controlcenter/v2.0/api/accounts/<account-id>/<API Format>
Request Header
AuthorizationGet the access token from HEAL Server. Mention client_id as ‘admin-cli’ and grant_type as ‘password’.

Command:

curl -X POST -d “client_id=<id>” -d “username=<HEAL_username>” -d

“password=<HEAL_password>” -d “grant_type=<type>”

https://<HEAL_IP_HostName>:<HEAL_Port>/auth/realms/master/protocol/openid-connect/token

Example:

curl -X POST -d “client_id=admin-cli” -d “username=username” -d

“password=password@123” -d “grant_type=password”

https://testservernode1:8443/auth/realms/master/protocol/openid-

connect/token

Content TypeApplication/json

 

URL Details as follows:

  • HEAL_IP_Hostname: IP Address or the Hostname of the server where HEAL is installed.
  • HEAL_Port: Port number of the server where HEAL is running.
  • AccountIdentifier: Identifier of the Account being monitored. Account Identifier is available in the Manage Accounts Screen of HEAL Control Center UI.

APIs

Creating a Batch Job and Adding Process Details

To create a batch job and adding process details to it for a specific account, use the ‘process-details’ API as follows:
API Name – process-details
<API Format> – batch-details/<batchJobName>/process-details

Method – POST

Input Parameter

Following are the parameters in the input json.

Attribute NameDescriptionConstraintsMandatory / Optional
processNameDescription of the process. It should be at account level.<=256 charactersMandatory
processIdentifierIt is the unique identifier of the process across the account.<=256 charactersOptional
hostDetailsIt is the details of the host where an instance of the process starts.Provide values for all relevant attributes of this object.Mandatory
hostAddressHost address where the instance of the process starts.<=256 charactersMandatory
directoryPathDirectory location where the process starts from.<=256 charactersMandatory
argumentsThese are the arguments to the processProvide values for all relevant attributes of this object.Optional
idArgument idIntegerMandatory (for updating attribute name or value)
nameName of the argument<=256 charactersMandatory if process requires attributes
valueValue of the argument<=256 charactersMandatory if process requires attributes
defaultValueDefault value of the argument. It is used in case the argument is a placeholder and the “value” of the argument is invalid (NULL or Empty).<=256 charactersMandatory if process requires attributes
orderThis indicates that the process expects the arguments in a pre-defined order. Default value is 0.1 or 0Optional
placeHolderIt indicates that the argument is not a placeholder. Default value is 0.1 or 0Optional

Sample Input

http://<heal-ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-details/test1/process-details

Input Json

{ “processName” : “java_1”, “processIdentifier” : “java_1”, “hostDetails” : [ { “hostAddress” : “192.168.13.110”, “directoryPath” : “/export/home/appnomic”, “arguments” : [ { “name” : “workDir”, “value” : “/export/home/appnomic”, “defaultValue” : “/export/home/appnomic”, “order” : 1, “placeHolder” : 1 } ] } ] }

Sample Output

{ “message”: “Batch process added successfully”, “responseStatus”: “SUCCESS”, “data”: { “id”: 2, “name”: “java_1”, “identifier”: “java_1” } }

Fetching Batch Job Details

To fetch details of all the processes for a specific batch job, use the ‘process-details’ API as follows:
API Name – process-details
<API Format> – batch-details/<batchJobName>/process-details

Method – GET

Sample Input

http://<heal_ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-details/test1/process-details

Sample Output

{ “message”: “Batch processes fetched successfully”, “responseStatus”: “SUCCESS”, “data”: [ { “processId”: 2, “processName”: “java_1”, “processIdentifier”: “java_1”, “hostDetails”: [ { “id”: 2, “hostAddress”: “192.168.13.110”, “directoryPath”: “/export/home/appnomic”, “arguments”: [ { “id”: 2, “name”: “workDir”, “value”: “/export/home/appnomic”, “defaultValue”: “/export/home/appnomic”, “order”: 1, “placeHolder”: 1 } ] } ] } ] }

Updating Batch Job Details

To update details of a specific process for a batch job, use the ‘process-details’ API as follows:
API Name – process-details
<API Format> – batch-details/<batchJobName>/process-details/<process-id>

<process-id> : Unique identifier of a process.

Method – PUT

Sample Input

http://<heal-ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-details/test1/process-details/2

Input Json

{ “hostDetails” : [ { “hostAddress” : “192.168.13.121”, “directoryPath” : “/export/home/appnomic”, “arguments” : [ { “name” : “workDir”, “value” : “/export/home/appnomic”, “defaultValue” : “/export/home/appnomic”, “order” : 1, “placeHolder” : 1 } ] } ] }

Sample Output

{ “message”: “Batch process updated successfully”, “responseStatus”: “SUCCESS”, “data”: “Success” }

Deleting Batch Job Details

To delete details of a specific process for a batch job, use the ‘process-details’ API as follows:
API Name – process-details
<API Format> – batch-details/<batchJobName>/process-details/<process-id>

<process-id> : Unique identifier of a process.

Method – DELETE

Sample Input

http://<heal-ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-details/test/process-details/1

Sample Output

{ “message”: “Batch process deleted successfully”, “responseStatus”: “SUCCESS”, “data”: “Success” }

Creating thresholds

To calculate the thresholds based on the time range and the KPI identifier, use the ‘thresholds’ API as follows. This API calculates the average of CPU time.

API Name – thresholds
<API Format> – batch-job/<batchJobId>/thresholds

<batchJobId> – Unique identifier of a batch job.

Method – POST

Input Parameters

TypeNameDescriptionSchemaMandatory / Optional
QuerykpiIdentifierUnique identifier of a KPIstringMandatory
QueryfromString in format YYYY-MM-DD HH:MM:SSstringMandatory
QuerytoString in format YYYY-MM-DD HH:MM:SSstringMandatory

Sample Input

http://<heal-ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-job/test/thresholds?kpiIdentifier=BATCH_JOB_CPU_TIME&from=2021-02-26 07%3A22%3A54&to=2021-03-01 23%3A22%3A54

Sample Output

{ “message”: “Batch Job Thresholds Processed and List fetched Successfully”, “responseStatus”: “SUCCESS”, “data”: [ { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 513, “minute”: 1, “operationType”: “lesser than”, “thresholdTime”: 1614612744708, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 4330 }, “metaData”: null }, { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 513, “minute”: 2, “operationType”: “lesser than”, “thresholdTime”: 1614612744710, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 2550 }, “metaData”: null }, { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 513, “minute”: 3, “operationType”: “lesser than”, “thresholdTime”: 1614612744710, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 4440 }, “metaData”: null }

]

}

Fetching Thresholds

To fetch thresholds for a specific KPI for all the batch jobs, use the ‘thresholds’ API as follows:
API Name – thresholds
<API Format> – batch-job/thresholds

Method – GET

Input Parameter

TypeNameDescriptionSchemaMandatory / Optional
QuerykpiIdentifierUnique identifier of a KPIstringMandatory

Sample Input

https://<heal-ip>:<heal-port>/appsone-controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917-jkhg-6c79b-1/batch-job/thresholds?kpiIdentifier=BATCH_JOB_CPU_TIME

Sample Output

{ “message”: “Thresholds List fetched Successfully”, “responseStatus”: “SUCCESS”, “data”: [ { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 518, “minute”: 1, “operationType”: “lesser than”, “thresholdTime”: 1614165706402, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 9188.57142857143 }, “metaData”: null }, { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 518, “minute”: 2, “operationType”: “lesser than”, “thresholdTime”: 1614165706404, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 2860 }, “metaData”: null }, { “batchJobId”: “test”, “kpiIdentifier”: “BATCH_JOB_CPU_TIME”, “kpiId”: 518, “minute”: 3, “operationType”: “lesser than”, “thresholdTime”: 1614165706405, “thresholdType”: “Static”, “thresholdsMap”: { “MIN”: 2440 }, “metaData”: null }

]

}

Table of Contents