Connecting to IBM Object Storage
Before You Connect
Register a New Instance of Cloud Object Storage
If you do not already have Cloud Object Storage in your IBM Cloud account, you can follow the procedure below to install an instance of SQL Query in your account:
- Log in to your IBM Cloud account.
- Navigate to the Cloud Object Storage page, choose a name for your instance and click Create. You will be redirected to the instance of Cloud Object Storage you just created.
API Key
To connect with IBM Cloud Object Storage, you will need an ApiKey. You can obtain this as follows:
- Log in to your IBM Cloud account.
- Navigate to the Platform API Keys page.
- On the middle-right corner click Create an IBM Cloud API Key to create a new API Key.
- In the pop-up window, specify the API Key name and click Create. Note the ApiKey as you can never access it again from the dashboard.
Connecting to IBM Cloud Object Storage
Set Region to to your IBM instance region.
Authenticating to IBM Cloud Object Storage
You can authenticate to IBM Cloud Object Storage using either HMAC or OAuth authentication.
HMAC
Set the following properties to authenticate:
- AccessKey: Set this to an IBM Access Key (a username).
- SecretKey: Set this to an IBM Secret Key.
ConnectionType=IBM Object Storage Source;URI=ibmobjectstorage://bucket1/folder1; AccessKey=token1; SecretKey=secret1; Region=eu-gb;
OAuth
Set the following to authenticate using OAuth authentication.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- AuthScheme: Set this to OAuth.
- ApiKey: Set this to the IBM API Key noted during setup.
ConnectionType=IBM Object Storage Source;URI=ibmobjectstorage://bucket1/folder1; ApiKey=key1; Region=eu-gb; AuthScheme=OAuth; InitiateOAuth=GETANDREFRESH;
When you connect, the provider completes the OAuth process.
- Extracts the access token and authenticates requests.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.