Capacity Predictive Analytics APIs

doisaas
Contents
URL Structure
The base REST end point URL is:
http://<cpa_host>:8080/rest/version
Where <cpa_host> is the host name or IP address of the CPA host system.
WADL Description
The web application description (WADL) file that specifies all exposed service calls and structures is available at:
http://<cpa_host>:8080/rest/services/application.wadl
Where <cpa_host> is the host name or IP address of the CPA host system.
CPA Administrator Credentials
Example with default settings:
  • Username - admin
  • Password - admin
Administrator Credentials with TenantID
Example with default settings:
Tenants Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create Tenant
http://<cpa_host>:8080/rest/tenants
CPA administrator credentials
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
{
"tenantId": "12af586b-78bc-0ac2-0067-4f23164a5a65"
}
{
"id": 2,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"tenantName": "12af586b-78bc-0ac2-0067-4f23164a5a65",
"username": null,
"password": null,
"roles": "tenant",
"origin": "12af586b-78bc-0ac2-0067-4f23164a5a65",
"createDate": "2017-08-02T13:34:37.582793",
"modDate": "2017-08-02T13:34:37.582793",
"enabled": true
}
Update Tenant
http://<cpa_host>:8080/rest/tenants
CPA administrator credentials
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{
"tenantId":"12af586b_78bc_0ac2_0067_4f23164a5a65",
"tenantName": "CPA Tenant New Name"
}
{
"id": 2,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"tenantName": "CPA Tenant New Name",
"username": null,
"password": null,
"roles": null,
"origin": null,
"createDate": null,
"modDate": null,
"enabled": null
}
Retrieve All Tenants
http://<cpa_host>:8080/rest/tenants/
CPA administrator credentials
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
[
{
"id": 1,
"tenantId": "CPA",
"tenantName": "CPA Admin",
"username": "admin",
"password": "+cGxrikT2Z8=",
"roles": "admin",
"origin": null,
"createDate": "2017-08-02T13:28:45.082422",
"modDate": "2017-08-02T13:28:45.082422",
"enabled": true
},
{
"id": 2,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"tenantName": "12af586b-78bc-0ac2-0067-4f23164a5a65",
"username": null,
"password": null,
"roles": "tenant",
"origin": "12af586b-78bc-0ac2-0067-4f23164a5a65",
"createDate": "2017-08-02T13:34:37.582793",
"modDate": "2017-08-02T13:34:37.582793",
"enabled": true
},
{
"id": 3,
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b",
"tenantName": "46c9b400-6129-64c3-b4a0-0537b665436b",
"username": null,
"password": null,
"roles": "tenant",
"origin": "46c9b400-6129-64c3-b4a0-0537b665436b",
"createDate": "2017-08-02T14:09:11.110532",
"modDate": "2017-08-02T14:09:11.110532",
"enabled": true
}
]
Retrieve Specific Tenant
http://<cpa_host>:8080/rest/tenants/{tenantId}
  • Use the GET tenants API to retrieve the tenantId value.
CPA administrator credentials
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
{
"id": 3,
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b",
"tenantName": "46c9b400-6129-64c3-b4a0-0537b665436b",
"username": null,
"password": null,
"roles": "tenant",
"origin": "46c9b400-6129-64c3-b4a0-0537b665436b",
"createDate": "2017-08-02T14:09:11.110532",
"modDate": "2017-08-02T14:09:11.110532",
"enabled": true
}
Delete Specific Tenant
http://<cpa_host>:8080/rest/tenants/{tenantId}
  • Use the GET tenants API to retrieve the tenantId value.
CPA administrator credentials
Method: DELETE
Content-Type: application/json
Authorization: Basic
Body:
BLANK
Tenant has been removed
Groups Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create Group
http://<cpa_host>:8080/rest/groups/
Administrator credentials with TenantID
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
[
{"sourceGroupId":"32","groupName":"CPA Group1"}
]
[
{
"groupId": 1,
"sourceParentId": null,
"sourceGroupId": "32",
"groupName": "CPA Group1",
"adapterId": 2,
"external": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"fullPath": "CPA Group1",
"origin": null,
"sourceContainer": false
}
]
Update Group
http://<cpa_host>:8080/rest/groups/
Administrator credentials with TenantID
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{"groupId":"1","groupName":"CPA Group123"}
{
"groupId": 1,
"sourceParentId": null,
"sourceGroupId": "32",
"groupName": "CPA Group123",
"adapterId": 2,
"external": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"fullPath": "CPA Group1",
"origin": null,
"sourceContainer": false
}
Retrieve All Groups
http://<cpa_host>:8080/rest/groups/
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
[
{
"groupId": 4,
"sourceParentId": null,
"sourceGroupId": "14",
"groupName": "CPA Group2",
"adapterId": 2,
"external": true,
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b",
"fullPath": "CPA Group2",
"origin": null,
"sourceContainer": false
},
{
"groupId": 1,
"sourceParentId": null,
"sourceGroupId": "32",
"groupName": "CPA Group123",
"adapterId": 2,
"external": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"fullPath": "CPA Group1",
"origin": null,
"sourceContainer": false
}
]
Retrieve Specific Group
http://<cpa_host>:8080/rest/groups/{groupId}
  • Use the GET groups API to retrieve the groupId value.
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
[
{
"groupId": 4,
"sourceParentId": null,
"sourceGroupId": "14",
"groupName": "CPA Group2",
"adapterId": 2,
"external": true,
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b",
"fullPath": "CPA Group2",
"origin": null,
"sourceContainer": false
}
]
Delete Specific Group
http://<cpa_host>:8080/rest/groups/{groupId}
  • Use the GET groups API to retrieve the groupId value.
Administrator credentials with TenantID
Method: DELETE
Content-Type: application/json
Authorization: Basic
Body:
BLANK
The group is removed.
Business Hour (BH) Windows Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create BH Window
http://<cpa_host>:8080/rest/bhwindows
Administrator credentials with TenantID
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
{"name":"Boston M-F 8 Hours","timezoneId":"UTC-5","enabled":true,"configs":[
{"hourStart":8,"hourEnd":17,"weekDay":2},
{"hourStart":8,"hourEnd":17,"weekDay":3},
{"hourStart":8,"hourEnd":17,"weekDay":4},
{"hourStart":8,"hourEnd":17,"weekDay":5},
{"hourStart":8,"hourEnd":17,"weekDay":6}
]
}
{
"windowId": 12,
"name": "Boston M-F 8 Hours",
"timezoneId": "UTC-5",
"configs": [
{
"hourStart": 8,"hourEnd": 17,"weekDay": 2, "windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 3,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 4,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 5,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 6,"windowId": 12,"id": 0
}
],
"enabled": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"groups": []
}
Update BH Window
http://<cpa_host>:8080/rest/bhwindows
Administrator credentials with TenantID
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{"windowId":11,"configs":[
{"hourStart":8,"hourEnd":19,"weekDay":2},
{"hourStart":8,"hourEnd":19,"weekDay":3},
{"hourStart":8,"hourEnd":19,"weekDay":4},
{"hourStart":8,"hourEnd":19,"weekDay":5},
{"hourStart":8,"hourEnd":20,"weekDay":6}
]
}
{
"windowId": 11,
"name": "New York M-F 8 Hours",
"timezoneId": "UTC-5",
"configs": [
{
"hourStart": 8,"hourEnd": 19, "weekDay": 2,"windowId": 11,"id": 0
},
{
"hourStart": 8,"hourEnd": 19,"weekDay": 3,"windowId": 11,"id": 0
},
{
"hourStart": 8,"hourEnd": 19,"weekDay": 4,"windowId": 11,"id": 0
},
{
"hourStart": 8,"hourEnd": 19,"weekDay": 5,"windowId": 11,
"id": 0
},
{
"hourStart": 8,"hourEnd": 20,"weekDay": 6,"windowId": 11,"id": 0
}
],
"enabled": true,
"tenantId": "e2b9e058_ef93_c50f_50b6_208c85d67266",
"groups": []
}
Retrieve All BH Windows
http://<cpa_host>:8080/rest/bhwindows
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
[
{
"windowId": 10,
"name": "Standard 24h Sun-Sat",
"timezoneId": null,
"configs": [
{"hourStart": 0,"hourEnd": 24,"weekDay": 1,"windowId": 0,"id": 0 },
{
"hourStart": 0,"hourEnd": 24,"weekDay": 2,"windowId": 0,"id": 0
},
{
"hourStart": 0,"hourEnd": 24,"weekDay": 3,"windowId": 0,"id": 0
},
{
"hourStart": 0,"hourEnd": 24,"weekDay": 4,"windowId": 0,"id": 0
},
{
"hourStart": 0,"hourEnd": 24,"weekDay": 5,"windowId": 0,"id": 0
},
{
"hourStart": 0,"hourEnd": 24,"weekDay": 6,"windowId": 0,"id": 0
},
{
"hourStart": 0,"hourEnd": 24,"weekDay": 7,"windowId": 0,"id": 0
}
],
"enabled": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"groups": []
},
{
"windowId": 12,
"name": "Boston M-F 8 Hours",
"timezoneId": "UTC-5",
"configs": [
{
"hourStart": 8,"hourEnd": 17,"weekDay": 2,"windowId": 0,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 3,"windowId": 0,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 4,"windowId": 0,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 5,"windowId": 0,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 6,"windowId": 0,"id": 0
}
],
"enabled": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"groups": []
}
]
Retrieve Specific BH Window
http://<cpa_host>:8080/rest/bhwindows/{windowId}
  • Use the GET BH windows API to retrieve the BH windowId value.
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
{
"windowId": 12,
"name": "Boston M-F 8 Hours",
"timezoneId": "UTC-5",
"configs": [
{
"hourStart": 8,"hourEnd": 17,"weekDay": 2, "windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 3,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 4,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 5,"windowId": 12,"id": 0
},
{
"hourStart": 8,"hourEnd": 17,"weekDay": 6,"windowId": 12,"id": 0
}
],
"enabled": true,
"tenantId": "12af586b_78bc_0ac2_0067_4f23164a5a65",
"groups": []
}
Delete Specific BH Window
http://<cpa_host>:8080/rest/bhwindows/{windowId}
  • Use the GET BH windows API to retrieve the BH windowId value.
Administrator credentials with TenantID
Method: DELETE
Content-Type: application/json
Authorization: Basic
Body:
BLANK
The window is removed.
Severities Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create Severity
http://<cpa_host>:8080/rest/severities
Administrator credentials with TenantID
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
{
"colorCodeRisk": "#bf4125",
"colorCodeWaste":"#bf4126",
"name": "AboveNormal",
"severityLevel": 2
}
{
"id": 22
"colorCode": " #bf4126 "
"name": " AboveNormal "
"riskWaste": -1
"severityLevel": 2
"tenantId": " 12af586b_78bc_0ac2_0067_4f23164a5a65 "
}
{
"id": 21
"colorCode": " #bf4125 "
"name": " AboveNormal "
"riskWaste": 1
"severityLevel": 2
"tenantId": " 12af586b_78bc_0ac2_0067_4f23164a5a65 "
}
Retrieve All Severity
http://<cpa_host>:8080/rest/severities
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
[
{
"id": 21
"colorCode": "#037a32"
"name": "Normal"
"riskWaste": -1
"severityLevel": 1
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 22
"colorCode": "#008B8B"
"name": "Minor "
"riskWaste": -1
"severityLevel": 4
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 23
"colorCode": "#2196F3"
"name": "Warning"
"riskWaste": -1
"severityLevel": 5
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 24
"colorCode": "#2e2ed1"
"name": "Major "
"riskWaste": -1
"severityLevel": 6
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 25
"colorCode": "#191970"
"name": "Critical"
"riskWaste": -1
"severityLevel": 7
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 26
"colorCode": "#037a32"
"name": "Normal"
"riskWaste": 1
"severityLevel": 1
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 27
"colorCode": "#5cba49"
"name": "Minor "
"riskWaste": 1
"severityLevel": 4
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 28
"colorCode": "#ffc91c"
"name": "Warning"
"riskWaste": 1
"severityLevel": 5
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 29
"colorCode": "#f7a746"
"name": "Major "
"riskWaste": 1
"severityLevel": 6
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 30
"colorCode": "#ff0000"
"name": "Critical"
"riskWaste": 1
"severityLevel": 7
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
Update Severity
http://<cpa_host>:8080/rest/severities
Administrator credentials with TenantID
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{
"colorCodeRisk": "#969684",
"colorCodeWaste": "#e07140",
"name": "Test123",
"severityLevel": 3
}
{
"id": 22
"colorCode": "#e07140"
"name": "Test123"
"riskWaste": -1
"severityLevel": 3
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
{
"id": 21
"colorCode": "#969684"
"name": "Test123"
"riskWaste": 1
"severityLevel": 3
"tenantId": "46c9b400_6129_64c3_b4a0_0537b665436b"
}
Delete Specific Severity
http://<cpa_host>:8080/rest/severities/{severityLevel}
  • Use the GET severities API to retrieve the severityLevel value.
Administrator credentials with TenantID
Method: DELETE
Content-Type: application/json
Authorization: Basic
Body:
BLANK
The severity is removed.
Thresholds Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create Threshold
http://<cpa_host>:8080/rest/thresholds
Administrator credentials with TenantID
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
[
{
"setId": 0,
"severityId": 22,
"metricCode": "DISK_UTIL",
"value": 10
},
{
"setId": 1,
"severityId": 22,
"metricCode": "DISK_UTIL",
"value": 14
}
]
{
"id": 243
"setId": 0
"severityId": 22
"metricCode": " DISK_UTIL "
"value": 10
}
{
"id": 244
"setId": 1
"severityId": 22
"metricCode": " DISK_UTIL "
"value": 14
}
Retrieve All Threshold
http://<cpa_host>:8080/rest/thresholds
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
{
"id": 223
"setId": 0
"severityId": 13
"metricCode": "SWAP_MEMORY_UTIL"
"value": 15
}
{
"id": 172
"setId": 0
"severityId": 18
"metricCode": "DISK_UTIL"
"value": 43
}
{
"id": 143
"setId": 0
"severityId": 13
"metricCode": "MEMORY_UTIL"
"value": 15
}
{
"id": 221
"setId": 0
"severityId": 12
"metricCode": "SWAP_MEMORY_UTIL"
"value": 20
}
Update Threshold
http://<cpa_host>:8080/rest/thresholds
Administrator credentials with TenantID
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{
"id": 242,
"setId": 0,
"severityId": 21,
"metricCode": "DISK_UTIL",
"value": 21
}
{
"id": 242
"setId": 0
"severityId": 21
"metricCode": "DISK_UTIL"
"value": 21
}
Metric Definitions Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Get Metric Definitions
http://<cpa_host>:8080/rest/metricdefinitions
Administrator credentials with TenantID
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
{
"metricCode": " TPP_UTIL "
"name": " TPP(CPU) Utilization "
"family": " Compute "
"minValue": 0
"maxValue": 100
"unit": " % "
"calculated": false
"enabled": true
"persisted": true
"metricFormula": null
}
{
"metricCode": " MEMORY_UTIL "
"name": " Memory Utilization "
"family": " Memory "
"minValue": 0
"maxValue": 100
"unit": " % "
"calculated": false
"enabled": true
"persisted": true
"metricFormula": null
}
{
"metricCode": " DISK_UTIL "
"name": " Disk Utilization "
"family": " Disk "
"minValue": 0
"maxValue": 100
"unit": " % "
"calculated": false
"enabled": true
"persisted": true
"metricFormula": null
}
{
"metricCode": " MEMORY_PAGING "
"name": " Memory Paging "
"family": " Memory "
"minValue": 0
"maxValue": 10000
"unit": " kb/s "
"calculated": false
"enabled": false
"persisted": false
"metricFormula": null
}
{
"metricCode": " MEMORY_RISK_INDEX "
"name": " Memory Risk Index "
"family": " Memory "
"minValue": 0
"maxValue": 100
"unit": " % "
"calculated": true
"enabled": false
"persisted": true
"metricFormula": " 30*(${MEMORY_UTIL} > 90 ?1: ${MEMORY_UTIL}/90) + 50*(${MEMORY_PAGING} > 6000 ? 1: ${MEMORY_PAGING}/6000) + 20*(${SWAP_MEMORY_UTIL} > 80? 1: ${SWAP_MEMORY_UTIL}/80) "
}
{
"metricCode": " SWAP_MEMORY_UTIL "
"name": " Swap Memory Usage "
"family": " Memory "
"minValue": 0
"maxValue": 100
"unit": " % "
"calculated": false
"enabled": false
"persisted": false
"metricFormula": null
}
Adapters Object Calls
Operation
End Point
Authorization
Sample Request
Sample Response
Create Adapter
http://<cpa_host>:8080/rest/adapters
CPA administrator credentials
Method: POST
Content-Type: application/json
Authorization: Basic
Body:
{
"type": "ELASTIC",
"name": "UIM",
"enabled": true,
"props": {
"inventoryPath": "*inventory_uim_device*",
"port": "9200",
"host": "elastic.ca.com",
"importdays": "5",
"metricPath": "*metrics_uim*",
"delayhours": "3"
}
}
{
"id": 3
"type": "ELASTIC"
"name": "UIM"
"enabled": true
"props":
{
"inventoryPath": "*inventory_uim_device*"
"port": "9200"
"host": "elastic.ca.com"
"importdays": "5"
"metricPath": "*metrics_uim*"
"delayhours": "3"
}
}
Edit Adapter
http://<cpa_host>:8080/rest/adapters
CPA administrator credentials
Method: PUT
Content-Type: application/json
Authorization: Basic
Body:
{
"id": 3,
"enabled":true,
"props": {
"inventoryPath": "*inventory_uim_device*",
"port": "9200",
"host": "elastic.ca.com",
"importdays": "2",
"metricPath": "*metrics_uim*",
"delayhours": "1"
}
}
{
"id": 3
"type": "ELASTIC"
"name": "UIM"
"enabled": true
"props":
{
"inventoryPath": "*inventory_uim_device*"
"port": "9200"
"host": "elastic.ca.com"
"importdays": "2"
"metricPath": "*metrics_uim*"
"delayhours": "1"
}
}
Get All Adapters
http://<cpa_host>:8080/rest/adapters
CPA administrator credentials
Method: GET
Content-Type: application/json
Authorization: Basic
Body:
BLANK
{
"id": 2
"type": "ELASTIC"
"name": "UIM"
"enabled": true
"props":
{
"inventoryPath": "*inventory_uim_device*"
"port": "9200"
"host": "elastic.ca.com"
"importdays": "2"
"metricPath": "*metrics_uim*"
"delayhours": "1"
}
}
{
"id": 1
"type": "CSV"
"name": "CSV"
"enabled": false
"props":
{
}
}
Delete Adapter
http://<cpa_host>:8080/rest/adapters//{adapter_id}
CPA administrator credentials
Method: DELETE
Content-Type: application/json
Authorization: Basic
Body:
BLANK
The adapter is removed.