@@ -226,24 +226,29 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
226
226
hconf = sparkcontext ._jsc .hadoopConfiguration ()
227
227
hconf .set (prefix + ".endpoint" , credentials ['endpoint' ])
228
228
229
+ # softlayer cos case
229
230
if (cos_type == "classic_cos" ):
230
231
hconf .set (prefix + ".access.key" , credentials ['access_key' ])
231
232
hconf .set (prefix + ".secret.key" , credentials ['secret_key' ])
232
233
234
+ # bluemix cos case
233
235
elif (cos_type == "bluemix_cos" ):
234
236
hconf .set (prefix + ".iam.service.id" , credentials ['service_id' ])
235
237
if (auth_method == "api_key" ):
236
238
hconf .set (prefix + ".iam.api.key" , credentials ['api_key' ])
237
239
elif (auth_method == "iam_token" ):
238
240
hconf .set (prefix + ".iam.token" , credentials ['iam_token' ])
239
241
242
+ if (credentials .get ('iam_service_endpoint' )):
243
+ hconf .set (prefix + ".iam.endpoint" , credentials ['iam_service_endpoint' ])
244
+
240
245
if (credentials .get ('v2_signer_type' )):
241
246
hconf .set (prefix + ".v2.signer.type" , credentials ['v2_signer_type' ])
242
247
243
248
def _validate_input (self , credentials , cos_type , auth_method ):
244
249
required_key_classic_cos = ["endpoint" , "access_key" , "secret_key" ]
245
250
required_key_list_iam_api_key = ["endpoint" , "api_key" , "service_id" ]
246
- required_key_list_iam_token = ["endpoint" , "token " , "service_id" ]
251
+ required_key_list_iam_token = ["endpoint" , "iam_token " , "service_id" ]
247
252
248
253
def _get_required_keys (cos_type , auth_method ):
249
254
if (cos_type == "bluemix_cos" ):
0 commit comments