Skip to content

Commit 56c318c

Browse files
author
G Adam Cox
authored
Merge pull request #34 from ibm-watson-data-lab/UpdateReadme
Add named args in readme file After discussion with @bassel-zeidan, okay to merge.
2 parents 1daf367 + 998f404 commit 56c318c

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

python/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ credentials = {
4343
}
4444

4545
configuration_name = 'cos_config_string' #you can give any string you like
46-
cos = ibmos2spark.CloudObjectStorage(sc, credentials, configuration_name) #sc is the SparkContext instance.
46+
cos = ibmos2spark.CloudObjectStorage(sc, credentials, configuration_name=configuration_name) #sc is the SparkContext instance.
4747

4848
bucket_name = 'some_bucket_name'
4949
object_name = 'file1'
@@ -64,7 +64,9 @@ credentials = {
6464
}
6565

6666
configuration_name = 'os_bluemix_cos_config'
67-
cos = ibmos2spark.CloudObjectStorage(sc, credentials, configuration_name, 'bluemix_cos')
67+
cos = ibmos2spark.CloudObjectStorage(sc, credentials,
68+
configuration_name=configuration_name,
69+
cos_type='bluemix_cos')
6870

6971
bucket_name = 'bucket_name'
7072
object_name = 'file_name'
@@ -82,7 +84,10 @@ credentials = {
8284
}
8385

8486
configuration_name = 'os_bluemix_cos_config'
85-
cos = ibmos2spark.CloudObjectStorage(sc, credentials, configuration_name, 'bluemix_cos', 'iam_token')
87+
cos = ibmos2spark.CloudObjectStorage(sc, credentials,
88+
configuration_name=configuration_name,
89+
cos_type='bluemix_cos',
90+
auth_method='iam_token')
8691

8792
bucket_name = 'bucket_name'
8893
object_name = 'file_name'

scala/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ var bucketName = "myBucket"
146146
var objectname = "mydata.csv"
147147

148148
var configurationName = "cos_config_name" // you can choose any string you want
149-
var cos = new CloudObjectStorage(sc, credentials, configurationName)
149+
var cos = new CloudObjectStorage(sc, credentials, configurationName=configurationName)
150150
var spark = SparkSession.
151151
builder().
152152
getOrCreate()
@@ -173,7 +173,9 @@ var bucketName = "myBucket"
173173
var objectname = "mydata.csv"
174174

175175
var configurationName = "cos_config_name" // you can choose any string you want
176-
var cos = new CloudObjectStorage(sc, credentials, configurationName, "bluemix_cos")
176+
var cos = new CloudObjectStorage(sc, credentials,
177+
configurationName=configurationName,
178+
cosType="bluemix_cos")
177179
var spark = SparkSession.
178180
builder().
179181
getOrCreate()
@@ -200,7 +202,10 @@ var bucketName = "myBucket"
200202
var objectname = "mydata.csv"
201203

202204
var configurationName = "cos_config_name" // you can choose any string you want
203-
var cos = new CloudObjectStorage(sc, credentials, configurationName, "bluemix_cos", "iam_token")
205+
var cos = new CloudObjectStorage(sc, credentials,
206+
configurationName=configurationName,
207+
cosType="bluemix_cos",
208+
authMethod="iam_token")
204209
var spark = SparkSession.
205210
builder().
206211
getOrCreate()

0 commit comments

Comments
 (0)