@@ -25,6 +25,7 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
2525 * [ Changes for v2.0] ( #changes-for-v20 )
2626 * [ Migration] ( #migration )
2727 * [ Configuring the http client] ( #configuring-the-http-client-supported-from-v110 )
28+ * [ Disable SSL certificate verification] ( #disable-ssl-certificate-verification )
2829 * [ Sending request headers] ( #sending-request-headers )
2930 * [ Parsing HTTP response info] ( #parsing-http-response-info )
3031 * [ Dependencies] ( #dependencies )
@@ -106,40 +107,42 @@ You supply either an IAM service **API key** or an **access token**:
106107
107108``` python
108109# In the constructor, letting the SDK manage the IAM token
109- discovery = DiscoveryV1(version = ' 2017-10-16' ,
110+ discovery = DiscoveryV1(version = ' 2018-08-01' ,
111+ url = ' <url_as_per_region>' ,
110112 iam_apikey = ' <iam_apikey>' ,
111113 iam_url = ' <iam_url>' ) # optional - the default value is https://iam.bluemix.net/identity/token
112114```
113115
114116``` python
115117# after instantiation, letting the SDK manage the IAM token
116- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
118+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
117119discovery.set_iam_apikey(' <iam_apikey>' )
118120```
119121
120122#### Supplying the access token
121123``` python
122124# in the constructor, assuming control of managing IAM token
123- discovery = DiscoveryV1(version = ' 2017-10-16' ,
125+ discovery = DiscoveryV1(version = ' 2018-08-01' ,
126+ url = ' <url_as_per_region>' ,
124127 iam_access_token = ' <iam_access_token>' )
125128```
126129
127130``` python
128131# after instantiation, assuming control of managing IAM token
129- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
132+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
130133discovery.set_iam_access_token(' <access_token>' )
131134```
132135
133136### Username and password
134137``` python
135138from watson_developer_cloud import DiscoveryV1
136139# In the constructor
137- discovery = DiscoveryV1(version = ' 2017-10-16 ' , username = ' <username>' , password = ' <password>' )
140+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' , username = ' <username>' , password = ' <password>' )
138141```
139142
140143``` python
141144# After instantiation
142- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
145+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
143146discovery.set_username_and_password(' <username>' , ' <password>' )
144147```
145148
@@ -150,12 +153,12 @@ discovery.set_username_and_password('<username>', '<password>')
150153``` python
151154from watson_developer_cloud import VisualRecognitionV3
152155# In the constructor
153- visual_recognition = VisualRecognitionV3(version = ' 2018-05-22 ' , api_key = ' <api_key>' )
156+ visual_recognition = VisualRecognitionV3(version = ' 2018-03-19 ' , url = ' <url_as_per_region> ' , api_key = ' <api_key>' )
154157```
155158
156159``` python
157160# After instantiation
158- visual_recognition = VisualRecognitionV3(version = ' 2018-05-22 ' )
161+ visual_recognition = VisualRecognitionV3(version = ' 2018-03-19 ' )
159162visual_recognition.set_api_key(' <api_key>' )
160163```
161164
@@ -174,7 +177,8 @@ from watson_developer_cloud import AssistantV1
174177assistant = AssistantV1(
175178 username = ' xxx' ,
176179 password = ' yyy' ,
177- version = ' 2017-04-21' )
180+ url = ' <url_as_per_region>' ,
181+ version = ' 2018-07-10' )
178182
179183response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' })
180184print (response.get_result())
@@ -195,14 +199,22 @@ from watson_developer_cloud import AssistantV1
195199assistant = AssistantV1(
196200 username = ' xxx' ,
197201 password = ' yyy' ,
198- version = ' 2017-04-21' )
202+ url = ' <url_as_per_region>' ,
203+ version = ' 2018-07-10' )
199204
200205assistant.set_http_config({' timeout' : 100 })
201206response = assistant.message(workspace_id = workspace_id, input = {
202207 ' text' : ' What\' s the weather like?' }).get_result()
203208print (json.dumps(response, indent = 2 ))
204209```
205210
211+ ## Disable SSL certificate verification
212+ For ICP(IBM Cloud Private), you can disable the SSL certificate verification by:
213+
214+ ``` python
215+ service.disable_SSL_verification()
216+ ```
217+
206218## Sending request headers
207219Custom headers can be passed in any request in the form of a ` dict ` as:
208220``` python
@@ -218,7 +230,8 @@ from watson_developer_cloud import AssistantV1
218230assistant = AssistantV1(
219231 username = ' xxx' ,
220232 password = ' yyy' ,
221- version = ' 2017-04-21' )
233+ url = ' <url_as_per_region>' ,
234+ version = ' 2018-07-10' )
222235
223236response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' }).get_result()
224237```
@@ -231,7 +244,8 @@ from watson_developer_cloud import AssistantV1
231244assistant = AssistantV1(
232245 username = ' xxx' ,
233246 password = ' yyy' ,
234- version = ' 2017-04-21' )
247+ url = ' <url_as_per_region>' ,
248+ version = ' 2018-07-10' )
235249
236250assistant.set_detailed_response(True )
237251response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' }).get_result()
0 commit comments