Returns the endpoint configuration for a given service.
974378
private Endpoint getEndpoint(String serviceName) {
        Endpoint cachedEndpoint = endpointCache.get(serviceName);

        if (cachedEndpoint == null) {
            cachedEndpoint = computeEndpoint(serviceName);
            if (cachedEndpoint == null) {
                return null;
            }
        }

        endpointCache.put(serviceName, cachedEndpoint);
        return cachedEndpoint;
    }
1314454
public static function service(string $service)
    {
        if (!array_key_exists($service, self::$available_services)) {
            throw (new ServiceNotFoundException(sprintf(
                '"%s" is not registered as a service.',
                $service
            )))->setServiceName($service);
        }

        $service_class = static::$available_services[$service];

        $config = static::$config['services'][$service] ?? null;

        if (is_null($config)) {
            throw (new ServiceConfigurationNotFoundException(sprintf(
                '"%s" configuration not found.',
                $service
            )))->setServiceName($service);
        }

        return $service_class::configure($config);
    }
350461
function hasCustomEndpoint(client) {
  //if set endpoint is set for specific client, enable endpoint discovery will raise an error.
  if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {
    throw util.error(new Error(), {
      code: 'ConfigurationException',
      message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.'
    });
  };
  var svcConfig = AWS.config[client.serviceIdentifier] || {};
  return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint));
}
111203
public function getCheckoutEndpoint($service)
	{
		// check if endpoint is set
		if ($service->getClient()->getConfig()->get('endpointCheckout') == null) {
			$logger = $service->getClient()->getLogger();
			$msg = "Please provide your unique live url prefix on the setEnvironment() call on the Client or provide endpointCheckout in your config object.";
			$logger->error($msg);
			throw new \Adyen\AdyenException($msg);
		}

		return $service->getClient()->getConfig()->get('endpointCheckout');
	}
132208
function defaultService (config) {
  const serviceConfig = _.merge({}, baseServiceConfig);

  // Apply MetaData
  serviceConfig.metadata = objectMetadata({
    name: config.projectName,
    namespace: config.namespace.name
  });

  serviceConfig.spec.selector = {
    project: config.projectName,
    provider: 'nodeshift'
  };

  serviceConfig.spec.ports = [
    {
      protocol: 'TCP',
      port: config.port,
      targetPort: config.port,
      name: 'http'
    }
  ];

  serviceConfig.spec.type = 'ClusterIP';

  return serviceConfig;
}
466246
def get_api_endpoints(self, apiname):
        """"""
        try:
            return self.services_by_name\
                    .get(apiname)\
                    .get("endpoints")\
                    .copy()
        except AttributeError:
            raise Exception(f"Couldn't find the API endpoints")
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
737784
public function getServiceEndpoint( $service ) {
        switch ( $service ) {
            case 'organization':
                return $this->organizationUrl;
            case 'discovery':
                return $this->discoveryUrl;
            case 'sts':
            case 'login':
                return $this->loginUrl;
            default:
                return $service;
        }
    }
175985
def get_client(self, region):
        
        ep = self._ep_for_region(region)
        if not ep:
            raise exc.NoEndpointForRegion("There is no endpoint defined for the "
                    "region '%s' for the '%s' service." % (region,
                    self.service_type))
        return ep.client
670740
def config(services, raw=false)
      unless [String, Array].include?(services.class)
        raise ArgumentError, "Service(s) argument required"
      end
      
      results       = {}
      names         = [services].flatten.uniq
      
      if names.empty?
        raise ArgumentError, "Service(s) argument required"
      end
      
      key = 'config_' + Digest::MD5.hexdigest(names.to_s) + "_#{raw}"
      
      cache(key) do
        names.each do |service|
          begin
            connection.send_data("config #{service}")
            lines = connection.read_packet 
            results[service] = raw ? lines.join("\n") : parse_config(lines)
          rescue UnknownService, BadExit
            # TODO
          end
        end
        results
      end
    end
1361796
private ModelNode readEndpointConfiguration() {
        ModelNode op = new ModelNode();
        op.get(ADDRESS).set(ENDPOINT_CONFIGURATION_ADDRESS.resolve(statementContext));
        op.get(OP).set(READ_RESOURCE_OPERATION);
        op.get(INCLUDE_RUNTIME).set(true);
        op.get(RECURSIVE).set(true);
        return op;
    }
448071
protected T service(PathMapping pathMapping, Service<I, O> service) {
        return service(CompositeServiceEntry.of(pathMapping, service));
    }
1220582
public EndpointConfig resolveEndpointConfig() {
      final String endpointClassName = getEndpointClassName();
      // 1) default values
      //String configName = org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG;
      String configName = endpointClassName;
      String configFile = EndpointConfig.DEFAULT_ENDPOINT_CONFIG_FILE;
      boolean specifiedConfig = false;
      // 2) annotation contribution
      if (isEndpointClassAnnotated(org.jboss.ws.api.annotation.EndpointConfig.class))
      {
         final String cfgName = getEndpointConfigNameFromAnnotation();
         if (cfgName != null && !cfgName.isEmpty())
         {
            configName = cfgName;
         }
         final String cfgFile = getEndpointConfigFileFromAnnotation();
         if (cfgFile != null && !cfgFile.isEmpty())
         {
            configFile = cfgFile;
         }
         specifiedConfig = true;
      }
      // 3) descriptor overrides (jboss-webservices.xml or web.xml)
      final String epCfgNameOverride = getEndpointConfigNameOverride();
      if (epCfgNameOverride != null && !epCfgNameOverride.isEmpty())
      {
         configName = epCfgNameOverride;
         specifiedConfig = true;
      }
      final String epCfgFileOverride = getEndpointConfigFileOverride();
      if (epCfgFileOverride != null && !epCfgFileOverride.isEmpty())
      {
         configFile = epCfgFileOverride;
      }
      // 4) setup of configuration
      if (configFile != EndpointConfig.DEFAULT_ENDPOINT_CONFIG_FILE) {
         //look for provided endpoint config file
         try
         {
            ConfigRoot configRoot = ConfigMetaDataParser.parse(getConfigFile(configFile));
            EndpointConfig config = configRoot.getEndpointConfigByName(configName);
            if (config == null && !specifiedConfig) {
               config = configRoot.getEndpointConfigByName(EndpointConfig.STANDARD_ENDPOINT_CONFIG);
            }
            if (config != null) {
               return config;
            }
         }
         catch (IOException e)
         {
            throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
         }
      }
      else
      {
         EndpointConfig config = null;
         URL url = getDefaultConfigFile(configFile);
         if (url != null) {
            //the default file exists
            try
            {
               ConfigRoot configRoot = ConfigMetaDataParser.parse(url);
               config = configRoot.getEndpointConfigByName(configName);
               if (config == null && !specifiedConfig) {
                  config = configRoot.getEndpointConfigByName(EndpointConfig.STANDARD_ENDPOINT_CONFIG);
               }
            }
            catch (IOException e)
            {
               throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
            }
         }
         if (config == null) {
            //use endpoint configs from AS domain
            ServerConfig sc = getServerConfig();
            config = sc.getEndpointConfig(configName);
            if (config == null && !specifiedConfig) {
               config = sc.getEndpointConfig(EndpointConfig.STANDARD_ENDPOINT_CONFIG);
            }
            if (config == null && specifiedConfig) {
                throw Messages.MESSAGES.couldNotFindEndpointConfigName(configName);
            }
         }
         if (config != null) {
            return config;
         } 
      }
      return null;
   }
1322346
def _get_service_config(self):
        
        # Should work for windows, osx, and linux environments
        if not os.path.exists(self.config_path):
            try:
                os.makedirs(os.path.dirname(self.config_path))
            except OSError as exc:
                if exc.errno != errno.EEXIST:
                    raise

            return {}

        with open(self.config_path, 'r') as data:
            return json.load(data)
507231
def get_config(self, service, setting):
        
        try:
            return self.get_service(service)[setting]
        except KeyError:
            return getattr(self, setting + '_DEFAULT')
1253429
@RequestMapping(value = "/endpointdoc", method = RequestMethod.GET)
    public @ResponseBody
    Set<RequestMappingInfo> getEndpoints() {

        return this.service.getEndpoints(requestMappingHandlerMapping);
    }
97048
public ConfigurationResult getConfiguration ()
        throws ServiceException
    {
        requireAdminUser();

        final ServletWaiter<ConfigurationResult> waiter =
            new ServletWaiter<ConfigurationResult>("getConfiguration");

        _omgr.postRunnable(new Runnable() {
            public void run () {
                Map<String, ConfigurationRecord> tabs = Maps.newHashMap();
                for (String key : _confReg.getKeys()) {
                    ConfigurationRecord record = buildRecord(key);
                    if (record == null) {
                        waiter.requestFailed(
                            new ServiceException(InvocationCodes.E_INTERNAL_ERROR));
                        return;
                    }
                    tabs.put(key, record);
                }

                ConfigurationResult result = new ConfigurationResult();
                result.records = tabs;
                waiter.requestCompleted(result);
            }
        });

        return waiter.waitForResult();
    }