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:
Section | Value |
Method | POST, PUT, GET |
URL | https://<HEAL_IP_HostName>:<HEAL_Port>/appsone-controlcenter/v2.0/api/accounts/<account-id>/<API Format> |
Request Header | |
Authorization | Get 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 Type | Application/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 Name | Description | Constraints | Mandatory / Optional |
processName | Description of the process. It should be at account level. | <=256 characters | Mandatory |
processIdentifier | It is the unique identifier of the process across the account. | <=256 characters | Optional |
hostDetails | It is the details of the host where an instance of the process starts. | Provide values for all relevant attributes of this object. | Mandatory |
hostAddress | Host address where the instance of the process starts. | <=256 characters | Mandatory |
directoryPath | Directory location where the process starts from. | <=256 characters | Mandatory |
arguments | These are the arguments to the process | Provide values for all relevant attributes of this object. | Optional |
id | Argument id | Integer | Mandatory (for updating attribute name or value) |
name | Name of the argument | <=256 characters | Mandatory if process requires attributes |
value | Value of the argument | <=256 characters | Mandatory if process requires attributes |
defaultValue | Default 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 characters | Mandatory if process requires attributes |
order | This indicates that the process expects the arguments in a pre-defined order. Default value is 0. | 1 or 0 | Optional |
placeHolder | It indicates that the argument is not a placeholder. Default value is 0. | 1 or 0 | Optional |
Sample Input
Input Json
Sample Output
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
Sample Output
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
Input Json
Sample Output
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
Sample Output
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
Type | Name | Description | Schema | Mandatory / Optional |
Query | kpiIdentifier | Unique identifier of a KPI | string | Mandatory |
Query | from | String in format YYYY-MM-DD HH:MM:SS | string | Mandatory |
Query | to | String in format YYYY-MM-DD HH:MM:SS | string | Mandatory |
Sample Input
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
Type | Name | Description | Schema | Mandatory / Optional |
Query | kpiIdentifier | Unique identifier of a KPI | string | Mandatory |
Sample Input
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 } ] }