Return server object used to interact with Jenkins.

    :return: server object used to interact with Jenkins
970560
def _connect():
    '''
    
    '''
    jenkins_url = __salt__['config.get']('jenkins.url') or \
        __salt__['config.get']('jenkins:url') or \
        __salt__['pillar.get']('jenkins.url')

    jenkins_user = __salt__['config.get']('jenkins.user') or \
        __salt__['config.get']('jenkins:user') or \
        __salt__['pillar.get']('jenkins.user')

    jenkins_password = __salt__['config.get']('jenkins.password') or \
        __salt__['config.get']('jenkins:password') or \
        __salt__['pillar.get']('jenkins.password')

    if not jenkins_url:
        raise SaltInvocationError('No Jenkins URL found.')

    return jenkins.Jenkins(jenkins_url,
                           username=jenkins_user,
                           password=jenkins_password)
555619
def server(name='proxy-server', headers_middleware=None,
           server_software=None, **kwargs):
    ''''''
    if headers_middleware is None:
        headers_middleware = [x_forwarded_for]
    wsgi_proxy = ProxyServerWsgiHandler(headers_middleware)
    kwargs['server_software'] = server_software or SERVER_SOFTWARE
    return wsgi.WSGIServer(wsgi_proxy, name=name, **kwargs)
224632
def client(self):
        
        if not hasattr(self, "_client"):
            self._client = connections.get_connection("default")
        return self._client
728294
def client(self):
        
        if self._client is not None:
            return self._client

        self._client = self.get_client()
        return self._client
527588
def getclient():
        '''
        
        '''
        if not Configuration.client_initialized:
            Configuration._initconf()
            Configuration.client_settings = Configuration.settings['client']
            Configuration.client_initialized = True
        return Configuration.client_settings
30343
def server_online(self):
        
        response = self._post(self.apiurl + '/v2/server/online', data={'apikey': self.apikey})

        return self._raise_or_extract(response)
548151
def get_server(key, server=MAIN_SERVER, servers=LOAD_SERVERS):

    

    namecoind = NamecoindClient(NAMECOIND_SERVER, NAMECOIND_PORT,
                                NAMECOIND_USER, NAMECOIND_PASSWD)

    info = namecoind.name_show(key)

    if 'address' in info:
        return check_address(info['address'], server, servers)

    response = {}
    response["registered"] = False
    response["server"] = None
    response["ismine"] = False
    return response
4713
function discover(cb) {
  return function (host, args) {
    if (!args) {
      args = host || {};
      host = 'localhost';
    }
    function resultCb(result) {
      console.log(text.__('Jenkins ver. %s is running on %s'),
          result.hudson.version[0],
          (result.hudson.url && result.hudson.url[0]) ? result.hudson.url[0] : host);
    }
    function jenkinsCb(jenkins) {
      jenkins.discover(host, cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
936231
def api_server(connection, server_class):
    

    # run api server on connection
    return server_class(
        link=xbahn.connection.link.Link(
            # use the connection to receive messages
            receive=connection,
            # use the connection to respond to received messages
            respond=connection
        )
    )
926883
def get_server(self, UUID):
        
        server, IPAddresses, storages = self.get_server_data(UUID)

        return Server(
            server,
            ip_addresses=IPAddresses,
            storage_devices=storages,
            populated=True,
            cloud_manager=self
        )
605062
def get_client(self):
        
        context = self.context
        parent = api.get_parent(context)
        if context.portal_type == "Client":
            return context
        elif parent.portal_type == "Client":
            return parent
        elif context.portal_type == "Batch":
            return context.getClient()
        elif parent.portal_type == "Batch":
            return context.getClient()
        return None
58968
def get_client(client=None):
    
    global _client

    tmp_client = client is not None
    if not tmp_client:
        config = getattr(django_settings, "ELASTIC_APM", {})
        client = config.get("CLIENT", default_client_class)

    if _client[0] != client:
        client_class = import_string(client)
        instance = client_class()
        if not tmp_client:
            _client = (client, instance)
        return instance
    return _client[1]
1114912
def client(self):
        
        ctx = stack.top
        attr_name = self._config_key("client")
        if ctx is not None:
            if not hasattr(ctx, attr_name):
                setattr(
                    ctx,
                    attr_name,
                    BankIDClient(
                        (
                            current_app.config.get(self._config_key("CERT_PATH")),
                            current_app.config.get(self._config_key("KEY_PATH")),
                        ),
                        current_app.config.get(self._config_key("TEST_SERVER")),
                    ),
                )
            return getattr(ctx, attr_name)
1164371
def server
      @server_mu.synchronize do
        @server ||= begin
          # For backward compatibility, we allow these options to be passed directly
          # in the Gruf::Server options, or via Gruf.rpc_server_options.
          server_options = {
            pool_size: options.fetch(:pool_size, Gruf.rpc_server_options[:pool_size]),
            max_waiting_requests: options.fetch(:max_waiting_requests, Gruf.rpc_server_options[:max_waiting_requests]),
            poll_period: options.fetch(:poll_period, Gruf.rpc_server_options[:poll_period]),
            pool_keep_alive: options.fetch(:pool_keep_alive, Gruf.rpc_server_options[:pool_keep_alive]),
            connect_md_proc: options.fetch(:connect_md_proc, Gruf.rpc_server_options[:connect_md_proc]),
            server_args: options.fetch(:server_args, Gruf.rpc_server_options[:server_args])
          }

          server = if @event_listener_proc
                     server_options[:event_listener_proc] = @event_listener_proc
                     Gruf::InstrumentableGrpcServer.new(server_options)
                   else
                     GRPC::RpcServer.new(server_options)
                   end

          @port = server.add_http2_port(@hostname, ssl_credentials)
          @services.each { |s| server.handle(s) }
          server
        end
      end
    end
863488
def server(request):
    
    return render_to_response(
        'server/index.html', {
            'user_url': getViewURL(request, idPage),
            'server_xrds_url': getViewURL(request, idpXrds),
        },
        context_instance=RequestContext(request))
1323794
def __display_server(self, server):
        
        # Display the Glances client for the selected server
        logger.debug("Selected server {}".format(server))

        # Connection can take time
        # Display a popup
        self.screen.display_popup(
            'Connect to {}:{}'.format(server['name'], server['port']), duration=1)

        # A password is needed to access to the server's stats
        if server['password'] is None:
            # First of all, check if a password is available in the [passwords] section
            clear_password = self.password.get_password(server['name'])
            if (clear_password is None or self.get_servers_list()
                    [self.screen.active_server]['status'] == 'PROTECTED'):
                # Else, the password should be enter by the user
                # Display a popup to enter password
                clear_password = self.screen.display_popup(
                    'Password needed for {}: '.format(server['name']), is_input=True)
            # Store the password for the selected server
            if clear_password is not None:
                self.set_in_selected('password', self.password.sha256_hash(clear_password))

        # Display the Glance client on the selected server
        logger.info("Connect Glances client to the {} server".format(server['key']))

        # Init the client
        args_server = self.args

        # Overwrite connection setting
        args_server.client = server['ip']
        args_server.port = server['port']
        args_server.username = server['username']
        args_server.password = server['password']
        client = GlancesClient(config=self.config, args=args_server, return_to_browser=True)

        # Test if client and server are in the same major version
        if not client.login():
            self.screen.display_popup(
                "Sorry, cannot connect to '{}'\n"
                "See '{}' for more details".format(server['name'], LOG_FILENAME))

            # Set the ONLINE status for the selected server
            self.set_in_selected('status', 'OFFLINE')
        else:
            # Start the client loop
            # Return connection type: 'glances' or 'snmp'
            connection_type = client.serve_forever()

            try:
                logger.debug("Disconnect Glances client from the {} server".format(server['key']))
            except IndexError:
                # Server did not exist anymore
                pass
            else:
                # Set the ONLINE status for the selected server
                if connection_type == 'snmp':
                    self.set_in_selected('status', 'SNMP')
                else:
                    self.set_in_selected('status', 'ONLINE')

        # Return to the browser (no server selected)
        self.screen.active_server = None
1175771
def server_info(self):
        
        response = self._post(self.apiurl + "/v2/server/info", data={'apikey': self.apikey})

        return self._raise_or_extract(response)