// SetSSHHostKeys updates the stored SSH host keys for an entity.
//
// See the note for GetSSHHostKeys regarding supported entities.
17408
func (st *State) SetSSHHostKeys(tag names.MachineTag, keys SSHHostKeys) error {
	coll, closer := st.db().GetCollection(sshHostKeysC)
	defer closer()
	id := machineGlobalKey(tag.Id())
	doc := sshHostKeysDoc{
		Keys: keys,
	}
	var dbDoc sshHostKeysDoc
	buildTxn := func(attempt int) ([]txn.Op, error) {
		err := coll.FindId(id).One(&dbDoc)
		if err != nil {
			if err == mgo.ErrNotFound {
				return []txn.Op{{
					C:      sshHostKeysC,
					Id:     id,
					Insert: doc,
				}}, nil
			}
			return nil, err
		}
		if keysEqual(dbDoc.Keys, keys) {
			return nil, jujutxn.ErrNoOperations
		}
		return []txn.Op{{
			C:      sshHostKeysC,
			Id:     id,
			Update: bson.M{"$set": doc},
		}}, nil
	}

	if err := st.db().Run(buildTxn); err != nil {
		return errors.Annotate(err, "SSH host key update failed")
	}
	return nil
}
406498
func (s *UpdateUserProfileInput) SetSshPublicKey(v string) *UpdateUserProfileInput {
	s.SshPublicKey = &v
	return s
}
770417
func (s *DescribeClusterSecurityGroupsInput) SetTagKeys(v []*string) *DescribeClusterSecurityGroupsInput {
	s.TagKeys = v
	return s
}
100558
func (context *OpsManager) SetSSHPrivateKey(key string) {
	lo.G.Debug("Setting SSHKey")
	context.SSHPrivateKey = key
	context.createExecuter()
}
1007934
func (s *UntagUserInput) SetTagKeys(v []*string) *UntagUserInput {
	s.TagKeys = v
	return s
}
1038013
func (e *hashElem) setKey(v []byte) {
	e.key = assign(e.key, v)
}
460861
func (s *UpdateStackInput) SetDefaultSshKeyName(v string) *UpdateStackInput {
	s.DefaultSshKeyName = &v
	return s
}
268132
func (s *BGPPeer) SetAuthKey(v string) *BGPPeer {
	s.AuthKey = &v
	return s
}
935246
func (c *Ctx) SetDHParameters(dh *DH) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if int(C.X_SSL_CTX_set_tmp_dh(c.ctx, dh.dh)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}
456381
func (s *ListServersOutput) SetServers(v []*ListedServer) *ListServersOutput {
	s.Servers = v
	return s
}
559791
func (s *DescribeHsmOutput) SetSshKeyLastUpdated(v string) *DescribeHsmOutput {
	s.SshKeyLastUpdated = &v
	return s
}
133738
func (s *DetectKeyPhrasesOutput) SetKeyPhrases(v []*KeyPhrase) *DetectKeyPhrasesOutput {
	s.KeyPhrases = v
	return s
}
978395
func (s *DetectEntitiesOutput) SetEntities(v []*Entity) *DetectEntitiesOutput {
	s.Entities = v
	return s
}
353533
func (s *ImportSshPublicKeyOutput) SetSshPublicKeyId(v string) *ImportSshPublicKeyOutput {
	s.SshPublicKeyId = &v
	return s
}
277028
func (c *Client) UpdateSSHKey(key SSHKey) error {
	values := url.Values{
		"SSHKEYID": {key.ID},
	}
	if key.Name != "" {
		values.Add("name", key.Name)
	}
	if key.Key != "" {
		values.Add("ssh_key", key.Key)
	}

	if err := c.post(`sshkey/update`, values, nil); err != nil {
		return err
	}
	return nil
}
254106
func (s *UntagInput) SetKeys(v []*string) *UntagInput {
	s.Keys = v
	return s
}
443109
func (s *UpdateSSHPublicKeyInput) SetSSHPublicKeyId(v string) *UpdateSSHPublicKeyInput {
	s.SSHPublicKeyId = &v
	return s
}