I’m trying to use API via Octopus.Client C# library. I’m trying to add a machine to an environment like this:
var machine = repository.Machines.Get(machineId);
machine.EnvironmentIds.Add(environmentId);
var updated = repository.Machines.Modify(machine);
But I get the exception:
{"Octopus Server returned an error: This operation is not supported for a relative URI.
Server exception:
System.InvalidOperationException: This operation is not supported for a relative URI.
at System.Uri.get_Scheme()
at Octopus.Server.Web.Api.Rules.PassiveTentacleUriMustBeHttpsRule.AfterMapBeforeStore(Machine model, MachineResource resource, ISpecialRuleContext context) in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\Rules\PassiveTentacleUriMustBeHttpsRule.cs:line 17
at Octopus.Platform.Web.Api.Responder1.ExecuteRules[TRule](Action
2 ruleCallback) in y:\work\refs\heads\master\source\Octopus.Platform.Web\Api\Responder.cs:line 185
at Octopus.Platform.Web.Api.ModifyResponseDescriptor2.Responder.Execute() in y:\\work\\refs\\heads\\master\\source\\Octopus.Platform.Web\\Api\\ModifyResponseDescriptor.cs:line 58 at Octopus.Platform.Web.Api.Responder
1.Respond(TDescriptor options, NancyContext context) in y:\work\refs\heads\master\source\Octopus.Platform.Web\Api\Responder.cs:line 163
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at CallSite.Target(Closure , CallSite , Object , Object , NancyContext )
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass5.<.ctor>b__2(Object o) in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 47
at CallSite.Target(Closure , CallSite , Func`2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
"}
All the Id’s I got from the API, so they are correct. And when I step through debugging, I can see list of environments in the machine.
What am I doing wrong?