Skip to content

Corrected the doc in python the python package for how to use it with… #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
.DS_Store
.Rproj.user
.Rhistory
Expand Down
10 changes: 6 additions & 4 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ credentials = {
'service_id': 'XXX'
}

# This name could be arbitrary
configuration_name = 'os_bluemix_cos_config'

cos = ibmos2spark.CloudObjectStorage(sc, credentials,
Expand All @@ -89,7 +90,7 @@ data = sc.textFile(data_url)

##### IAM Token Authentication

Alternatively, you can connect to an IBM Bluemix COS using IAM token. Set the `auth_method` to `iam_token` and
Alternatively, you can connect to an IBM Bluemix COS using IAM token. Set the `auth_method` to `api_key` and
provide the appropriate values in the credentials.


Expand All @@ -98,15 +99,16 @@ import ibmos2spark

credentials = {
'endpoint': 'XXX',
'iam_token': 'eyJraWQXXXX .... X',
'service_id': 'XXX'
'api_key': 'eyJraWQXXXX .... X',
'service_id': 'crn:v1:bluemix:public:cloud-object-storage:global:a/XXX'
}

# This name could be arbitrary
configuration_name = 'os_bluemix_cos_config'
cos = ibmos2spark.CloudObjectStorage(sc, credentials,
configuration_name=configuration_name,
cos_type='bluemix_cos',
auth_method='iam_token')
auth_method='api_key')

# The `sc` object is your SparkContext object
# The `cos` object will provide the URL for SparkContext to retrieve your data
Expand Down