// InstanceId returns the provider specific instance id for this machine and
// returns not provisioned if instance id is empty
165788
func (m *Machine) InstanceId() (instance.Id, error) {
	m.mu.Lock()
	defer m.mu.Unlock()

	if m.details.InstanceId == "" {
		return "", errors.NotProvisionedf("machine %v", m.details.Id)
	}
	return instance.Id(m.details.InstanceId), nil
}
1059253
func (s *GetInstanceAccessInput) SetInstanceId(v string) *GetInstanceAccessInput {
	s.InstanceId = &v
	return s
}
672752
func (s *SingleInstanceHealth) SetInstanceId(v string) *SingleInstanceHealth {
	s.InstanceId = &v
	return s
}
754392
func (s *DeregisterManagedInstanceInput) SetInstanceId(v string) *DeregisterManagedInstanceInput {
	s.InstanceId = &v
	return s
}
131432
func (s *DescribeCommandsInput) SetInstanceId(v string) *DescribeCommandsInput {
	s.InstanceId = &v
	return s
}
1269670
func (s *UnassignInstanceInput) SetInstanceId(v string) *UnassignInstanceInput {
	s.InstanceId = &v
	return s
}
80324
func (c *Cloud) InstanceID(nodeName types.NodeName) (string, error) {
	// In the future it is possible to also return an endpoint as:
	// <endpoint>/<zone>/<instanceid>
	if c.selfAWSInstance.nodeName == nodeName {
		return "/" + c.selfAWSInstance.availabilityZone + "/" + c.selfAWSInstance.awsID, nil
	}
	inst, err := c.getInstanceByNodeName(nodeName)
	if err != nil {
		return "", fmt.Errorf("getInstanceByNodeName failed for %q with %v", nodeName, err)
	}
	return "/" + orEmpty(inst.Placement.AvailabilityZone) + "/" + orEmpty(inst.InstanceId), nil
}
230507
func InstanceID(ctx types.Context) (*types.InstanceID, error) {

	// UUID can be obtained as descried in
	// https://azure.microsoft.com/en-us/blog/accessing-and-using-azure-vm-unique-id/
	// but this code will use hostname as ID

	hostname, err := os.Hostname()
	if err != nil {
		return nil, err
	}
	return &types.InstanceID{
		ID:     hostname,
		Driver: azureud.Name,
	}, nil
}
1292301
func (s *ListInventoryEntriesOutput) SetInstanceId(v string) *ListInventoryEntriesOutput {
	s.InstanceId = &v
	return s
}
889532
func (s *UpdateAssociationStatusInput) SetInstanceId(v string) *UpdateAssociationStatusInput {
	s.InstanceId = &v
	return s
}
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)
}
1260672
func (s *GetDeployablePatchSnapshotForInstanceOutput) SetInstanceId(v string) *GetDeployablePatchSnapshotForInstanceOutput {
	s.InstanceId = &v
	return s
}
810459
func InstanceID() (*types.InstanceID, error) {

	macs, err := getMacs()
	if err != nil {
		return nil, err
	}

	iid := &types.InstanceID{Driver: vbox.Name}
	if err := iid.MarshalMetadata(macs); err != nil {
		return nil, err
	}

	return iid, nil
}
305399
func (s *CreateInstanceOutput) SetInstanceId(v string) *CreateInstanceOutput {
	s.InstanceId = &v
	return s
}
82332
func (f *FakeCloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {
	f.addCall("instance-id")
	return f.ExtID[nodeName], nil
}
238505
func (s *GetMetricDataInput) SetInstanceId(v string) *GetMetricDataInput {
	s.InstanceId = &v
	return s
}
818836
func (m *MockMachine) InstanceId() (instance.Id, error) {
	ret := m.ctrl.Call(m, "InstanceId")
	ret0, _ := ret[0].(instance.Id)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}