This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
Rest APIs for the Management Console
These API calls interact with Management Console nodes.
These API calls interact with Management Console nodes.
Alerts
GET mcTimeInfo |
Returns the current time for the MC server and the timezone of the location where the MC server is located. |
1 - MC-User-ApiKey
The MC-User-ApiKey is a user-specific key used with Management Console.
The MC-User-ApiKey is a user-specific key used with Management Console. Users must have an MC-User-ApiKey to interact with MC using the Rest API. All users with roles other than None automatically receive an MC-User-ApiKey.
This key grants users the same rights through the API that they have available through their MC roles. To interact with the MC, users pass the key in the request header for the API.
View the MC-User-ApiKey
If you are the database administrator, you can view the MC-User-ApiKey for all users. Individual users can view their own keys.
-
Connect to MC and go to MC Settings > User Management.
-
Select the user to view and click Edit. The user's key appears in the User API Key field.
2 - GET alerts
Returns a list of MC alerts, their current status, and database properties.
Returns a list of MC alerts, their current status, and database properties.
Resource URL
https://<MC_NODE>:5450/webui/api/alerts
Authentication
Requires an MC-User-Apikey in the request header.
Filter parameters
types |
The type of alert to retrieve. Valid values are:
-
info
-
notice
-
warning
-
error
-
critical
-
alert
-
emergency
|
category |
For information, see Thresholds category filter. |
db_name |
For information, see Database name category filter. |
limit |
The maximum number of alerts to retrieve. If the limit is lower than the number of existing alerts, Vertica retrieves the most recent alerts. Used with the type parameter, Vertica retrieves up to the limit for each type. For example, for a limit of five and types of critical and emergency, you could receive up to ten total alerts. |
time_from |
The timestamp start point from which to retrieve alerts. You can use this parameter in combination with the time_to parameter to retrieve alerts for a specific time range. Values must be passed in the following format: yyyy-MM-ddTHH:mm .
If you provide only the time_from parameter, and omit the time_to parameter, the response contains all alerts generated from the time_from parameter to the current time.
|
time_to |
The timestamp end point from which to retrieve alerts. You can use this parameter in combination with the time_from parameter to retrieve alerts for a specific time range. Values must be passed in the following format: yyyy-MM-ddTHH:mm .
If you provide only the time_to parameter, and omit the time_from parameter , the response contains all alerts generated from the earliest possible time to the time passed in time_to .
|
Example request
GET |
https://<MC_NODE>:5450/webui/api/alerts?types=critical |
Request alerts using cURL
This example shows how you can request alerts using cURL. In this example, the limit
parameter is set to '2' and the types
parameters is set to info
and notice
:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?limit=2&types=info,notice
Response:
[
{
"alerts":[
{
"id":5502,
"markedRead":false,
"eventTypeCode":0,
"create_time":"2016-02-02 05:12:10.0",
"updated_time":"2016-02-02 15:50:20.511",
"severity":"warning",
"status":1,
"nodeName":"v_vmart_node0001",
"databaseName":"VMart",
"databaseId":1,
"clusterName":"1449695416208_cluster",
"description":"Warning: Low disk space detected (73% in use)",
"summary":"Low Disk Space",
"internal":false,
"count":3830
},
{
"id":5501,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2016-02-02 05:12:02.31",
"updated_time":"2016-02-02 05:12:02.31",
"severity":"notice",
"status":1,
"databaseName":"VMart",
"databaseId":1,
"clusterName":"1449695416208_cluster",
"description":"Analyze Workload operation started on Database",
"summary":"Analyze Workload operation started on Database",
"internal":false,
"count":1
}
],
"total_alerts":190,
"request_query":"limit=2",
"request_time":"2016-02-02 15:50:26 -0500"
}
]
Request alerts within a time range
These examples show various ways in which you can request the same alert as in the preceding example, but within specified time ranges.
Request the alert within a specific time range, using the time_from
and time_to
parameters:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_from=2016-01-01T12:12&time_to=2016-02-01T12:12
Request the alert from a specific start time to the present using the time_from
parameter:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_from=2016-01-01T12:12
Request the alert to a specific end point using the time_to
parameter. When you use the time_to
parameter without the time_from
parameter, the time_from
parameter defaults to the oldest alerts your MC contains:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_to=2016-01-01T12:12
3 - GET mcTimeInfo
Returns the current time for the MC server and the timezone where the MC server is located.
Returns the current time for the MC server and the timezone where the MC server is located.
Resource URL
https://<MC_NODE>:5450/webui/api/mcTimeInfo
Authentication
Requires an MC-User-Apikey in the request header.
Parameters
None.
Example request
GET |
https://<MC_NODE>:5450/webui/api/mcTimeInfo |
This example shows how you can request MC time information using cURL:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/mcTimeInfo
Response:
{"mc_current_time":"Tue, 2000-01-01 01:02:03 -0500","mc_timezone":"US/Eastern"}
4 - Thresholds category filter
Returns a list of alerts related to threshold settings in MC.
Returns a list of alerts related to threshold settings in MC.
Resource URL
https://<MC_NODE>:5450/webui/api/alerts?category=thresholds
Authentication
Requires an MC-User-Apikey in the request header.
Example request
GET |
https://<MC_NODE>:5450/webui/api/alerts?category=thresholds |
This example shows how you can request alerts on thresholds using cURL:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?category=thresholds
Response:
[
{
"alerts":[
{
"id":33,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-10 10:28:41.332",
"updated_time":"2015-11-10 10:28:41.332",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":" Database: mydb Lower than threshold Node Disk I/O 10 % v_mydb_node0002 ;1.6% v_mydb_node0002 ;1.4% v_mydb_node0002 ;2.3% v_mydb_node0002 ;1.13% v_mydb_node0002 ;1.39% v_mydb_node0001 ;3.78% v_mydb_node0003 ;1.79% ",
"summary":"Threshold : Node Disk I/O < 10 %",
"internal":false,
"count":1
},
{
"id":32,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-10 10:28:40.975",
"updated_time":"2015-11-10 10:28:40.975",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":" Database: mydb Lower than threshold Node Memory 10 % v_mydb_node0002 ;5.47% v_mydb_node0002 ;5.47% v_mydb_node0002 ;5.47% v_mydb_node0002 ;5.47% v_mydb_node0002 ;5.48% v_mydb_node0003 ;4.53% ",
"summary":"Threshold : Node Memory < 10 %",
"internal":false,
"count":1
},
{
"id":31,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-10 10:28:40.044",
"updated_time":"2015-11-10 10:28:40.044",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":" Database: mydb Lower than threshold Node CPU 10 % v_mydb_node0002 ;1.4% v_mydb_node0002 ;1.64% v_mydb_node0002 ;1.45% v_mydb_node0002 ;2.49% ",
"summary":"Threshold : Node CPU < 10 %",
"internal":false,
"count":1
},
{
"id":30,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-10 10:28:34.562",
"updated_time":"2015-11-10 10:28:34.562",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":" Database: mydb Exceed threshold Node Disk Usage 60 % v_mydb_node0001 ;86.41% ",
"summary":"Threshold : Node Disk Usage > 60 %",
"internal":false,
"count":1
}
],
"total_alerts":4,
"request_query":"category=thresholds",
"request_time":"2015-11-10 10:29:17.129"
}
]
See also
5 - Database name category filter
Returns a list of MC alerts for a specific database.
Returns a list of MC alerts for a specific database.
Resource URL
https://<MC_NODE>:5450/webui/api/alerts?db_name=
Authentication
Requires an MC-User-Apikey in the request header.
Example request
GET |
https://<MC_NODE>:5450/webui/api/alerts?db_name= database_name |
This example shows how you can view alerts on a specific database using cURL:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?db_name="mydb"
Response:
[
{
"alerts":[
{
"id":9,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 15:10:53.391",
"updated_time":"2015-11-05 15:10:53.391",
"severity":"notice",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Workload analyzed successfully",
"summary":"Analyze Workload operation has succeeded on Database",
"internal":false,
"count":1
},
{
"id":8,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 15:10:31.16",
"updated_time":"2015-11-05 15:10:31.16",
"severity":"notice",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Analyze Workload operation started on Database",
"summary":"Analyze Workload operation started on Database",
"internal":false,
"count":1
},
{
"id":7,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 00:15:00.204",
"updated_time":"2015-11-05 00:15:00.204",
"severity":"alert",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Workload analyzed successfully",
"summary":"Analyze Workload operation has succeeded on Database",
"internal":false,
"count":1
},
{
"id":6,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-04 15:14:59.344",
"updated_time":"2015-11-04 15:14:59.344",
"severity":"notice",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Workload analyzed successfully",
"summary":"Analyze Workload operation has succeeded on Database",
"internal":false,
"count":1
},
{
"id":5,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-04 15:14:38.925",
"updated_time":"2015-11-04 15:14:38.925",
"severity":"notice",
"status":1,
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Analyze Workload operation started on Database",
"summary":"Analyze Workload operation started on Database",
"internal":false,
"count":1
},
{
"id":4,
"markedRead":false,
"eventTypeCode":0,
"create_time":"2015-11-04 15:14:33.0",
"updated_time":"2015-11-05 16:26:17.978",
"severity":"notice",
"status":1,
"nodeName":"v_mydb_node0001",
"databaseName":"lmydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Workload analyzed successfully",
"summary":"Analyze Workload operation has succeeded on Database",
"internal":false,
"count":1
},
{
"id":3,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-04 15:14:32.806",
"updated_time":"2015-11-04 15:14:32.806",
"severity":"info",
"status":1,
"hostIp":"10.20.100.64",
"nodeName":"v_mydb_node0003",
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Agent status is UP on IP 127.0.0.1",
"summary":"Agent status is UP on IP 127.0.0.1",
"internal":false,
"count":1
},
{
"id":2,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-04 15:14:32.541",
"updated_time":"2015-11-04 15:14:32.541",
"severity":"info",
"status":1,
"hostIp":"10.20.100.63",
"nodeName":"v_mydb_node0002",
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Agent status is UP on IP 127.0.0.1",
"summary":"Agent status is UP on IP 127.0.0.1",
"internal":false,
"count":1
},
{
"id":1,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-04 15:14:32.364",
"updated_time":"2015-11-04 15:14:32.364",
"severity":"info",
"status":1,
"hostIp":"10.20.100.62",
"nodeName":"v_mydb_node0001",
"databaseName":"mydb",
"databaseId":1,
"clusterName":"1446668057043_cluster",
"description":"Agent status is UP on IP 127.0.0.1",
"summary":"Agent status is UP on IP 127.0.0.1",
"internal":false,
"count":1
}
],
"total_alerts":9,
"request_query":"db_name=mydb",
"request_time":"2015-11-05 16:26:21.679"
}
]
6 - Combining sub-category filters with category filters
You can combine category filters with sub-category filters, to obtain alert messages for specific thresholds you set in MC.
You can combine category filters with sub-category filters, to obtain alert messages for specific thresholds you set in MC. You can also use sub-category filters to obtain information about alerts on specific resource pools in your database.
Sub-category filters
You can use the following sub-category filters with the category filters. Sub-category filters are case sensitive and must be lowercase.
Sub-Category Filter |
Alerts Related to Threshold Value Set For: |
THRESHOLD_NODE_CPU |
Node CPU |
THRESHOLD_NODE_MEMORY |
Node Memory |
THRESHOLD_NODE_DISK_USAGE |
Node Disk Usage |
THRESHOLD_NODE_DISKIO |
Node Disk I/O |
THRESHOLD_NODE_CPUIO |
Node CPU I/O Wait |
THRESHOLD_NODE_REBOOTRATE |
Node Reboot Rate |
THRESHOLD_NETIO |
Network I/O Error |
THRESHOLD_QUERY_QUEUED |
Queued Query Number |
THRESHOLD_QUERY_FAILED |
Failed Query Number |
THRESHOLD_QUERY_SPILLED |
Spilled Query Number |
THRESHOLD_QUERY_RETRIED |
Retried Query Number |
THRESHOLD_QUERY_RUNTIME |
Query Running Time |
Resource pool-specific sub-category filters
To retrieve alerts for a specific resource pool, you can use sub-category filters in combination with the following category filters:
If you use these sub-category filters without the RP_NAME
filter, the query retrieves alerts for all resource pools in your database.
Sub-Category Filter |
Alerts Related to Threshold Value Set For: |
THRESHOLD_RP_QUERY_MAX_TIME |
Queries reaching the maximum allowed execution time. |
THRESHOLD_RP_QUERY_RESOURCE_REJECT |
The number of queries with resource rejections. |
THRESHOLD_RP_QUERY_QUEUE_TIME |
The number of queries that ended because of queue time exceeding a limit. |
THRESHOLD_RP_QUERY_RUN_TIME |
The number of queries that ended because of run time exceeding a limit. |
THRESHOLD_RP_MEMORY |
The minimum allowed resource pool size. |
THRESHOLD_RP_MAX_MEMORY |
The maximum allowed resource pool size. |
Authentication
Requires an MC-User-Apikey in the request header.
Example request
GET |
https://<MC_NODE>:5450/webui/api/alerts?category=thresholds&subcategory= <subcategory_filter> |
Combine the thresholds category filter with a sub-category filter
This example shows how you can request alerts using cURL with the thresholds category filter and a sub-category filter. You apply the following filters:
-
THRESHOLDS
-
THRESHOLD_NODE_CPU
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?category=thresholds&subcategory=threshold_node_cpu
Response:
[
{
"alerts":[
{
"id":11749,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 11:04:43.997",
"updated_time":"2015-11-05 11:04:43.997",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":105,
"clusterName":"1443122180317_cluster",
"description":" Database: mydb Lower than threshold Node CPU 10 % v_mydb_node0002 ;1.03% v_mydb_node0003 ;0.9% v_mydb_node0001 ;1.36% ",
"summary":"Threshold : Node CPU < 10 %",
"internal":false,
"count":1
},
{
"id":11744,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 10:59:46.107",
"updated_time":"2015-11-05 10:59:46.107",
"severity":"warning",
"status":1,
"databaseName":"mydb2",
"databaseId":106,
"clusterName":"1443552354071_cluster",
"description":" Database: mydb2 Lower than threshold Node CPU 10 % v_mydb2_node0002 ;0.83% v_mydb2_node0001 ;1.14% ",
"summary":"Threshold : Node CPU < 10 %",
"internal":false,
"count":1
}
],
"total_alerts":2,
"request_query":"category=thresholds&subcategory=threshold_node_cpu",
"request_time":"2015-11-05 11:05:28.116"
}
]
Request an alert on a specific resource pool
This example shows how you can request alerts using cURL on a specific resource pool. The name of the resource pool is resourcepool1
. You apply the following filters:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?category=thresholds&subcategory=threshold_rp_query_run_time&rp_name=resourcepool1
Response:
[
{
"alerts":[
{
"id":6525,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 14:25:36.797",
"updated_time":"2015-11-05 14:25:36.797",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":106,
"clusterName":"1443552354071_cluster",
"description":" Resource Pool: resourcepool1 Threshold Name: Ended Query with Run Time Exceeding Limit Time Interval: 14:20:36 to 14:25:36 Threshold Value: 0 min(s) Actual Value: 2186 query(s) ",
"summary":"Resource Pool: resourcepool1; Threshold : Ended Query with Run Time Exceeding Limit > 0 min(s)",
"internal":false,
"count":1
},
{
"id":6517,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2015-11-05 14:20:39.541",
"updated_time":"2015-11-05 14:20:39.541",
"severity":"warning",
"status":1,
"databaseName":"mydb",
"databaseId":106,
"clusterName":"1443552354071_cluster",
"description":" Resource Pool: resourcepool1 Threshold Name: Ended Query with Run Time Exceeding Limit Time Interval: 14:15:39 to 14:20:39 Threshold Value: 0 min(s) Actual Value: 2259 query(s) ",
"summary":"Resource Pool: resourcepool1; Threshold : Ended Query with Run Time Exceeding Limit > 0 min(s)",
"internal":false,
"count":1
}
],
"total_alerts":14,
"request_query":"category=thresholds&subcategory=threshold_rp_query_run_time&rp_name=resourcepool1",
"request_time":"2015-11-05 11:07:43.988"
}
]