import string
import json
import jsonschema
-from jsonschema import Draft4Validator
from functools import partial
_hello_resp = '''\
#------------------------------------------------------------------------------
# Credentials we expect clients to authenticate themselves with.
#------------------------------------------------------------------------------
-vel_username = 'will'
-vel_password = 'pill'
+vel_username = ''
+vel_password = ''
#------------------------------------------------------------------------------
# The JSON schema which we will use to validate events.
else:
credentials = None
- # logger.debug('Credentials: {0}'.format(credentials))
- logger.debug('Credentials: ****')
+ logger.debug('Credentials: {0}'.format(credentials))
+ #logger.debug('Credentials: ****')
#--------------------------------------------------------------------------
# If we have a schema file then check that the event matches that expected.
start_response('202 Accepted', [])
yield ''
else:
- logger.warn('Failed to authenticate OK')
- print('Failed to authenticate OK')
+ logger.warn('Failed to authenticate OK'+vel_username + ':' + vel_password)
+ print('Failed to authenticate OK'+vel_username + ':' + vel_password)
#----------------------------------------------------------------------
# Respond to the caller.
help='Display version information')
parser.add_argument('-a', '--api-version',
dest='api_version',
- default='3',
+ default='5',
help='set API version')
parser.add_argument('-c', '--config',
dest='config',
global throttle_schema
global test_control_schema
vel_schema = json.load(open(vel_schema_file, 'r'))
- Draft4Validator.check_schema(vel_schema)
logger.debug('Loaded the JSON schema file')
#------------------------------------------------------------------
"description": "an instance conforming to the jsonObject schema", \r
"type": "object" \r
},\r
- "objectInstanceEpochMicrosec": {\r
+ "objectInstanceEpochMicrosec": {\r
"description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds", \r
"type": "number" \r
},\r
},\r
"required": [ "countsInTheBucket" ]\r
},\r
+ "measurementGroup": {\r
+ "description": "measurement group",\r
+ "type": "object",\r
+ "properties": {\r
+ "name": { "type": "string" },\r
+ "measurements": {\r
+ "description": "array of name value pair measurements",\r
+ "type": "array",\r
+ "items": { \r
+ "$ref": "#/definitions/field" \r
+ }\r
+ }\r
+ },\r
+ "required": [ "name", "measurements" ]\r
+ },\r
"measurementsForVfScalingFields": {\r
"description": "measurementsForVfScaling fields",\r
"type": "object",\r
}\r
}\r
},\r
- "required": [ "name", "arrayOfFields" ]\r
+ "required": [ "name", "measurements" ]\r
},\r
"otherFields": {\r
"description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration",\r