Returns the server capabilities

        raises: IloError on an error from iLO.
487094
def get_server_capabilities(self):
        
        capabilities = {}

        sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
        sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
        try:
            count = len(sushy_system.pci_devices.gpu_devices)
            boot_mode = rf_utils.get_supported_boot_mode(
                sushy_system.supported_boot_mode)
            capabilities.update(
                {'pci_gpu_devices': count,
                 'ilo_firmware_version': sushy_manager.firmware_version,
                 'rom_firmware_version': sushy_system.rom_version,
                 'server_model': sushy_system.model,
                 'nic_capacity': sushy_system.pci_devices.max_nic_capacity,
                 'boot_mode_bios': boot_mode.boot_mode_bios,
                 'boot_mode_uefi': boot_mode.boot_mode_uefi})

            tpm_state = sushy_system.bios_settings.tpm_state
            all_key_to_value_expression_tuples = [
                ('sriov_enabled',
                 sushy_system.bios_settings.sriov == sys_cons.SRIOV_ENABLED),
                ('cpu_vt',
                 sushy_system.bios_settings.cpu_vt == (
                     sys_cons.CPUVT_ENABLED)),
                ('trusted_boot',
                 (tpm_state == sys_cons.TPM_PRESENT_ENABLED
                  or tpm_state == sys_cons.TPM_PRESENT_DISABLED)),
                ('secure_boot', self._has_secure_boot()),
                ('iscsi_boot',
                 (sushy_system.bios_settings.iscsi_resource.
                  is_iscsi_boot_supported())),
                ('hardware_supports_raid',
                 len(sushy_system.smart_storage.array_controllers.
                     members_identities) > 0),
                ('has_ssd',
                 common_storage.has_ssd(sushy_system)),
                ('has_rotational',
                 common_storage.has_rotational(sushy_system)),
                ('has_nvme_ssd',
                 common_storage.has_nvme_ssd(sushy_system))
                ]

            all_key_to_value_expression_tuples += (
                [('logical_raid_level_' + x, True)
                 for x in sushy_system.smart_storage.logical_raid_levels])

            all_key_to_value_expression_tuples += (
                [('drive_rotational_' + str(x) + '_rpm', True)
                 for x in
                 common_storage.get_drive_rotational_speed_rpm(sushy_system)])

            capabilities.update(
                {key: 'true'
                 for (key, value) in all_key_to_value_expression_tuples
                 if value})

            memory_data = sushy_system.memory.details()

            if memory_data.has_nvdimm_n:
                capabilities.update(
                    {'persistent_memory': (
                     json.dumps(memory_data.has_persistent_memory)),
                     'nvdimm_n': (
                     json.dumps(memory_data.has_nvdimm_n)),
                     'logical_nvdimm_n': (
                     json.dumps(memory_data.has_logical_nvdimm_n))})

        except sushy.exceptions.SushyError as e:
            msg = (self._("The Redfish controller is unable to get "
                          "resource or its members. Error "
                          "%(error)s)") % {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)
        return capabilities
673293
def get_sieve_capabilities(self):
        
        if isinstance(self.__capabilities["SIEVE"], six.string_types):
            self.__capabilities["SIEVE"] = self.__capabilities["SIEVE"].split()
        return self.__capabilities["SIEVE"]
1150377
def to_capabilities(self):
        
        caps = self._caps

        browser_options = {}
        if self.binary_location:
            browser_options["binary"] = self.binary_location
        if self.arguments:
            browser_options["args"] = self.arguments
        browser_options["useOverlayScrollbars"] = self.overlay_scrollbars_enabled

        caps[Options.KEY] = browser_options

        return caps
6862
def _validate_server_url(self):
        """"""
        try:
            request = requests.head(self.server_url)
            if request.status_code >= 400:
                raise InvenioConnectorServerError(
                    "Unexpected status code '%d' accessing URL: %s"
                    % (request.status_code, self.server_url))
        except (InvalidSchema, MissingSchema) as err:
            raise InvenioConnectorServerError(
                "Bad schema, expecting http:// or https://:\n %s" % (err,))
        except ConnectionError as err:
            raise InvenioConnectorServerError(
                "Couldn't establish connection to '%s':\n %s"
                % (self.server_url, err))
        except InvalidURL as err:
            raise InvenioConnectorServerError(
                "Invalid URL '%s':\n %s"
                % (self.server_url, err))
        except RequestException as err:
            raise InvenioConnectorServerError(
                "Unknown error connecting to '%s':\n %s"
                % (self.server_url, err))
1181965
def capability(cap_name, *args)
      cap_mod = capability_module(cap_name.to_sym)
      if !cap_mod
        raise Errors::CapabilityNotFound,
          cap:  cap_name.to_s,
          host: @cap_host_chain[0][0].to_s
      end

      cap_method = nil
      begin
        cap_method = cap_mod.method(cap_name)
      rescue NameError
        raise Errors::CapabilityInvalid,
          cap: cap_name.to_s,
          host: @cap_host_chain[0][0].to_s
      end

      args = @cap_args + args
      @cap_logger.info(
        "Execute capability: #{cap_name} #{args.inspect} (#{@cap_host_chain[0][0]})")
      cap_method.call(*args)
    end
638482
def has_capabilities(self, *caps):
		
		for cap in caps:
			if isinstance(cap, WNetworkClientCapabilities) is True:
				cap = cap.value
			if WCapabilitiesHolder.has_capabilities(self, cap) is False:
				return False
		return True
559458
def synthesize(vers, opts):
    
    parsed_version = parse_version(vers["version"])
    vers["capabilities"] = {}
    for name in opts["optional"]:
        vers["capabilities"][name] = check(parsed_version, name)
    failed = False  # noqa: F841 T25377293 Grandfathered in
    for name in opts["required"]:
        have = check(parsed_version, name)
        vers["capabilities"][name] = have
        if not have:
            vers["error"] = (
                "client required capability `"
                + name
                + "` is not supported by this server"
            )
    return vers
469955
public function get_capabilities() {
        global $DB;

        $sort = 'ORDER BY contextlevel,component,name';   // To group them sensibly for display

        $params = array();
        $sql = "SELECT *
                  FROM {capabilities}";

        return $DB->get_records_sql($sql.' '.$sort, $params);
    }
389193
def get_error(self, error):
        
        error_type = type(error)
        if error.error_type == ET_CLIENT:
            error_type_name = 'Client'
        else:
            error_type_name = 'Server'
        return {
            'type': error_type_name,
            'name': error_type.__name__,
            'prefix': getattr(error_type, '__module__', ''),
            'message': unicode(error),
            'params': error.args,
        }
119544
def get_interfaces_status():
    """"""
    status = {}
    for driverClass in CLASSES:
        try:
            instance = driverClass()
            status[instance.get_name()] = instance.get_status()
        except Exception:
            raise
    return status
641416
def get_capabilities_for_ext(self, ext, strict_type_matching: bool = False) -> Dict[Type, Dict[str, Parser]]:
        
        r = dict()
        # List all types that can be parsed from this extension.
        for typ in self.get_all_supported_types_for_ext(ext):
            # Use the query to fill
            matching = self.find_all_matching_parsers(strict_type_matching, desired_type=typ, required_ext=ext)[0]
            # matching_list = matching[0] + matching[1] + matching[2]
            # insert_element_to_dict_of_dicts_of_list(res, ext, typ, list(reversed(matching_list)))
            r[typ] = dict()
            exact = list(reversed(matching[2]))
            if len(exact) > 0:
                r[typ]['1_exact_match'] = exact

            approx = list(reversed(matching[1]))
            if len(approx) > 0:
                r[typ]['2_approx_match'] = approx

            generic = list(reversed(matching[0]))
            if len(generic) > 0:
                r[typ]['3_generic'] = generic

            # insert_element_to_dict_of_dicts(res, ext, typ, matching_dict)
        return r
1021451
def get_status_return_level(self, ids, **kwargs):
        
        convert = kwargs['convert'] if 'convert' in kwargs else self._convert
        srl = []
        for id in ids:
            try:
                srl.extend(self._get_status_return_level((id, ),
                                                         error_handler=None, convert=convert))
            except DxlTimeoutError as e:
                if self.ping(id):
                    srl.append('never' if convert else 0)
                else:
                    if self._error_handler:
                        self._error_handler.handle_timeout(e)
                        return ()
                    else:
                        raise e

        return tuple(srl)
1297245
def _get_ilo_details(self):
        
        manager_uri = '/rest/v1/Managers/1'
        status, headers, manager = self._rest_get(manager_uri)

        if status != 200:
            msg = self._get_extended_error(manager)
            raise exception.IloError(msg)

        # verify expected type
        mtype = self._get_type(manager)
        if (mtype not in ['Manager.0', 'Manager.1']):
            msg = "%s is not a valid Manager type " % mtype
            raise exception.IloError(msg)

        return manager, manager_uri
296177
def get_capabilities(location, custom_headers:nil)
      response = get_capabilities_async(location, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
530223
def get_configured_capabilities(self):
        """"""

        capabilities = OrderedDict()
        mbgp_caps = []
        if self.cap_mbgp_ipv4:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_UC.afi, RF_IPv4_UC.safi))

        if self.cap_mbgp_ipv6:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_UC.afi, RF_IPv6_UC.safi))

        if self.cap_mbgp_vpnv4:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_VPN.afi, RF_IPv4_VPN.safi))

        if self.cap_mbgp_vpnv6:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_VPN.afi, RF_IPv6_VPN.safi))

        if self.cap_rtc:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_RTC_UC.afi, RF_RTC_UC.safi))

        if self.cap_mbgp_evpn:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_L2_EVPN.afi, RF_L2_EVPN.safi))

        if self.cap_mbgp_ipv4fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_FLOWSPEC.afi, RF_IPv4_FLOWSPEC.safi))

        if self.cap_mbgp_ipv6fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_FLOWSPEC.afi, RF_IPv6_FLOWSPEC.safi))

        if self.cap_mbgp_vpnv4fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_VPNv4_FLOWSPEC.afi, RF_VPNv4_FLOWSPEC.safi))

        if self.cap_mbgp_vpnv6fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_VPNv6_FLOWSPEC.afi, RF_VPNv6_FLOWSPEC.safi))

        if self.cap_mbgp_l2vpnfs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_L2VPN_FLOWSPEC.afi, RF_L2VPN_FLOWSPEC.safi))

        if mbgp_caps:
            capabilities[BGP_CAP_MULTIPROTOCOL] = mbgp_caps

        if self.cap_refresh:
            capabilities[BGP_CAP_ROUTE_REFRESH] = [
                BGPOptParamCapabilityRouteRefresh()]

        if self.cap_enhanced_refresh:
            capabilities[BGP_CAP_ENHANCED_ROUTE_REFRESH] = [
                BGPOptParamCapabilityEnhancedRouteRefresh()]

        if self.cap_four_octet_as_number:
            capabilities[BGP_CAP_FOUR_OCTET_AS_NUMBER] = [
                BGPOptParamCapabilityFourOctetAsNumber(self.local_as)]

        return capabilities
752288
def errors():
    """"""
    from oauthlib.oauth2.rfc6749.errors import raise_from_error
    try:
        error = None
        raise_from_error(request.values.get('error'), params=dict())
    except OAuth2Error as raised:
        error = raised
    return render_template('invenio_oauth2server/errors.html', error=error)
1047409
def sanitise_capabilities(capabilities):
    
    for c in REQUIRED_CAPABILITIES:
        capabilities[c] = options[c]

    for c in PROTECTED_CAPABILITIES:
        if c in capabilities:
            del capabilities['client_secret']

    return capabilities