Updates an existing silo profile on a Nexpose console.

 @param [Connection] connection Connection to console where this silo profile will be saved.
 @return [String] Silo Profile ID assigned to this configuration, if successful.
173035
def update(connection)
      xml = connection.make_xml('SiloProfileUpdateRequest')
      xml.add_element(as_xml)
      r = connection.execute(xml, '1.2')
      @id = r.attributes['silo-profile-id'] if r.success
    end
384582
public function syncConnectionCredentials(ConnectionKey $connection = null, array $credentials = [])
    {
        // Store credentials if any
        if (!$credentials) {
            return;
        }

        $key = 'connections.'.$connection->name.'.servers.'.$connection->server;

        $filtered = $this->filterUnsavableCredentials($connection, $credentials);
        $this->localStorage->set($key, $filtered);

        // Merge and save
        $current = (array) $this->config->get($key);
        $credentials = array_replace_recursive($current, $credentials);
        $this->config->set($key, $credentials);

        // Reset connections
        $this->connections->disconnect();

        return $credentials;
    }
498411
def update
      success = true
      tries ||= 3
      request = Net::HTTP::Put.new("/api/projects/#{Connection.api_key}/strings/#{self.id}.yaml")
      WebTranslateIt::Util.add_fields(request)
      request.body = self.to_json
      
      self.translations.each do |translation|
        translation.string_id = self.id
        translation.save
      end
      
      begin
        Util.handle_response(Connection.http_connection.request(request), true, true)
      rescue Timeout::Error
        puts "Request timeout. Will retry in 5 seconds."
        if (tries -= 1) > 0
          sleep(5)
          retry
        else
          success = false
        end
      end
      success
    end
140185
def setConnection(self, connection):
        
        # define custom properties
        if not isinstance(connection, orb.Connection):
            conn = orb.Connection.byName(connection)
            if not conn:
                raise orb.errors.BackendNotFound(connection)
            connection = conn(self)
        else:
            connection.setDatabase(self)

        self.__connection = connection
487536
def add(self, connection):
        ''''''
        key = (connection.host, connection.port)
        with self._lock:
            if key not in self._connections:
                self._connections[key] = connection
                self.added(connection)
                return connection
            else:
                return None
1064189
def ConnectionUpdate(self, settings):
    '''
    '''
    connection_path = self.connection_path

    NM = dbusmock.get_object(MANAGER_OBJ)
    settings_obj = dbusmock.get_object(SETTINGS_OBJ)

    main_connections = settings_obj.ListConnections()

    if connection_path not in main_connections:
        raise dbus.exceptions.DBusException(
            'Connection %s does not exist' % connection_path,
            name=MANAGER_IFACE + '.DoesNotExist',)

    # Take care not to overwrite the secrets
    for setting_name in settings:
        setting = settings[setting_name]
        for k in setting:
            if setting_name not in self.settings:
                self.settings[setting_name] = {}
            self.settings[setting_name][k] = setting[k]

    self.EmitSignal(CSETTINGS_IFACE, 'Updated', '', [])

    auto_connect = False
    if 'autoconnect' in settings['connection']:
        auto_connect = settings['connection']['autoconnect']

    if auto_connect:
        dev = None
        devices = NM.GetDevices()

        # Grab the first device.
        if len(devices) > 0:
            dev = devices[0]

        if dev:
            activate_connection(NM, connection_path, dev, connection_path)

    return connection_path
376411
def connection
      @connection ||= build_connection

      unless @connection.builder.handlers.include?(FaradayMiddleware::FollowRedirects)
        @connection.builder.insert(-2, FaradayMiddleware::FollowRedirects)
      end

      return @connection
    end
761418
def save_migration(connection, basename):
    

    # Prepare query
    sql = "INSERT INTO migrations_applied (name, date) VALUES (%s, NOW())"

    # Run
    with connection.cursor() as cursor:
        cursor.execute(sql, (basename,))
        connection.commit()

    return True
577500
def update(data)
      headers = @client.make_request(:post, @client.concat_user_path("#{CALL_PATH}/#{id}"), data)[1]
      if headers[:location]
         Client.get_id_from_location_header(headers[:location])
      end
    end
712480
private void saveConnectionRecord(ActiveConnectionRecord record) {

        // Get associated models
        ConnectionRecordModel recordModel = new ConnectionRecordModel();

        // Copy user information and timestamps into new record
        recordModel.setUsername(record.getUsername());
        recordModel.setConnectionIdentifier(record.getConnectionIdentifier());
        recordModel.setConnectionName(record.getConnectionName());
        recordModel.setRemoteHost(record.getRemoteHost());
        recordModel.setSharingProfileIdentifier(record.getSharingProfileIdentifier());
        recordModel.setSharingProfileName(record.getSharingProfileName());
        recordModel.setStartDate(record.getStartDate());
        recordModel.setEndDate(new Date());

        // Insert connection record
        connectionRecordMapper.insert(recordModel);

    }
321557
def connection
      @connection ||= Faraday.new(url) do |conn|
        conn.response(:parse_json)
        # Request compressed responses from ES and decompress them
        conn.use(:gzip)
        conn.request(:encode_json)
        conn.request(:opaque_id) if @opaque_id
        conn.request(:limit_size, max_request_size: max_request_size) if max_request_size
        conn.request(:elastomer_compress, compression: compression) if compress_body

        if @adapter.is_a?(Array)
          conn.adapter(*@adapter)
        else
          conn.adapter(@adapter)
        end

        conn.options[:timeout]      = read_timeout
        conn.options[:open_timeout] = open_timeout
      end
    end
215434
def add_profile(self, namespace, key, value, force=False):
        
        try:
            entry = dax.Profile(namespace, key, value)
            self._dax_node.addProfile(entry)
        except dax.DuplicateError:
            if force:
                # Replace with the new key
                self._dax_node.removeProfile(entry)
                self._dax_node.addProfile(entry)
1315939
def save(connection)
      request = @id > 0 ? 'EnginePoolUpdateRequest' : 'EnginePoolCreateRequest'
      xml = %(<#{request} session-id="#{connection.session_id}">)
      xml << '<EnginePool'
      xml << %( id="#{@id}") if @id > 0
      xml << %( name="#{@name}" scope="#{@scope}">)
      @engines.each do |engine|
        xml << %(<Engine name="#{engine.name}" />)
      end
      xml << '</EnginePool>'
      xml << %(</#{request}>)

      r = connection.execute(xml, '1.2')
      if r.success
        r.res.elements.each(request.gsub('Request', 'Response')) do |v|
          return @id = v.attributes['id'].to_i
        end
      end
    end
186791
function updateConnect ( index ) {

            // Skip connects set to false
            if ( !scope_Connects[index] ) {
                return;
            }

            var l = 0;
            var h = 100;

            if ( index !== 0 ) {
                l = scope_Locations[index - 1];
            }

            if ( index !== scope_Connects.length - 1 ) {
                h = scope_Locations[index];
            }

            scope_Connects[index].style[options.style] = toPct(l);
            scope_Connects[index].style[options.styleOposite] = toPct(100 - h);
        }
122831
def update(self,table, sys_id, **kparams):
        
        record = self.api.update(table, sys_id, **kparams)
        return record
852690
def connection
      @connection ||= Faraday.new(base_url, :builder_class => Saddle::RackBuilder) do |connection|
        # Include the requester level options
        connection.builder.saddle_options[:client_options] = @options

        # Config options
        connection.options[:timeout] = @timeout
        connection.builder.saddle_options[:request_style] = @request_style
        connection.builder.saddle_options[:num_retries] = @num_retries
        connection.builder.saddle_options[:client] = @parent_client

        # Support default return values upon exception
        connection.use(Saddle::Middleware::Response::DefaultResponse)

        # Hard timeout on the entire request
        connection.use(Saddle::Middleware::RubyTimeout)

        # Set up a user agent
        connection.use(Saddle::Middleware::Request::UserAgent)

        # Set up the path prefix if needed
        connection.use(Saddle::Middleware::Request::PathPrefix)

        # Apply additional implementation-specific middlewares
        @additional_middlewares.each do |m|
          m[:args] ? connection.use(m[:klass], *m[:args]) : connection.use(m[:klass])
        end

        # Request encoding
        connection.use(Saddle::Middleware::Request::JsonEncoded)
        connection.use(Saddle::Middleware::Request::UrlEncoded)

        # Automatic retries
        connection.use(Saddle::Middleware::Request::Retry)

        # Raise exceptions on 4xx and 5xx errors
        connection.use(Saddle::Middleware::Response::RaiseError)

        # Handle parsing out the response if it's JSON
        connection.use(Saddle::Middleware::Response::ParseJson)

        # Set up instrumentation around the adapter for extensibility
        connection.use(FaradayMiddleware::Instrumentation)

        # Add in extra env data if needed
        connection.use(Saddle::Middleware::ExtraEnv)

        # Set up our adapter
        if @stubs.nil?
          # Use the default adapter
          connection.adapter(@http_adapter[:key], *@http_adapter[:args])
        else
          # Use the test adapter
          connection.adapter(:test, @stubs)
        end
      end
    end
491029
def update(name, connection_uri="", id_file="", o=[], config=None):
    
    storm_ = get_storm_instance(config)
    settings = {}

    if id_file != "": 
        settings['identityfile'] = id_file

    for option in o:
        k, v = option.split("=")
        settings[k] = v

    try:
        storm_.update_entry(name, **settings)
        print(get_formatted_message(
            '"{0}" updated successfully.'.format(
                name
            ), 'success'))
    except ValueError as error:
        print(get_formatted_message(error, 'error'), file=sys.stderr)
        sys.exit(1)