-
Notifications
You must be signed in to change notification settings - Fork 0
PB-1750: Add instructions for using custom environments
#216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e0f31db
81d7c53
4620321
eaea638
8d98bf9
9b4b6dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,54 @@ With an instantiated `Client` object, and username and password set as environme | |
| client.authenticate() | ||
| ``` | ||
|
|
||
| ### Using different environments | ||
|
|
||
| The `Client` defaults to using the Uncertainty Engine production environment. To use a different named environment, pass it as the `env` argument: | ||
|
|
||
| ```python | ||
| client = Client(env="dev") | ||
| ``` | ||
|
|
||
| If a custom environment has been provided for you, pass an `Environment` that describes the details: | ||
|
|
||
| ```python | ||
| from uncertainty_engine import Client, Environment | ||
|
|
||
| client = Client( | ||
| env=Environment( | ||
| cognito_user_pool_client_id="…", | ||
| core_api="…", | ||
| region="…", | ||
| resource_api="…", | ||
|
cariad marked this conversation as resolved.
|
||
| ), | ||
| ) | ||
| ``` | ||
|
|
||
| | Argument | Format | Example | | ||
| | ----------------------------- | --------------------------------------------- | -------------------------------------------------------- | | ||
| | `cognito_user_pool_client_id` | Alphanumeric string | `3vj5pe253j4v070euqjdk38a24` | | ||
| | `core_api` | Starts with `https://`, does not end with `/` | `https://de1v75vvk6.execute-api.eu-west-2.amazonaws.com` | | ||
| | `region` | Geographic region code | `eu-west-2` | | ||
| | `resource_api` | Starts with `https://`, does not end with `/` | `https://m90q55iux6.execute-api.eu-west-2.amazonaws.com` | | ||
|
|
||
| **Note:** Every password is tied to a specific environment. A password for the production environment, for example, won't grant access to the development environment. Ensure you set the correct `UE_PASSWORD` value for the environment you configure. | ||
|
cariad marked this conversation as resolved.
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should also include this line somewhere in this section as a reminder: Note It is something that is coming up a lot, and it will be useful to make it clear in the documentation that when people are switching between environments, they shouldn't forget this step. |
||
| ### Troubleshooting | ||
|
|
||
| Authorisation tokens are cached in `.ue_auth` in your home directory. If the SDK fails to authenticate you (for example, after switching from one environment to another), delete `.ue_auth` to generate and cache new tokens. | ||
|
|
||
| To delete the cache in macOS or Linux: | ||
|
|
||
| ```bash | ||
| rm ~/.ue_auth | ||
| ``` | ||
|
cariad marked this conversation as resolved.
|
||
|
|
||
| To delete the cache in Windows: | ||
|
|
||
| ```bat | ||
| del "%USERPROFILE%\.ue_auth" | ||
| ``` | ||
|
|
||
| ### Running a node | ||
|
|
||
| ```python | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.