Enable availability zones to this Access Point.
        All zones must be in the same region as the Access Point.

        :type zones: string or List of strings
        :param zones: The name of the zone(s) to add.
540309
def enable_zones(self, zones):
        
        if isinstance(zones, str) or isinstance(zones, unicode):
            zones = [zones]
        new_zones = self.connection.enable_availability_zones(self.name, zones)
        self.availability_zones = new_zones
1359383
def get_default_zone
      params = {
          'command' => 'listZones',
          'available' => 'true'
      }
      json = send_request(params)

      zones = json['zone']
      return nil unless zones
      # zones.sort! # sort zones so we always return the same zone
      # !this gives error in our production environment so need to retest this
      zones.first
    end
28784
def loadZone(self, zone, callback=None, errback=None):
        
        import ns1.zones
        zone = ns1.zones.Zone(self.config, zone)
        return zone.load(callback=callback, errback=errback)
469674
private void setRegionOrEndPoint() {
        String regionName = getParamString("ddb_region");
        if (regionName != null) {
            Regions regionEnum = Regions.fromName(regionName);
            Utils.require(regionEnum != null, "Unknown 'ddb_region': " + regionName);
            m_logger.info("Using region: {}", regionName);
            m_ddbClient.setRegion(Region.getRegion(regionEnum));
        } else {
            String ddbEndpoint = getParamString("ddb_endpoint");
            Utils.require(ddbEndpoint != null,
                          "Either 'ddb_region' or 'ddb_endpoint' must be defined for tenant: " + m_tenant.getName());
            m_logger.info("Using endpoint: {}", ddbEndpoint);
            m_ddbClient.setEndpoint(ddbEndpoint);
        }
    }
1164091
def zone(self) -> Optional[str]:
        """"""
        if self._device_category == DC_BASEUNIT:
            return None
        return '{:02x}-{:02x}'.format(self._group_number, self._unit_number)
682960
def set_mode_by_name(self, zone_name, mode):
        
        zone = self.get_zone(zone_name)
        if zone is None:
            raise RuntimeError("Unknown zone")

        return self.set_mode_by_id(zone["zoneId"], mode)
1105591
def get_zones(region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    return [z.name for z in conn.get_all_zones()]
81316
def setlocation(self, url, names=None):
        
        for p in self.ports:
            for m in p.methods.values():
                if names is None or m.name in names:
                    m.location = url
157087
def add_zone(self, spatial_unit, container_id, name='', description='', visible=True, reuse=0, drop_behavior_type=None):
        
        if not isinstance(spatial_unit, abc_mapping_primitives.SpatialUnit):
            raise InvalidArgument('zone is not a SpatialUnit')
        # if not isinstance(name, DisplayText):
        #     raise InvalidArgument('name is not a DisplayText object')
        if not isinstance(reuse, int):
            raise InvalidArgument('reuse must be an integer')
        if reuse < 0:
            raise InvalidArgument('reuse must be >= 0')
        if not isinstance(name, DisplayText):
            # if default ''
            name = self._str_display_text(name)
        if not isinstance(description, DisplayText):
            # if default ''
            description = self._str_display_text(description)
        zone = {
            'id': str(ObjectId()),
            'spatialUnit': spatial_unit.get_spatial_unit_map(),
            'containerId': container_id,
            'names': [self._dict_display_text(name)],
            'descriptions': [self._dict_display_text(description)],
            'visible': visible,
            'reuse': reuse,
            'dropBehaviorType': str(drop_behavior_type)
        }
        self.my_osid_object_form._my_map['zones'].append(zone)
        return zone
624956
def multizone_member_added(self, member_uuid):
        """"""
        casts = self._casts
        if member_uuid not in casts:
            casts[member_uuid] = {'listeners': [],
                                  'groups': set()}
        casts[member_uuid]['groups'].add(self._group_uuid)
        for listener in list(casts[member_uuid]['listeners']):
            listener.added_to_multizone(self._group_uuid)
278561
def zone_absent(domain, profile):
    '''
    
    '''
    zones = __salt__['libcloud_dns.list_zones'](profile)
    matching_zone = [z for z in zones if z['domain'] == domain]
    if not matching_zone:
        return state_result(True, 'Zone already absent', domain)
    else:
        result = __salt__['libcloud_dns.delete_zone'](matching_zone[0]['id'], profile)
        return state_result(result, 'Deleted zone', domain)
783447
def get_all_zones(self):
        """"""
        zones = {'HostedZones': []}

        new_zones = self.route53.list_hosted_zones(MaxItems='100')
        while new_zones['IsTruncated']:
            zones['HostedZones'] += new_zones['HostedZones']
            new_zones = self.route53.list_hosted_zones(Marker=new_zones['NextMarker'], MaxItems='100')

        zones['HostedZones'] += new_zones['HostedZones']
        return zones
146590
def add_multizone(self, group_cast):
        
        self._groups[str(group_cast.uuid)] = {
            'chromecast': group_cast,
            'listener': Listener(group_cast, self._casts),
            'members': set()}
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
580080
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'
        )

    params = {
        'action': 'DescribeZones',
    }
    items = query(params=params)

    result = {}
    for region in items['zone_set']:
        result[region['zone_id']] = {}
        for key in region:
            result[region['zone_id']][key] = six.text_type(region[key])

    return result
822400
def availability_zone_list(request):
    """"""
    try:
        if api.cinder.extension_supported(request, 'AvailabilityZones'):
            return api.cinder.availability_zone_list(request)
        return []
    except Exception:
        exceptions.handle(request,
                          _('Unable to retrieve volumes availability zones.'))
        return []
1270313
def add_host(zone, name, ttl, ip, nameserver='127.0.0.1', replace=True,
             timeout=5, port=53, **kwargs):
    '''
    
    '''
    res = update(zone, name, ttl, 'A', ip, nameserver, timeout, replace, port,
                 **kwargs)
    if res is False:
        return False

    fqdn = '{0}.{1}.'.format(name, zone)
    parts = ip.split('.')[::-1]
    popped = []

    # Iterate over possible reverse zones
    while len(parts) > 1:
        p = parts.pop(0)
        popped.append(p)
        zone = '{0}.{1}'.format('.'.join(parts), 'in-addr.arpa.')
        name = '.'.join(popped)
        ptr = update(zone, name, ttl, 'PTR', fqdn, nameserver, timeout,
                     replace, port, **kwargs)
        if ptr:
            return True
    return res