List the availability of dedicated server

REST: GET /dedicated/server/availabilities
@param country [required] The subsidiary company where the availability is requested
@param hardware [required] The kind of hardware which is requested

API beta
496731
public ArrayList<OvhAvailabilities> availabilities_GET(OvhOvhSubsidiaryEnum country, String hardware) throws IOException {
		String qPath = "/dedicated/server/availabilities";
		StringBuilder sb = path(qPath);
		query(sb, "country", country);
		query(sb, "hardware", hardware);
		String resp = execN(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t17);
	}
164199
def cli(env, identifier, wait):
    """"""

    compute = SoftLayer.HardwareManager(env.client)
    compute_id = helpers.resolve_id(compute.resolve_ids, identifier,
                                    'hardware')
    ready = compute.wait_for_ready(compute_id, wait)
    if ready:
        env.fout("READY")
    else:
        raise exceptions.CLIAbort("Server %s not ready" % compute_id)
1217016
def resources_availability(self):
        """"""
        # Flatten the list.
        availabilities = list(
            chain(
                *[org.check_availability() for org in self.organizations]
            )
        )
        # Filter out the unknown
        availabilities = [a for a in availabilities if type(a) is bool]
        if availabilities:
            # Trick will work because it's a sum() of booleans.
            return round(100. * sum(availabilities) / len(availabilities), 2)
        # if nothing is unavailable, everything is considered OK
        return 100
1345936
public OvhDirectoriesList localSeo_directoriesList_GET(OvhCountryEnum country, net.minidev.ovh.api.hosting.web.localseo.location.OvhOfferEnum offer) throws IOException {
		String qPath = "/hosting/web/localSeo/directoriesList";
		StringBuilder sb = path(qPath);
		query(sb, "country", country);
		query(sb, "offer", offer);
		String resp = execN(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDirectoriesList.class);
	}
189655
def find_servers(self, *args, **kwargs):
        
        servers = super(HPNova, self).find_servers(*args, **kwargs)
        return map(fix_hp_addrs, servers)
579556
def avail_locations(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    ret = {}
    conn = get_conn()

    for item in conn.list_locations()['items']:
        reg, loc = item['id'].split('/')
        location = {'id': item['id']}

        if reg not in ret:
            ret[reg] = {}

        ret[reg][loc] = location
    return ret
1037170
def is_available(self):
        
        # if the availability flag is raised, return True immediately.
        # NOTE: subsequent API failures will lower this flag. we do this here
        # to ensure we don't keep hitting Joe with requests while availability
        # is there.
        if self.server_available:
            return True

        # otherwise, we have to check with the cloud.
        else:

            try:
                self.server_available = self.jbx.server_online()
                return self.server_available
            except jbxapi.JoeException:
                pass

        self.server_available = False
        return False
733784
def get_server_capabilities(self):
        
        capabilities = {}
        system = self._get_host_details()
        capabilities['server_model'] = system['Model']
        rom_firmware_version = (
            system['Oem']['Hp']['Bios']['Current']['VersionString'])
        capabilities['rom_firmware_version'] = rom_firmware_version
        capabilities.update(self._get_ilo_firmware_version())
        capabilities.update(self._get_number_of_gpu_devices_connected())
        drive_details = self._get_drive_type_and_speed()
        if drive_details is not None:
            capabilities.update(drive_details)
        raid_details = self._get_logical_raid_levels()
        if raid_details is not None:
            capabilities.update(raid_details)
        if self._is_raid_supported():
            capabilities['hardware_supports_raid'] = 'true'
        boot_modes = common.get_supported_boot_modes(
            self.get_supported_boot_mode())
        capabilities.update({
            'boot_mode_bios': boot_modes.boot_mode_bios,
            'boot_mode_uefi': boot_modes.boot_mode_uefi})
        if self._get_tpm_capability():
            capabilities['trusted_boot'] = 'true'
        if self._get_cpu_virtualization():
            capabilities['cpu_vt'] = 'true'
        if self._get_nvdimm_n_status():
            capabilities['nvdimm_n'] = 'true'
        try:
            self._check_iscsi_rest_patch_allowed()
            capabilities['iscsi_boot'] = 'true'
        except exception.IloError:
            # If an error is raised dont populate the capability
            # iscsi_boot
            pass
        try:
            self.get_secure_boot_mode()
            capabilities['secure_boot'] = 'true'
        except exception.IloCommandNotSupportedError:
            # If an error is raised dont populate the capability
            # secure_boot
            pass
        if self._is_sriov_enabled():
            capabilities['sriov_enabled'] = 'true'
        return capabilities
608918
protected function setCountry($country_code)
    {
        $this->data_country = array();

        if (!empty($country_code)) {
            $this->data_country = $this->country->get($country_code);
            if (empty($this->data_country)) {
                $this->outputHttpStatus(404);
            }
        }
    }
303563
public ArrayList<String> dedicated_server_serviceName_feature_GET(String serviceName, OvhOrderableSysFeatureEnum feature) throws IOException {
		String qPath = "/order/dedicated/server/{serviceName}/feature";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "feature", feature);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t1);
	}
372694
def lookUpReportsByCountry(self, countryName):
        

        code = self.findCountryTwoDigitCode(countryName)

        if code is None:
            raise Exception("Invalid country name.")
        url = self._base_url + self._url_list_reports + "/%s" % code
        params = {
            "f" : "json",
        }
        return self._post(url=url,
                             param_dict=params,
                             securityHandler=self._securityHandler,
                             proxy_url=self._proxy_url,
                             proxy_port=self._proxy_port)
354754
def get_availability_zone():
    
    log = logging.getLogger(mod_logger + '.get_availability_zone')

    # Exit if not running on AWS
    if not is_aws():
        log.info('This machine is not running in AWS, exiting...')
        return

    availability_zone_url = metadata_url + 'placement/availability-zone'
    try:
        response = urllib.urlopen(availability_zone_url)
    except(IOError, OSError) as ex:
        msg = 'Unable to query URL to get Availability Zone: {u}\n{e}'.format(u=availability_zone_url, e=ex)
        log.error(msg)
        return

    # Check the code
    if response.getcode() != 200:
        msg = 'There was a problem querying url: {u}, returned code: {c}, unable to get the Availability Zone'.format(
            u=availability_zone_url, c=response.getcode())
        log.error(msg)
        return
    availability_zone = response.read()
    return availability_zone
1116421
def available(self):
        """"""
        if not self.adb_server_ip:
            # python-adb
            return bool(self._adb)

        # pure-python-adb
        try:
            # make sure the server is available
            adb_devices = self._adb_client.devices()

            # make sure the device is available
            try:
                # case 1: the device is currently available
                if any([self.host in dev.get_serial_no() for dev in adb_devices]):
                    if not self._available:
                        self._available = True
                    return True

                # case 2: the device is not currently available
                if self._available:
                    logging.error('ADB server is not connected to the device.')
                    self._available = False
                return False

            except RuntimeError:
                if self._available:
                    logging.error('ADB device is unavailable; encountered an error when searching for device.')
                    self._available = False
                return False

        except RuntimeError:
            if self._available:
                logging.error('ADB server is unavailable.')
                self._available = False
            return False
213648
public ArrayList<OvhAccessoryOffer> accessories_GET(OvhNumberCountryEnum country) throws IOException {
		String qPath = "/telephony/accessories";
		StringBuilder sb = path(qPath);
		query(sb, "country", country);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t19);
	}
708812
def avail_locations(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    ret = {}

    params = {'Action': 'DescribeRegions'}
    result = aws.query(params,
                       location=get_location(),
                       provider=get_provider(),
                       opts=__opts__,
                       sigver='4')

    for region in result:
        ret[region['regionName']] = {
            'name': region['regionName'],
            'endpoint': region['regionEndpoint'],
        }

    return ret
719787
def server(self):
        
        server = [s for s in self._server.resources() if s.clientIdentifier == self.machineIdentifier]
        if len(server) == 0:
            raise NotFound('Unable to find server with uuid %s' % self.machineIdentifier)
        return server[0]
1352462
def include_server?(server)
      return false if (opts[:state] && server.state.name != opts[:state]) ||
                      (opts[:type] && server.instance_type != opts[:type]) ||
                      (opts[:zone] && server.placement.availability_zone != opts[:zone]) ||
                      (server.state.name == 'terminated' && !include_terminated?)

      true
    end