ovh / csharp-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you change the provider in code without declaring a new client?

Snakzi opened this issue · comments

Hello,

is there any option to change the provider inside the code without declaring a new client?

"Client client = new Client("stringprovider")"

works.
However, "client.Endpoint = "ovh-eu"" for example does not work?

Best regards

Hi,

Indeed, client.Endpoint is not intended to be modified after instantiation. Since we do not trigger a configuration reload when this value is changed, it will keep its current time offset, secret, application key and so on, so this will not work.

When doing operations on multiple endpoint, I'd create two separate clients and name them EUClient/USClient. Does that create an issue for you?

Hi,

that would do the trick. Thanks for the heads up!