_country_code - ISO 3166-1 alpha-3, 3 character country code
_app_type - application type, i.e. android, ios, etc. Always lower case
_app_id - unique application identifier, usually a hash of some kind
_app_version - version of application
_analyzer_name - name of the analyzer that is responsible for some specific generated data
_data_type - type of recorded data, i.e. log, call, output
_creation_datetime - the ISO 8601 formatted date and time of when the data was created
The following indices are available:
Global index gcc-index allowing searching by _country_code
Global index gat-index allowing searching by _app_type
Global index lan-index allowing searching by _analyzer_name
Primary key:
Hash key composed of _country_code, _app_type, _app_id, _app_version
Range key composed of _analyzer_name
Local index ldt-index allow searching within an application by _data_type
Local index lc-index allow searching within an application by _creation_datetime
"""
__metadata__ = {
'global_indexes': [
GlobalIndex.all( 'gcc-index','country_code' ),
GlobalIndex.all( 'gat-index','app_type' ),
GlobalIndex.all( 'gboth-index','app_type','app_id')
]
}
country_code = Field( data_type=STRING )
app_type = Field( data_type=STRING )
app_id = Field( data_type=STRING )
app_version = Field( data_type=STRING )
composite_appid = Composite( 'country_code', 'app_type', 'app_id', 'app_version', hash_key=True )
analyzer_name = Field( data_type=STRING, index='lan-index' )
data_type = Field( data_type=STRING, index='ldt-index' )
data_index = Field( data_type=NUMBER )
creation_datetime = Field( data_type=datetime, index='lc-index' )
r_key = Composite( 'analyzer_name', 'data_type', 'data_index', 'creation_datetime', merge=c_composite, range_key=True)
# Connect to the server and create the table schema for the 'appdata' table.
eng = Engine( dynamo=dyn, namespace=['appdata'] )
eng.register( AppDataModel )
eng.create_schema()
# Return the engine.
return( eng )
# Create the instance for us to use...
i = AppDataModel( country_code=self.cc, app_type=self.at,
app_id=self.aid, app_version=self.av,
analyzer_name=self.an, data_type='CALL',
creation_datetime=self.dt,
)
# Write out the control data as a JSON struct
i.data = { "WhoCalledMe":who_called_me, "args":args } )
self.eng.save( i )
Since I'm running the "local dynamodb" system I can check the database and see all the stuff in Sqlite. So I know the table is there since I see 'appdata-AppDataModel' in the list of tables.