Retrieve the information for a zone entity.
349
def get(self, zone_id):
        """"""
        path = '/'.join(['zone', zone_id])
        return self.rachio.get(path)
95907
def get_zone(self, zone_id, records=True):
        
        mask = None
        if records:
            mask = 'resourceRecords'
        return self.service.getObject(id=zone_id, mask=mask)
216951
def _get_query_zone_id(self):
        
        if 'VCAP_SERVICES' in os.environ:
            services = json.loads(os.getenv('VCAP_SERVICES'))
            predix_timeseries = services['predix-timeseries'][0]['credentials']
            return predix_timeseries['query']['zone-http-header-value']
        else:
            return predix.config.get_env_value(self, 'query_zone_id')
1294181
def get_records(self, zone_name):
        
        records = self._client.get('/domain/zone/{}/record'.format(zone_name))
        return [self.get_record(zone_name, record_id) for record_id in records]
320582
ZoneInfo zoneInfo(String ak, String bucket) {
        ZoneIndex index = new ZoneIndex(ak, bucket);
        return zones.get(index);
    }
1219304
def filter_zone(self, data):
        """"""
        if self.private_zone is not None:
            if data['Config']['PrivateZone'] != self.str2bool(self.private_zone):
                return False

        if data['Name'] != '{0}.'.format(self.domain):
            return False

        return True
546799
def get_zone_mode(self, zone_name):
        
        zone = self.get_zone(zone_name)

        if zone is None:
            raise RuntimeError("Unknown zone")

        return ZoneMode(zone['mode'])
651473
def get(self, request, pzone_pk):
        """"""

        # attempt to get given pzone
        try:
            pzone = PZone.objects.get(pk=pzone_pk)
        except PZone.DoesNotExist:
            raise Http404("Cannot find given pzone.")

        # bulid filters
        filters = {"pzone": pzone}

        if "from" in request.GET:
            parsed = dateparse.parse_datetime(request.GET["from"])
            if parsed is not None:
                filters["when__gte"] = parsed

        if "to" in request.GET:
            parsed = dateparse.parse_datetime(request.GET["to"])
            if parsed is not None:
                filters["when__lt"] = parsed

        # get operations and serialize them
        operations = PZoneOperation.objects.filter(**filters)

        # return a json response with serialized operations
        return Response(self.serialize_operations(operations), content_type="application/json")
899506
def get_modes(self, zone):
        """"""
        self._populate_full_data()
        device = self._get_device(zone)
        return device['thermostat']['allowedModes']
1039641
def keys_info(cls, fqdn, key):
        """"""
        return cls.json_get('%s/domains/%s/keys/%s' %
                            (cls.api_url, fqdn, key))
163663
private static ZoneRulesProvider getProvider(String zoneId) {
        ZoneRulesProvider provider = ZONES.get(zoneId);
        if (provider == null) {
            if (ZONES.isEmpty()) {
                throw new ZoneRulesException("No time-zone data files registered");
            }
            throw new ZoneRulesException("Unknown time-zone ID: " + zoneId);
        }
        return provider;
    }
1056003
def _retrieve_cached_zone_variable(self, zone_id, name):
        
        try:
            s = self._zone_state[zone_id][name.lower()]
            logger.debug("Zone Cache retrieve %s.%s = %s",
                         zone_id.device_str(), name, s)
            return s
        except KeyError:
            raise UncachedVariable
999522
def get_recordInfo(self, headers, zoneID, zone, records):
        """"""
        if 'None' in records: #If ['None'] in record argument, query all.
            recordQueryEnpoint = '/' + zoneID + '/dns_records&per_page=100'
            recordUrl = self.BASE_URL + recordQueryEnpoint
            recordRequest = requests.get(recordUrl, headers=headers)
            recordResponse = recordRequest.json()['result']
            dev = []
            num = 0
            for value in recordResponse:
                recordName = recordResponse[num]['name']
                dev.append(recordName)
                num = num + 1
            records = dev
        updateRecords = []
        for record in records:
            if zone in record:
                recordFullname = record
            else:
                recordFullname = record + '.' + zone
            recordQuery = '/' + zoneID + '/dns_records?name=' + recordFullname
            recordUrl = self.BASE_URL + recordQuery
            recordInfoRequest = requests.get(recordUrl, headers=headers)
            recordInfoResponse = recordInfoRequest.json()['result'][0]
            recordID = recordInfoResponse['id']
            recordType = recordInfoResponse['type']
            recordProxy = str(recordInfoResponse['proxied'])
            recordContent = recordInfoResponse['content']
            if recordProxy == 'True':
                recordProxied = True
            else:
                recordProxied = False
            updateRecords.append([recordID, recordFullname, recordType,
                recordContent, recordProxied])
        return updateRecords
1245951
protected function fetchZones()
    {
        $results = $this->pagedSoapCall('getZoneList', [], 'zoneInfo');
        foreach ($results as $zone) {
            $this->zones[$zone['domainName']] = $zone;
        }
    }
877523
def zones(self):
        
        if self._zones is None:
            self.assert_bind_client()
            self._zones = self.bind_client.get_activity_zones(self.id)
        return self._zones
614669
def get_zone(server, token, domain, keyword='', raw_flag=False):
    
    method = 'GET'
    uri = 'https://' + server + '/zone/' + domain
    data = connect.tonicdns_client(uri, method, token, data=False,
                                   keyword=keyword, raw_flag=raw_flag)
    return data
1225666
def parse_hosted_zones(self, hosted_zone, params):
        
        # When resuming upon throttling error, skip if already fetched
        hosted_zone_id = hosted_zone.pop('Id')
        hosted_zone['name'] = hosted_zone.pop('Name')
        api_client = params['api_client']
        record_sets = handle_truncated_response(api_client.list_resource_record_sets, {'HostedZoneId': hosted_zone_id}, ['ResourceRecordSets'])
        hosted_zone.update(record_sets)
        #print(str(record_sets))
        #record_sets = api_client.list_resource_record_sets()
        #hosted_zone['RecordSets'] = record_sets['Resourc']
        self.hosted_zones[hosted_zone_id] = hosted_zone