How To
Summary
This note applies to Decision Optimization deployments and solutions in Watson Machine Learning.
Before September 29th, 2021, you need to change the way you provide credentials to access data assets.
Objective
{
"id": "solution.json",
"type": "s3",
"connection": {
"endpoint_url": "https://s3.eu-gb.cloud-object-storage.appdomain.cloud",
"access_key_id": "xxxxxx_my_access_key_id_xxxxxxx",
"secret_access_key": "xxx_my_secret_access_key_xxxxxx"
},
"location": {
"bucket": "test-lp",
"path": "solution.json"
}
}
Steps

Give your connection a name and save it.
After you reopen the connection, you can get its connection_id from the URL. You will need this id to create the deployment job. The URL looks like:
https://dataplatform.cloud.ibm.com/connections/zxxxx_connection_id_xxxxxx?space_id=xxxxxx_space_id_xxxxxxx&context=cpdaas
This process can be automated in a script, and you can use the API described here to create connections programmatically.
The call should be something like.
POST https://api.dataplatform.cloud.ibm.com/v2/connections/?space_id=xxxxxx_space_id_xxxxxxx
Headers:
>Authorization=[Bearer XXXXX]
>Content-Type=[application/json]
Entity:
{
"name" : "MYNAME",
"datasource_type" : "4bf2dedd-3809-4443-96ec-b7bc5726c07b",
"origin_country" : "us",
"properties" : {
"url" : "https://s3.us-south.objectstorage.softlayer.net",
"access_key" : "xxxxxxxx",
"secret_key" : "yyyyyyyyyyy"
}
You are now ready to modify your deployment job payload to use the newly created connection.
You should modify your payload as shown below.
The connection_id of the connection is used in the connection section. Note that this is much safer than previous mechanism where credentials were inserted here. The information included here is useless without the corresponding hidden apikeys.
The bucket and path property are set (exactly as before) to point to the particular file you want to use in the Cloud Object Storage instance.
{
"id": "solution.json",
"type": "connection_asset",
"connection": {
"href": "/v2/connections/xxxxx_my_connection_id_xxxx?space_id=xxxx_my_space_id_xxxxxxx",
},
"location": {
"bucket": "test-lp",
"file_name": "solution.json"
}
}
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
20 October 2021
UID
ibm16470611