Get the director for a particular service and version.
484102
def get_director(self, service_id, version_number, name):
		""""""
		content = self._fetch("/service/%s/version/%d/director/%s" % (service_id, version_number, name))
		return FastlyDirector(self, content)
252478
def versions_request(self):
        """"""
        ret = self.handle_api_exceptions('GET', '', api_ver='')
        return [str_dict(x) for x in ret.json()]
584113
def get_version(*file_paths):
    """"""
    filename = os.path.join(os.path.dirname(__file__), *file_paths)
    print("Looking for version in: {}".format(filename))
    version_file = open(filename).read()
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')
1270511
private Path getHost( String id, long version ) {
        Path ret = root;
        for( String part : id.split( "-" ) ) {
            ret = ret.resolve( part );
        }

        return ret.resolve( "" + version );
    }
1298788
def get_role(resource_root, service_name, name, cluster_name="default"):
  
  return _get_role(resource_root, _get_role_path(cluster_name, service_name, name))
124630
def _get_provider_manager(self, osid, local=False):
        """"""
        return get_provider_manager(osid,
                                    runtime=self._runtime,
                                    proxy=getattr(self, '_proxy', None),
                                    local=local)
471518
def find_first_version(self):
        """"""
        for version in self.versions_to_try:
            remote_url = self.get_download_url(version=version)
            if http_url_exists(remote_url):
                return version, remote_url
        return None, None
792684
def get(self, dev_id):
        """"""
        path = '/'.join(['device', dev_id])
        return self.rachio.get(path)
539099
def get_generated_vcl(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/generated_vcl" % (service_id, version_number))
		return FastlyVCL(self, content)
877303
def get_service(self, name, search_filter):
        """"""
        if self.version == 1:
            service_filter = "service.{name}".format(name=name)
            return jmespath.search(service_filter, self.get(search_filter))
        else:
            service_filter = "services[?name=='{}']".format(name)
            return one(jmespath.search(service_filter, self.get(search_filter)))
133913
def _get_version(name, results):
    '''
    
    '''
    for line in salt.utils.itertools.split(results, '\n'):
        if not line:
            continue
        try:
            pkgname, pkgver = line.rsplit('-', 1)
        except ValueError:
            continue
        if pkgname == name:
            return pkgver
    return None
548054
def get_container_version():
    """"""
    root_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
    version_file = os.path.join(root_dir, 'VERSION')
    if os.path.exists(version_file):
        with open(version_file) as f:
            return f.read()
    return ''
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
1226257
def get_domain(self, service_id, version_number, name):
		""""""
		content = self._fetch("/service/%s/version/%d/domain/%s" % (service_id, version_number, name))
		return FastlyDomain(self, content)
778764
def get_url_for_service(service, region, endpoint_type):
    if 'type' not in service:
        return None

    identity_version = get_version_from_service(service)
    service_endpoints = service.get('endpoints', [])
    available_endpoints = [endpoint for endpoint in service_endpoints
                           if region == _get_endpoint_region(endpoint)]
    
    if service['type'] == 'identity' and not available_endpoints:
        available_endpoints = [endpoint for endpoint in service_endpoints]

    for endpoint in available_endpoints:
        try:
            if identity_version < 3:
                return endpoint.get(endpoint_type)
            else:
                interface = \
                    ENDPOINT_TYPE_TO_INTERFACE.get(endpoint_type, '')
                if endpoint.get('interface') == interface:
                    return endpoint.get('url')
        except (IndexError, KeyError):
            # it could be that the current endpoint just doesn't match the
            # type, continue trying the next one
            pass
    return None
691320
def query_versions(self, version=None):
        """"""
        if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS:
            return [version]

        url = urljoin(self.base_url, 'releases/')
        parser = self._create_directory_parser(url)
        if version:
            versions = parser.filter(RELEASE_AND_CANDIDATE_LATEST_VERSIONS[version])
            from distutils.version import LooseVersion
            versions.sort(key=LooseVersion)
            return [versions[-1]]
        else:
            return parser.entries
149346
def get(cls, resource_id=None, parent_id=None, grandparent_id=None):
        """""""
        return cls._get(resource_id, parent_id, grandparent_id)