func (m *MachinesClient) Create(ctx context.Context, orgID, teamID *identity.ID,
	name string, output *ProgressFunc) (*apitypes.MachineSegment, *base64.Value, error) {

	secret, err := createTokenSecret()
	if err != nil {
		return nil, nil, err
	}

	mcr := apitypes.MachinesCreateRequest{
		Name:   name,
		OrgID:  orgID,
		TeamID: teamID,
		Secret: secret,
	}

	req, reqID, err := m.client.NewRequest("POST", "/machines", nil, &mcr, false)
	if err != nil {
		return nil, nil, err
	}

	result := &apitypes.MachineSegment{}
	_, err = m.client.Do(ctx, req, result, &reqID, output)
	if err != nil {
		return nil, nil, err
	}

	return result, secret, nil
}
// Create a new machine in the given org
Create a new machine in the given org
// Create a new machine in the given org
func (m *MachinesClient) Create(ctx context.Context, orgID, teamID *identity.ID,
	name string, output *ProgressFunc) (*apitypes.MachineSegment, *base64.Value, error) {
	secret, err := createTokenSecret()
	if err != nil {
		return nil, nil, err
	}
	mcr := apitypes.MachinesCreateRequest{
		Name:   name,
		OrgID:  orgID,
		TeamID: teamID,
		Secret: secret,
	}
	req, reqID, err := m.client.NewRequest("POST", "/machines", nil, &mcr, false)
	if err != nil {
		return nil, nil, err
	}
	result := &apitypes.MachineSegment{}
	_, err = m.client.Do(ctx, req, result, &reqID, output)
	if err != nil {
		return nil, nil, err
	}
	return result, secret, nil
}
func ( m * MachinesClient ) Create ( ctx context . Context , orgID , teamID * identity . ID , name string , output * ProgressFunc ) ( * apitypes . MachineSegment , * base64 . Value , error ) { secret , err := createTokenSecret ( ) if err != nil { return nil , nil , err } mcr := apitypes . MachinesCreateRequest { Name : name , OrgID : orgID , TeamID : teamID , Secret : secret , } req , reqID , err := m . client . NewRequest ( " " , " " , nil , & mcr , false ) if err != nil { return nil , nil , err } result := & apitypes . MachineSegment { } _ , err = m . client . Do ( ctx , req , result , & reqID , output ) if err != nil { return nil , nil , err } return result , secret , nil }
Create a new machine in the given org
Create a new machine in the given org