def get_cluster_request_parameters(cluster_info, cloud_config, engine_config): ''' Use this to return final minimal request from cluster_info, cloud_config or engine_config objects Alternatively call util._make_minimal if only one object needs to be implemented ''' cluster_request = {} cloud_config = util._make_minimal(cloud_config.__dict__) if bool(cloud_config): cluster_request['cloud_config'] = cloud_config engine_config = util._make_minimal(engine_config.__dict__) if bool(engine_config): cluster_request['engine_config'] = engine_config cluster_request.update(util._make_minimal(cluster_info.__dict__)) return cluster_request