'/data/stats', 'MetricDataStatsHandler', '/export', 'ModelExportHandler', '/([-\w]*)', 'ModelHandler', '/([-\w]*)/data', 'MetricDataHandler', '/([-\w]*)/export', 'ModelExportHandler', ) # Validation schema as specified by validictory syntax, # for checking JSON before model creation. # The enums do most of the checking here. _CLOUDWATCH_MODEL_CREATION_SCHEMA = loadSchema( "cloudwatch_model_creation_schema.json") # Schema for validating custom metrics model creation _CUSTOM_MODEL_CREATION_SCHEMA = loadSchema("custom_model_creation_schema.json") # Schema for checking valid autostack creation JSON (legacy) _AUTOSTACK_CREATION_SCHEMA = loadSchema("autostack_creation_schema.json") # Schema for checking valid autostack import JSON _AUTOSTACK_MODEL_IMPORT_SCHEMA = loadSchema( "autostack_model_import_schema.json") def formatMetricRowProxy(metricObj): if metricObj.tag_name is not None and len(metricObj.tag_name) > 0: displayName = "%s (%s)" % (metricObj.tag_name, metricObj.server)
"InstanceDefaultsHandler", "/(.+)/(.+\/.+)", "InstanceDefaultsHandler", "/?", "InstancesHandler", # /_instances/suggestions "/suggestions", "InstanceSuggestionsHandler", # /_instances/suggestions/us-west-2 "/suggestions/(.+?)", "InstanceSuggestionsHandler", ) # Validation schema to ensure we are getting an array of strings. # Does not validate valid region or namespace, those are handled elsewhere. _INSTANCES_MODEL_CREATION_SCHEMA = loadSchema( "instances_model_creation_schema.json") class InstanceDefaultsHandler(AuthenticatedBaseHandler): @quotaErrorResponseWrapper def POST(self, region, namespace, instanceId=None): """ Monitor a set of default metrics for a specific instance :: POST /_instances/{region}/{namespace}/{instanceId} Returns: ::
log = grok_logging.getExtendedLogger("webservices") urls = ( "/(.+?)/(.+?\/.+?)/(.+\/*.+)", "InstanceDefaultsHandler", "/(.+)/(.+\/.+)", "InstanceDefaultsHandler", "/?", "InstancesHandler", # /_instances/suggestions "/suggestions", "InstanceSuggestionsHandler", # /_instances/suggestions/us-west-2 "/suggestions/(.+?)", "InstanceSuggestionsHandler", ) # Validation schema to ensure we are getting an array of strings. # Does not validate valid region or namespace, those are handled elsewhere. _INSTANCES_MODEL_CREATION_SCHEMA = loadSchema( "instances_model_creation_schema.json") class InstanceDefaultsHandler(AuthenticatedBaseHandler): @quotaErrorResponseWrapper def POST(self, region, namespace, instanceId=None): """ Monitor a set of default metrics for a specific instance :: POST /_instances/{region}/{namespace}/{instanceId}
urls = ( '', 'ModelHandler', '/', 'ModelHandler', '/data', 'MetricDataHandler', '/data/stats', 'MetricDataStatsHandler', '/export', 'ModelExportHandler', '/([-\w]*)', 'ModelHandler', '/([-\w]*)/data', 'MetricDataHandler', '/([-\w]*)/export', 'ModelExportHandler', ) # Validation schema as specified by validictory syntax, # for checking JSON before model creation. # The enums do most of the checking here. _CLOUDWATCH_MODEL_CREATION_SCHEMA = loadSchema( "cloudwatch_model_creation_schema.json") # Schema for validating custom metrics model creation _CUSTOM_MODEL_CREATION_SCHEMA = loadSchema( "custom_model_creation_schema.json") # Schema for checking valid autostack creation JSON (legacy) _AUTOSTACK_CREATION_SCHEMA = loadSchema( "autostack_creation_schema.json") # Schema for checking valid autostack import JSON _AUTOSTACK_MODEL_IMPORT_SCHEMA = loadSchema( "autostack_model_import_schema.json") def formatMetricRowProxy(metricObj):