Set a key/value pair in the vault service
359782
def set_(key, value, profile=None):
    '''
    
    '''
    if '?' in key:
        __utils__['versions.warn_until'](
            'Neon',
            (
                'Using ? to seperate between the path and key for vault has been deprecated '
                'and will be removed in {version}.  Please just use a /.'
            ),
        )
        path, key = key.split('?')
    else:
        path, key = key.rsplit('/', 1)

    try:
        url = 'v1/{0}'.format(path)
        data = {key: value}
        response = __utils__['vault.make_request'](
            'POST',
            url,
            profile,
            json=data)

        if response.status_code != 204:
            response.raise_for_status()
        return True
    except Exception as e:
        log.error('Failed to write secret! %s: %s', type(e).__name__, e)
        raise salt.exceptions.CommandExecutionError(e)
1214086
def set_encode_key_value(self, value, store_type=PUBLIC_KEY_STORE_TYPE_BASE64):
        """"""
        if store_type == PUBLIC_KEY_STORE_TYPE_PEM:
            PublicKeyBase.set_encode_key_value(self, value.exportKey('PEM').decode(), store_type)
        else:
            PublicKeyBase.set_encode_key_value(self, value.exportKey('DER'), store_type)
502669
function attemptListIndexesFromVault(state, vault, topic, partialIndex, options, cb) {
	// 0-length array response indicates non-existence in this vault
	// this may be totally acceptable for volatile caches

	if (!vault.archive.list) {
		return state.error(null, 'List-operations not supported on vault ' + vault.name, cb);
	}

	var topicApi = configuration.getTopicApi(topic, vault.name);
	if (!topicApi) {
		// no API available for this topic on this vault

		logger.verbose('No API available for topic', topic, 'on vault', vault.name);
		return cb();
	}

	// check if there even is an index

	if (!topicApi.index) {
		return state.error(null, 'Cannot list indexes on a topic without an index signature', cb);
	}

	// attempt to get from the vault

	logger.verbose('Attempting to list indexes for topic', topic, 'on vault', vault.name);

	var startTime = process.hrtime();

	vault.archive.list(topicApi, topic, partialIndex, options, function (error, indexes) {
		if (error) {
			exports.emit('vaultError', vault.name, 'list');

			// alert the error and mark state as erroneous
			var context = {
				index: partialIndex,
				operation: 'list',
				topic: topic,
				vault: vault.name
			};

			logger.alert.data(context).log(error);

			return state.error(null, null, cb);
		}

		exports.emit('operation', vault.name, 'list', process.hrtime(startTime));

		// value should be undefined to indicate a valid case of non-existing value

		logger.verbose('Found', indexes.length, 'indexes in vault', vault.name);

		cb(null, indexes);
	});
}
851456
def set(self, key, value, *args, **kwargs):
        
        if self.cfg.jsonpickle:
            value = jsonpickle.encode(value)
        return self.conn.set(key, value, *args, **kwargs)
167201
def setValue(self, key, value, channel=1):
        
        if channel in self.CHANNELS:
            return self.CHANNELS[channel].setValue(key, value)

        LOG.error("HMDevice.setValue: channel not found %i!" % channel)
1045177
def set(self, key, val, time=0, min_compress_len=0):
        """"""
        if not self.servers:
            return

        key = self._qualified_key(key)
        hashed_key = self.key_hasher(key)
        val = (key, val)

        self.client.set(key=hashed_key,
                        val=val,
                        time=time,
                        min_compress_len=min_compress_len)
        self.logger("SET: %s", key)
705212
def create(vault_id, file, options = {:headers => {"Content-Type"=>"application/octet-stream"}})
      options.merge!(default_options_to_merge_with)
      options[:body] = file.read
      self.class.post("/#{@api_ver}/vaults/#{vault_id}/blobs", options)
    end
687360
function(key, value) {
          const key2 = key.toLowerCase().replace(/[^a-z0-9]/ig, '');
          res.serverassist.headers[key]    = value;
          res.serverassist.headers2[key2]  = value;
        }
451809
def update(vault_id, name)
      options = default_options_to_merge_with.merge({ query: { name: name } })
      self.class.put("/#{@api_ver}/vaults/#{vault_id}", options)
    end
679639
function set$1 (obj, key, val) {
  if (Array.isArray(obj)) {
    obj.length = Math.max(obj.length, key);
    obj.splice(key, 1, val);
    return val
  }
  if (hasOwn(obj, key)) {
    obj[key] = val;
    return
  }
  var ob = obj.__ob__;
  if (obj._isVue || (ob && ob.vmCount)) {
    process.env.NODE_ENV !== 'production' && warn(
      'Avoid adding reactive properties to a Vue instance or its root $data ' +
      'at runtime - declare it upfront in the data option.'
    );
    return
  }
  if (!ob) {
    obj[key] = val;
    return
  }
  defineReactive$$1(ob.value, key, val);
  ob.dep.notify();
  return val
}
706817
def set_value_for_key(self, key, value):
        
        if key in self.options:
            self.options[key]['value'] = value
727720
def _set_vault_view(self, session):
        """"""
        if self._vault_view == COMPARATIVE:
            try:
                session.use_comparative_vault_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_plenary_vault_view()
            except AttributeError:
                pass
589650
def set_(conn,
         key,
         value,
         time=DEFAULT_TIME,
         min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
    '''
    
    '''
    if not isinstance(time, integer_types):
        raise SaltInvocationError('\'time\' must be an integer')
    if not isinstance(min_compress_len, integer_types):
        raise SaltInvocationError('\'min_compress_len\' must be an integer')
    _check_stats(conn)
    return conn.set(key, value, time, min_compress_len)
90047
def payload_set(self, value):
        
        payload = saveJSON(value, pretty=False)
        super(APPDataMessage, self).payload_set(payload)
43721
def set_variable(name, value)
      current_path = '/api/v1/variables'
      payload = { 'name' => name, 'value' => value }.to_json
      @conn.put(current_path, payload)
    end
1091563
function set(path, value, options = {}) {
    let paths = _pathsArray(path);
    let existingValue;

    // If using options.compare = true.  JSON.strigify compare the two sets of data.
    // If they are exactly the same, abort the update.
    if (options.compare) {
      existingValue = getSilent(path);

      if (JSON.stringify(value) === JSON.stringify(existingValue)) {
        return;
      }
    }

    // Get all paths to notify for updates if given an object
    if (_isObject(value) === true) {
      existingValue = existingValue || getSilent(path);

      // If previous value was also an object, we need to see which keys have
      // changed to notify watchers on those keys
      if (_isObject(existingValue)) {
        
        let oldKeys = _deepKeys(existingValue, path);
        let removedKeys;

        paths = _deepKeys(value, path);
        removedKeys = difference(oldKeys, paths);

        // If keys were removed in set, we need to notify those watchers
        if (removedKeys.length > 0) {
          paths = paths.concat(removedKeys);
        }
      }
    }

    setSilent(path, value);
    notifyWatchersOnPaths(paths);
  }
739679
def set(self, key, value, expire_in=None):
    
    if key not in self._keystore:
      self._keystore[key] = InMemoryItemValue(expire_in=expire_in)

    k = self._keystore[key]
    """:type k InMemoryItemValue"""
    k.update_expire_time(expire_in)
    k.value = value