.Net Octopus.Client - get machines for an environment

hi,
my requirement is that above.
i have the following code where i was expecting links to the machines, but they do not

var env = repository.Environments.FindByName(code);
var machineLink = env.Links[“Machines”];
MachineResource mr = repository.Machines.Get(machineLink);

mr has 4 links which are exactly the same as the machineLink.

Could you help or point me in the right direction?
thanks,
Mike

Hi Michael,

Thanks for getting in touch! Could you try this one instead:
var machines = Repository.Client.List<MachineResource>(environment.Links["Machines"]);

Hope that helps!
Vanessa

fantastic, thank you Vanessa. Works perfectly.

best regards,
Mike

How do we now update data for one or more of these machines?

For example, I have the following line of code

machines.Items[0].IsDisabled = true;

How to I commit the change via the API?

Hi Alex,

The code you are looking for should as follows: Repository.Machines.Modify(machines.Items[0])

Hope this helps!
Vanessa