def METHOD_NAME(self, compartment_id=None, filter={}, recursive=False):
    if compartment_id is None:
        compartment_id = self.compartment_id
    # Recursive only valid if we are querying the root / tenancy
    recursive = (recursive and (compartment_id == self.getTenancy()))
    # Add filter to only return ACTIVE Compartments
    if filter is None:
        filter = {}
    if 'lifecycle_state' not in filter:
        filter['lifecycle_state'] = 'ACTIVE'
    compartments = oci.pagination.list_call_get_all_results(self.client.list_compartments, compartment_id=compartment_id, compartment_id_in_subtree=recursive).data
    # Convert to Json object
    compartments_json = self.toJson(compartments)
    logger.debug(str(compartments_json))
    # Filter results
    self.compartments_json = self.filterJsonObjectList(compartments_json, filter)
    logger.debug(str(self.compartments_json))
    # Generate Name / Id mappings
    for compartment in self.compartments_json:
        self.names[compartment['id']] = compartment['name']
        self.parents[compartment['id']] = compartment['compartment_id']
    # Build List of Compartment Objects that have methods for getting VCN / Security Lists / Route Tables etc
    self.compartments_obj = []
    for compartment in self.compartments_json:
        compartment['canonical_name'] = self.getCanonicalName(compartment['id'])
        compartment['display_name'] = compartment['name']
        # self.compartments_obj.append(OCICompartment(self.config, self.configfile, self.profile, compartment))
    return self.compartments_json