find container according ID or primary admin gate url. If both are defined this will return container
        according container ID.
        :param cid: container ID
        :param primary_admin_gate_url: container primary admin gate url
        :return:

def find_container(cid=None, primary_admin_gate_url=None):
        """
        find container according ID or primary admin gate url. If both are defined this will return container
        according container ID.
        :param cid: container ID
        :param primary_admin_gate_url: container primary admin gate url
        :return:
        """
        LOGGER.debug("ContainerService.find_container")
        ret = None
        if (cid is None or not cid) and (primary_admin_gate_url is None or not primary_admin_gate_url):
            raise exceptions.ArianeCallParametersError('id and primary_admin_gate_url')

        if (cid is not None and cid) and (primary_admin_gate_url is not None and primary_admin_gate_url):
            LOGGER.debug('ContainerService.find_container - Both id and primary admin gate url are defined. '
                         'Will give you search on id.')
            # traceback.print_stack()
            primary_admin_gate_url = None

        params = None
        if cid is not None and cid:
            params = SessionService.complete_transactional_req({'ID': cid})
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params['OPERATION'] = 'getContainer'
        elif primary_admin_gate_url is not None and primary_admin_gate_url:
            params = SessionService.complete_transactional_req({'primaryAdminURL': primary_admin_gate_url})
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params['OPERATION'] = 'getContainerByPrimaryAdminURL'

        if params is not None:
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                args = {"properties": params}
            else:
                args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}

            response = ContainerService.requester.call(args)

            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                response = response.get()

            if response.rc == 0:
                ret = Container.json_2_container(response.response_content)
            elif response.rc != 404:
                err_msg = 'ContainerService.find_container - Problem while finding container (id:' + \
                          str(cid) + ', primary admin gate url '\
                          + str(primary_admin_gate_url) + ' ). ' + \
                          'Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) + \
                          " (" + str(response.rc) + ")"
                LOGGER.warning(err_msg)
                if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                    raise ArianeMappingOverloadError("ContainerService.find_container",
                                                     ArianeMappingOverloadError.ERROR_MSG)
                # traceback.print_stack()
        return ret