Set Secret

        Set the secret associated with some key.  If the secret already exists, it is
        updated instead.

        This method takes input: ``v1/secret.json#``

        This method is ``stable``
348783
async def set(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["set"], *args, **kwargs)
8653
def random_secret() -> Secret:
    
    while True:
        secret = os.urandom(32)
        if secret != constants.EMPTY_HASH:
            return Secret(secret)
972106
def set(self, key, value):
        

        changed = super().set(key=key, value=value)

        if not changed:
            return False

        self._log.info('Saving configuration to "%s"...', self._filename)

        with open(self._filename, 'w') as stream:
            stream.write(self.content)
            self._log.info('Saved configuration to "%s".', self._filename)

        return True
1204106
def Set(self, key, value):
        
        if not value == None: self.prefs[key] = value
        else:                 self.prefs.pop(key)

        self.Dump()
1112812
def setMetaConf(self, key, value):
    
    self.send_setMetaConf(key, value)
    self.recv_setMetaConf()
341273
def set_(key, value, service=None, profile=None):  # pylint: disable=W0613
    '''
    
    '''
    key, profile = _parse_key(key, profile)
    cache = salt.cache.Cache(__opts__)
    cache.store(profile['bank'], key, value)
    return get(key, service, profile)
89090
def set(self, key, value):
        """"""
        key = "{0}{1}".format(self.prefix, key)

        value = json.dumps(value, cls=NumpyEncoder)
        self.redis.set(key, value)
1100140
def set(key, value)
      method_name = "validate_#{key}"
      send(method_name.to_sym, value) if respond_to?(method_name.to_sym)
      @data[key.to_s] = value
    end
252128
public static void setEncryptionKey(final String key) {

		if (key == null) {

			logger.info("set_encryption_key() was called with null parameter, resetting global secret key");

			// reset hash
			secretKeyHash = null;
			return;
		}

		try {

			secretKeyHash = MessageDigest.getInstance(HASH_ALGO).digest(key.getBytes("UTF-8"));

		} catch (Throwable t) {
			logger.error("Unable to set secret key: {}", t.getMessage());
		}
	}
260039
def set_info(self, key, value, append=True):
        
        if append:
            if key not in self.info:
                self.info[key] = []
            self.info[key].append(value)
        else:
            self.info[key] = value
992433
def secret_absent(name, namespace='default', **kwargs):
    '''
    
    '''

    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    secret = __salt__['kubernetes.show_secret'](name, namespace, **kwargs)

    if secret is None:
        ret['result'] = True if not __opts__['test'] else None
        ret['comment'] = 'The secret does not exist'
        return ret

    if __opts__['test']:
        ret['comment'] = 'The secret is going to be deleted'
        ret['result'] = None
        return ret

    __salt__['kubernetes.delete_secret'](name, namespace, **kwargs)

    # As for kubernetes 1.6.4 doesn't set a code when deleting a secret
    # The kubernetes module will raise an exception if the kubernetes
    # server will return an error
    ret['result'] = True
    ret['changes'] = {
        'kubernetes.secret': {
            'new': 'absent', 'old': 'present'}}
    ret['comment'] = 'Secret deleted'
    return ret
1202311
def set_(key, value, service=None, profile=None):
    '''
    
    '''
    service = _get_service(service, profile)
    keyring.set_password(service, key, value)
1333405
def secret(self, s):
        
        s = parseable_str(s)
        for f in [self.private_key, self.hierarchical_key]:
            v = f(s)
            if v:
                return v
863697
def set(self, key, func, *args, **kwargs):
        
        if key in self:
            return self[key]
        self[key] = value = func(*args, **kwargs)
        return value
745605
def set(self, key, value):
        ""
        # if key already in data, update indexes
        if not isinstance(value, dict):
            raise BadValueError(
                'The value {} is incorrect.'
                ' Values should be strings'.format(value))
        _value = deepcopy(value)
        if key in self.data:
            self.delete_from_index(key)
        self.data[key] = _value
        self.update_index(key, _value)
671126
def set(key , value)
      index = key_index(key)
      if( index )
        i_values.set(index , value)
      else
        i_keys.push(key)
        i_values.push(value)
      end
      value
    end
818570
def set(self, key, value):
        
        self._check_limit()
        _expire = time.time() + self._timeout if self._timeout else None
        self._store[key] = (value, _expire)