|
class Endpoint(Enum): |
|
METRICS = \ |
|
EndpointInfo( |
|
URL('/api/v2/metrics'), |
|
ResponseSelector('metrics'), |
|
Params({'writtenSince': '{time}', |
|
'fields': 'unit,aggregationTypes'}), |
|
None) |
|
METRICS_QUERY = \ |
|
EndpointInfo( |
|
URL('/api/v2/metrics/query'), |
|
ResponseSelector('result'), |
|
Params({'metricSelector': '{metricSelector}'}), |
|
None) |
|
METRIC_DESCRIPTORS = \ |
|
EndpointInfo( |
|
URL('/api/v2/metrics/{metricKey}'), |
|
ResponseSelector('metricId'), |
|
None, |
|
PathParam('metricKey')) |
|
ENTITIES = \ |
|
EndpointInfo( |
|
URL('/api/v2/entities'), |
|
ResponseSelector('entities'), |
|
Params({'entitySelector': 'type(\"{entitySelector}\")'}), |
|
None, |
|
["HOST", "PROCESS_GROUP_INSTANCE", "PROCESS_GROUP", "APPLICATION", "SERVICE", "SYNTHETIC_TEST", |
|
"SYNTHETIC_TEST_STEP"]) |
|
ENTITY = \ |
|
EndpointInfo( |
|
URL('/api/v2/entities/{entityId}'), |
|
ResponseSelector("entityId"), |
|
None, |
|
PathParam('entityId')) |
|
PROBLEM = \ |
|
EndpointInfo( |
|
URL('/api/v2/problems/{problemId}'), |
|
ResponseSelector('problemId'), |
|
None, |
|
PathParam('problemId')) |
|
PROBLEMS = \ |
|
EndpointInfo( |
|
URL('/api/v2/problems'), |
|
ResponseSelector('problems'), |
|
None, |
|
None) |
|
EVENTS = \ |
|
EndpointInfo( |
|
URL('/api/v2/events'), |
|
ResponseSelector('events'), |
|
None, |
|
None) |
|
SYNTHETIC_LOCATIONS = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/locations'), |
|
ResponseSelector('locations'), |
|
None, |
|
None) |
|
SYNTHETIC_TESTS_ON_DEMAND = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/executions'), |
|
ResponseSelector('executions'), |
|
Params({'schedulingFrom': '{time}'}), |
|
None) |
|
SYNTHETIC_TEST_ON_DEMAND = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/executions/{executionId}/fullReport'), |
|
ResponseSelector('entityId'), |
|
None, |
|
PathParam('executionId')) |
|
SYNTHETIC_MONITORS_HTTP = \ |
|
EndpointInfo( |
|
URL('/api/v1/synthetic/monitors'), |
|
ResponseSelector('monitors'), |
|
None, |
|
None) |
|
SYNTHETIC_MONITOR_HTTP = \ |
|
EndpointInfo( |
|
URL('/api/v1/synthetic/monitors/{entityId}'), |
|
ResponseSelector('entityId'), |
|
None, |
|
PathParam('entityId')) |
|
SYNTHETIC_MONITOR_HTTP_V2 = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/execution/{monitorId}'), |
|
ResponseSelector('monitorId'), |
|
None, |
|
PathParam('monitorId'), |
|
["SUCCESS", "FAILED"]) |
|
# This is a hack because SYNTHETIC_MONITORS_HTTP returns entityIds and others return monitorIds |
|
SYNTHETIC_MONITOR_ENTITY_V2 = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/execution/{entityId}'), |
|
ResponseSelector('entityId'), |
|
None, |
|
PathParam('entityId'), |
|
["SUCCESS", "FAILED"]) |
|
SYNTHETIC_TESTS_RESULTS = \ |
|
EndpointInfo( |
|
URL('/api/v2/synthetic/tests/results'), |
|
ResponseSelector('results'), |
|
None, |
|
None) |