Is your feature request related to a problem? Please describe.
@nadre reported that he experienced an unexpected behavior when initializing the Client class together with a profile saved in the client-settings.json. He used the following command to initialize the client:
Client("my-server", api_token = "XYZ").
where my-server was an entry in the client-settings.json that had an API token which differed from the API token that was passed as an argument to Client. In that case, the API token from the client-settings currently prevails. No warning is currently printed in that case.
He also remarked that the parameter username is used inconsistently in the rest_client and should be changed to user.
Describe the solution you'd like
I would say that parameters which are provided explicitly to the constructor overwrite those from the client-settings.json. This should be the case for the parameters api_token and verify_ssl.
If an API token is provided together with a username and a password, then the given API token should be taken and the username and password should be ignored. A warning should be printed that the username and password are not used.
If a username and password are provided, then a new API token should be generated even if one is already defined in the client-settings.json. In that case, we should overwrite the entry in the client-settings.json with the new API token.
If any parameter is overwritten (or set multiple times), a warning should be printed.
The parameter name for username should be changed to user in Client.
Is your feature request related to a problem? Please describe.
@nadre reported that he experienced an unexpected behavior when initializing the Client class together with a profile saved in the
client-settings.json
. He used the following command to initialize the client:where
my-server
was an entry in theclient-settings.json
that had an API token which differed from the API token that was passed as an argument to Client. In that case, the API token from the client-settings currently prevails. No warning is currently printed in that case.He also remarked that the parameter
username
is used inconsistently in the rest_client and should be changed touser
.Describe the solution you'd like
client-settings.json
. This should be the case for the parametersapi_token
andverify_ssl
.client-settings.json
. In that case, we should overwrite the entry in theclient-settings.json
with the new API token.username
should be changed touser
in Client.