def get_build_info_command_msg() -> bytes: meta_data = bson_encode({'buildInfo': 1}) command_args = bson_encode({}) # "test" collection gleaned from tshark command_msg = get_command_msg("test", "buildInfo", meta_data, command_args) return command_msg
def get_is_master_msg() -> bytes: query = bson_encode({'isMaster': 1}) query_msg = get_op_query("admin.$cmd", query) return query_msg
def get_list_db_op_msg() -> bytes: section_payload = bson_encode({"listDatabases": 1, "$db": "admin"}) section = bytearray(len(section_payload) + 1) section[1:] = section_payload op_msg = get_op_msg(section) return op_msg
def get_logs_db_op_msg() -> bytes: section_payload = bson_encode({"getLog": "global", "$db": "admin"}) section = bytearray(len(section_payload) + 1) section[1:] = section_payload op_msg = get_op_msg(section) return op_msg
def get_build_info_op_msg() -> bytes: section_payload = bson_encode({"buildinfo": 1, "$db": "admin"}) section = bytearray(len(section_payload) + 1) section[1:] = section_payload op_msg = get_op_msg(section) return op_msg