Skip to content

Commit fd8146d

Browse files
committed
switch to softlayer_cos naming instead of classic_cos
1 parent aaa649f commit fd8146d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

python/ibmos2spark/osconfig.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def url(self, container_name, object_name):
170170

171171
class CloudObjectStorage(object):
172172

173-
def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='classic_cos', auth_method='api_key', bucket_name=''):
173+
def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='softlayer_cos', auth_method='api_key', bucket_name=''):
174174

175175
'''
176176
This class allows you to connect to a cloud object storage (COS) instance. It also support connecting to a cos instance
@@ -180,7 +180,7 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
180180
181181
credentials: a dictionary with the required keys to connect to cos. The required keys differ according
182182
to the type of cos.
183-
- for cos type "classic_cos" the following key are required:
183+
- for cos type "softlayer_cos" the following key are required:
184184
* endpoint
185185
* access_key
186186
* secret_key
@@ -197,10 +197,10 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
197197
if a configuration name is not passed the default one will be used "service".
198198
199199
cos_type [optional]: string that identifies the type of cos to connect to. The supported types of cos
200-
are "classic_cos" and "bluemix_cos". "classic_cos" will be chosen as default if no cos_type is passed.
200+
are "softlayer_cos" and "bluemix_cos". "softlayer_cos" will be chosen as default if no cos_type is passed.
201201
202-
auth_method [optional]: string that identifies the type of authorization to use when connecting to cos. This param
203-
is not reqired for classic_cos but only needed for bluemix_cos. Two options can be chosen for this params
202+
auth_method [optional]: string that identifies the type of authorization to use when connecting to cos. This parameter
203+
is not reqired for softlayer_cos but only needed for bluemix_cos. Two options can be chosen for this params
204204
"api_key" or "iam_token". "api_key" will be chosen as default if the value is not set.
205205
206206
bucket_name [optional]: string that identifies the defult
@@ -227,7 +227,7 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
227227
hconf.set(prefix + ".endpoint", credentials['endpoint'])
228228

229229
# softlayer cos case
230-
if (cos_type == "classic_cos"):
230+
if (cos_type == "softlayer_cos"):
231231
hconf.set(prefix + ".access.key", credentials['access_key'])
232232
hconf.set(prefix + ".secret.key", credentials['secret_key'])
233233

@@ -246,7 +246,7 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
246246
hconf.set(prefix + ".v2.signer.type", credentials['v2_signer_type'])
247247

248248
def _validate_input(self, credentials, cos_type, auth_method):
249-
required_key_classic_cos = ["endpoint", "access_key", "secret_key"]
249+
required_key_softlayer_cos = ["endpoint", "access_key", "secret_key"]
250250
required_key_list_iam_api_key = ["endpoint", "api_key", "service_id"]
251251
required_key_list_iam_token = ["endpoint", "iam_token", "service_id"]
252252

@@ -258,10 +258,10 @@ def _get_required_keys(cos_type, auth_method):
258258
return required_key_list_iam_token
259259
else:
260260
raise ValueError("Invalid input: auth_method. auth_method is optional but if set, it should have one of the following values: api_key, iam_token")
261-
elif (cos_type == "classic_cos"):
262-
return required_key_classic_cos
261+
elif (cos_type == "softlayer_cos"):
262+
return required_key_softlayer_cos
263263
else:
264-
raise ValueError("Invalid input: cos_type. cos_type is optional but if set, it should have one of the following values: classic_cos, bluemix_cos")
264+
raise ValueError("Invalid input: cos_type. cos_type is optional but if set, it should have one of the following values: softlayer_cos, bluemix_cos")
265265

266266
# check keys
267267
required_key_list = _get_required_keys(cos_type, auth_method)

0 commit comments

Comments
 (0)