Closed sanket4373 closed 6 years ago
Try client.BindResource(netscaler.Servicegroup.Type(), "test-svc-grp", netscaler.Server.Type(), "test-server", &bindSvcGrpToServer)
According to the reference guide, the api call should be having this as a url: http://<netscaler-ip-address/nitro/v1/config/servicegroup_servicegroupmember_binding
. Whereas, in the logs I see it as http://x.x.x.x/nitro/v1/config/server_servicegroup_binding
.. Not sure if I am passing the resource types incorrectly in the BindResource
function.
you are. please see comment above
Had already tried that.. My bad forgot to post the error for that.. Nevertheless I gave it a shot again. Still the same error, got a 400 Bad Request:
go-nitro: Creating resource of type servicegroup_server_binding
2018/01/25 10:32:00 [TRACE] go-nitro: url is http://x.x.x.x/nitro/v1/config/servicegroup_server_binding
2018/01/25 10:32:00 [DEBUG] go-nitro: response Status: 400 Bad Request
2018/01/25 10:32:00 [INFO] go-nitro: error = { "errorcode": 1232, "message": "Invalid object name [servicegroup_server_binding]", "severity": "ERROR" }
This doesn't look right: servicegroup_server_binding
. At no point I am getting the expected output in the logs: servicegroup_servicegroupmember_binding
. Initially I thought the Nitro API for the servicegroup_servicegroupmember_binding
must have been broken, but I was able to confirm that it works by running curl call.
For my client script as a work around i wrote a go client based on that curl request for the servicegroup_servicegroupmember_binding
call.
Again, I don't see what else I might have missed here.
This particular API is pretty confusing. I have added an example f2c3659
see f2c3659
I was doing the same as you had suggested in your response to my previous issue. Here is my code snippet:
However, I am getting the following error at the
server_servicegroup_binding
when I execute the above functionality:I have added the mandatory variables to the binding struct i.e. servername, port, servicegroupname. Not sure why I am getting an invalid servername error ? The library also suggests the same: https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/basic/servicegroup_servicegroupmember_binding/servicegroup_servicegroupmember_binding/
And this curl call also suggests the same in terms of passing the parameters for binding the server and the servicegroup.