Skip to content

Commit 16f0152

Browse files
committed
refactor(readme): Final updates to readme
BREAKING CHANGE: This is a breaking change
1 parent a6163ac commit 16f0152

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

MIGRATION-V4.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ We need to specify the optional param name:
124124
assistant_service.list_workspaces(page_limit=10)
125125
```
126126

127+
## DISABLING SSL VERIFICATION
128+
#### Before
129+
```python
130+
service.disable_ssl_verification(True)
131+
```
132+
133+
#### After(v4.0)
134+
```python
135+
service.set_disable_ssl_verification(True)
136+
```
137+
127138
## SUPPORT FOR CONSTANTS
128139
Constants for methods and models are shown in the form of Enums
129140

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
2929
* [Disable SSL certificate verification](#disable-ssl-certificate-verification)
3030
* [Setting the service url](#setting-the-service-url)
3131
* [Sending request headers](#sending-request-headers)
32-
* [Parsing HTTP response info](#parsing-http-response-info)
32+
* [Parsing HTTP response information](#parsing-http-response-information)
3333
* [Using Websockets](#using-websockets)
3434
* [Cloud Pak for Data(CP4D)](#cloud-pak-for-data)
3535
* [Logging](#logging)
@@ -41,7 +41,7 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
4141
</details>
4242

4343
## Before you begin
44-
* You need an [IBM Cloud][ibm-cloud-onboarding] account.
44+
* You need an [IBM Cloud][ibm-cloud-onboarding] account. We now only support `python 3.5` and above
4545

4646
## Installation
4747
To install, use `pip` or `easy_install`:
@@ -94,8 +94,6 @@ Watson services are migrating to token-based Identity and Access Management (IAM
9494
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
9595
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
9696

97-
**Note:** Authenticating with the X-Watson-Authorization-Token header is deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. See [here](#iam) for details.
98-
9997
### Getting credentials
10098
To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:
10199

@@ -115,8 +113,8 @@ With a credential file, you just need to put the file in the right place and the
115113

116114
The file downloaded will be called `ibm-credentials.env`. This is the name the SDK will search for and **must** be preserved unless you want to configure the file path (more on that later). The SDK will look for your `ibm-credentials.env` file in the following places (in order):
117115

118-
- Your system's home directory
119116
- The top-level directory of the project you're using the SDK in
117+
- Your system's home directory
120118

121119
As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following:
122120

@@ -140,8 +138,8 @@ where `<path>` is something like `/home/user/Downloads/<file_name>.env`.
140138
Simply set the environment variables using <service name>_<variable name> syntax. For example, using your favourite terminal, you can set environment variables for Assistant service instance:
141139

142140
```bash
143-
export assistant_apikey="<your apikey>"
144-
export assistant_auth_type="iam"
141+
export ASSISTANT_APIKEY="<your apikey>"
142+
export ASSISTANT_AUTH_TYPE="iam"
145143
```
146144

147145
The credentials will be loaded from the environment automatically
@@ -177,11 +175,11 @@ discovery = DiscoveryV1(version='2018-08-01',
177175
discovery.set_service_url('<url_as_per_region>')
178176
```
179177

180-
#### Generating access tokens using API key
178+
#### Generating bearer tokens using API key
181179
```python
182180
from ibm_watson import IAMTokenManager
183181

184-
# In your API endpoint use this to generate new access tokens
182+
# In your API endpoint use this to generate new bearer tokens
185183
iam_token_manager = IAMTokenManager(apikey='<apikey>')
186184
token = iam_token_manager.get_token()
187185
```
@@ -261,12 +259,13 @@ assistant = AssistantV1(
261259
authenticator=authenticator)
262260
assistant.set_service_url('<url as per region>')
263261
```
262+
For more information, follow the [MIGRATION-V4](https://github.com/watson-developer-cloud/python-sdk/MIGRATION-V4.md)
264263

265264
## Migration
266-
This version includes many breaking changes as a result of standardizing behavior across the new generated services. Full details on migration from previous versions can be found [here](https://github.com/watson-developer-cloud/python-sdk/wiki/Migration).
265+
To move from v3.x to v4.0, refer to the [MIGRATION-V4](https://github.com/watson-developer-cloud/python-sdk/MIGRATION-V4.md).
267266

268267
## Configuring the http client (Supported from v1.1.0)
269-
To set client configs like timeout use the `with_http_config()` function and pass it a dictionary of configs.
268+
To set client configs like timeout use the `with_http_config()` function and pass it a dictionary of configs. For example for a Assistant service instance
270269

271270
```python
272271
from ibm_watson import AssistantV1
@@ -291,14 +290,20 @@ For ICP(IBM Cloud Private), you can disable the SSL certificate verification by:
291290
service.set_disable_ssl_verification(True)
292291
```
293292

293+
Or can set it from extrernal sources. For example set in the environment variable.
294+
295+
```
296+
export <service name>_DISABLE_SSL=True
297+
```
298+
294299
## Setting the service url
295300
To set the base service to be used when contacting the service
296301

297302
```python
298303
service.set_service_url('my_new_service_url')
299304
```
300305

301-
Or can set it in the environment variable.
306+
Or can set it from extrernal sources. For example set in the environment variable.
302307

303308
```
304309
export <service name>_URL="<your url>"
@@ -326,7 +331,7 @@ assistant.set_service_url('https://gateway.watsonplatform.net/assistant/api')
326331
response = assistant.list_workspaces(headers={'Custom-Header': 'custom_value'}).get_result()
327332
```
328333

329-
## Parsing HTTP response info
334+
## Parsing HTTP response information
330335
If you would like access to some HTTP response information along with the response model, you can set the `set_detailed_response()` to `True`. Since Python SDK `v2.0`, it is set to `True`
331336
```python
332337
from ibm_watson import AssistantV1

0 commit comments

Comments
 (0)