def create_br_json_data(role, type, bucket_name, index, storage):
 data = {}
 if (role == 'db_master'):
  data[JSONTags.TYPE] = 'cassandra_{0}'.format(type)
  data[JSONTags.OBJECT_NAME] = 'gs://{0}{1}'.format(bucket_name, hermes_constants.DB_MASTER_OBJECT_NAME)
 elif (role == 'db_slave'):
  data[JSONTags.TYPE] = 'cassandra_{0}'.format(type)
  data[JSONTags.OBJECT_NAME] = 'gs://{0}{1}'.format(bucket_name, hermes_constants.DB_SLAVE_OBJECT_NAME.format(index))
 else:
  return None
 data[JSONTags.STORAGE] = storage
 return json.dumps(data)

def create_br_json_data ( role , type , bucket_name , index , storage ) : data = { } if ( role == 'db_master' ) : data [ JSONTags . TYPE ] = 'cassandra_{0}' . format ( type ) data [ JSONTags . OBJECT_NAME ] = 'gs://{0}{1}' . format ( bucket_name , hermes_constants . DB_MASTER_OBJECT_NAME ) elif ( role == 'db_slave' ) : data [ JSONTags . TYPE ] = 'cassandra_{0}' . format ( type ) data [ JSONTags . OBJECT_NAME ] = 'gs://{0}{1}' . format ( bucket_name , hermes_constants . DB_SLAVE_OBJECT_NAME . format ( index ) ) else : return None data [ JSONTags . STORAGE ] = storage return json . dumps ( data )
creates a json object with the given parameters in the format that is supported by the backup_recovery_service .