def upload_part(path, data_id, part_number): insights_external_data = InsightsExternalData() input_str = read_file(path) encoded_data = encode(input_str) data = {} data['InsightsExternalDataId'] = data_id data['PartNumber'] = part_number data['DataFile'] = encoded_data.decode('utf-8') _response = insights_external_data.upload_part(data) return _response
def upload_metadata(_path, edge_mart_alias, _format, _operation, _action): insights_external_data = InsightsExternalData() input_str = read_file(_path) encoded_metadata = encode(input_str) metadata = {} metadata["Format"] = _format metadata["Operation"] = _operation metadata["Action"] = _action metadata["EdgemartAlias"] = edge_mart_alias metadata["MetadataJson"] = encoded_metadata.decode("utf-8") response_local = insights_external_data.upload_metadata(metadata) json_data = json.loads(str(response_local)) return json_data["id"]