//Associate an SSH key to the instance with the specified id exists in the current environment
//Note: This will reboot your instance if running
970525
func (instanceApi *InstanceApi) AssociateSSHKey(id string, sshKeyName string) (bool, error) {
	send, merr := json.Marshal(Instance{
		SSHKeyName: sshKeyName,
	})
	if merr != nil {
		return false, merr
	}
	_, err := instanceApi.entityService.Execute(id, INSTANCE_ASSOCIATE_SSH_KEY_OPERATION, send, map[string]string{})
	return err == nil, err
}
985629
func (os *OpenStack) InstanceID() (string, error) {
	if len(os.localInstanceID) == 0 {
		id, err := readInstanceID(os.metadataOpts.SearchOrder)
		if err != nil {
			return "", err
		}
		os.localInstanceID = id
	}
	return os.localInstanceID, nil
}
579767
func (d *Executor) InstanceID(
	ctx types.Context,
	opts types.Store) (*types.InstanceID, error) {
	return d.instanceID, nil
}
248659
func (g *Gitlab) ProjectDeployKey(id, keyId string) (*SshKey, *ResponseMeta, error) {
	u := g.ResourceUrl(ProjectDeployKeyApiPath, map[string]string{
		":id":     id,
		":key_id": keyId,
	})

	var deployKey *SshKey

	contents, meta, err := g.buildAndExecRequest("GET", u.String(), nil)
	if err == nil {
		err = json.Unmarshal(contents, &deployKey)
	}

	return deployKey, meta, err
}
571581
func (pc peerConn) ID() ID {
	return PubKeyToID(pc.conn.(*tmconn.SecretConnection).RemotePubKey())
}
59888
func (o *oracleInstance) Id() instance.Id {
	if o.machine.Name != "" {
		name, err := extractInstanceIDFromMachineName(o.machine.Name)
		if err != nil {
			return instance.Id(o.machine.Name)
		}
		return name
	}

	return instance.Id(o.name)
}
1012399
func (s *RebootInstanceInput) SetInstanceId(v string) *RebootInstanceInput {
	s.InstanceId = &v
	return s
}
682823
func (inst *environInstance) Id() instance.Id {
	return instance.Id(inst.base.ID)
}
43762
func (km *keyMutex) UnlockKey(id string) error {
	glog.V(5).Infof("UnlockKey(...) called for id %q\r\n", id)
	km.RLock()
	defer km.RUnlock()
	mutex, exists := km.mutexMap[id]
	if !exists {
		return fmt.Errorf("id %q not found", id)
	}
	glog.V(5).Infof("UnlockKey(...) for id. Mutex found, trying to unlock it. %q\r\n", id)

	mutex.Unlock()
	glog.V(5).Infof("UnlockKey(...) for id %q completed.\r\n", id)
	return nil
}
437375
func (d *driver) InstanceID(
	ctx types.Context,
	opts types.Store) (*types.InstanceID, error) {

	return d.getInstanceID()
}
291700
func (r *KeyResource) Update(account, key, label string, id int) (*Key, error) {

	values := url.Values{}
	values.Add("key", key)
	values.Add("label", label)

	k := Key{}
	path := fmt.Sprintf("/users/%s/ssh-keys/%v", account, id)
	if err := r.client.do("PUT", path, nil, values, &k); err != nil {
		return nil, err
	}

	return &k, nil
}
713857
func (ca *CertAuthorityV2) ID() *CertAuthID {
	return &CertAuthID{DomainName: ca.Spec.ClusterName, Type: ca.Spec.Type}
}
654329
func (i sigmaInstance) Id() instance.Id {
	id := instance.Id(i.server.UUID())
	logger.Tracef("sigmaInstance.Id: %s", id)
	return id
}
82332
func (f *FakeCloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {
	f.addCall("instance-id")
	return f.ExtID[nodeName], nil
}
8330
func (s *StartInstanceInput) SetInstanceId(v string) *StartInstanceInput {
	s.InstanceId = &v
	return s
}
1126840
func (d *DiskEditValue) SetSSHKeys(keyIDs []string) {
	if d.SSHKeys == nil {
		d.SSHKeys = []*SSHKey{}
	}
	for _, keyID := range keyIDs {
		d.SSHKeys = append(d.SSHKeys, &SSHKey{Resource: NewResourceByStringID(keyID)})
	}
}
345123
func (c *importKeysCommand) Init(args []string) error {
	if len(args) == 0 {
		return errors.New("no ssh key id specified")
	}
	c.sshKeyIds = args
	for _, k := range c.sshKeyIds {
		if len(k) < 3 {
			return errors.NotValidf("%q key ID", k)
		}
		switch k[:3] {
		case "lp:", "gh:":
		default:
			return errors.NewNotSupported(nil,
				fmt.Sprintf("prefix in Key ID %q not supported, only lp: and gh: are allowed", k))
		}
	}
	return nil
}