sky-uk / go-pulse-vtm

Go Bindings for Pulse Secure Virtual Traffic Manager
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

problem with using cli #46

Closed iahmad-khan closed 7 years ago

iahmad-khan commented 7 years ago

Hi

I have just setup everything correctly , using the latest relase , and getting this error on every command:

Error retreiving the list of monitors. Error: Response status code: 404 [iahmad@web-prod-ijaz001 go-brocade-vtm-0.2.11]$ ./go-brocade-vtm-cli -debug monitor-show-all 2017/09/26 16:24:05 -------------------------------------------------------------- 2017/09/26 16:24:05 Request payload: 2017/09/26 16:24:05 2017/09/26 16:24:05 -------------------------------------------------------------- ------> content:

Error retreiving the list of monitors. Error: Response status code: 404

no-acl commented 7 years ago

Have you checked to make sure that the "BROCADEVTM_SERVER" environment variable is set to the correct address?

no-acl commented 7 years ago

I've created a new release v0.3.1 This release is using an updated version of the rest client and should give you a more in-depth error message. Please try using this version and let me know if a problem still exists.

iahmad-khan commented 7 years ago

hi

updated to new version , i can get the resource by curl but the cli is having problem:

2017/09/26 17:24:19 Going to perform request:[GET] https://myvtm:9070/api/tm/3.8/config/active/monitors/ 2017/09/26 17:24:19 -------------------------------------------------------------- 2017/09/26 17:24:19 Request payload: 2017/09/26 17:24:19 2017/09/26 17:24:19 -------------------------------------------------------------- 2017/09/26 17:24:19 BodyText: {"error_id":"resource.not_found","error_text":"Resource '/api/tm/3.8/config/active/monitors' does not exist"} 2017/09/26 17:24:19 Response content type: json

Error retreiving the list of monitors. Error: Response status code: 404

iahmad-khan commented 7 years ago

I noted that we are using 3.9 , can we tell the cli to use 3.9 api version?

no-acl commented 7 years ago

Currently it's hardcoded to 3.8, however this is something we plan to do in the near future.

In the meantime you could modify the monitorEndpoint variable in go-brocade-vtm/api/monitor/monitor.go to be 3.9 instead of 3.8.

I'll update you when we make the change to allow different versions

iahmad-khan commented 7 years ago

Yes , ideally all the configuration options should be pulled out to some config file or made command line options.

For now , I think I should just search the code for 3.8 and replace them with 3.9 using sed , and then build for myself.

Thanks

no-acl commented 7 years ago

I've added support in the cli for specifying API version, this is available in v0.3.2. You might want to take a look at our Terraform Provider for brocade, which allows you to easily manage your brocade resources using Terraform. https://github.com/sky-uk/terraform-provider-brocadevtm/wiki If there's any features you think would be beneficial we would be glad to hear them. This is also tied to 3.8 but soon it will be generic to any version. Thanks

iahmad-khan commented 7 years ago

Hi ,

Yes , it would be great if things are just pluggible , we are changing the api version quite frequently with new upgrades for vtm , now we are using 5.0 , as soon as api version is parameterized in terraform , i wil give it a try.

thanks again.