Cloud SQL Query (beta)

Beta

Cloud SQL Query (beta)

+ Day(s) remaining in the trial

Overview

IBM Cloud SQL Query is a cloud-native service that lets you use ANSI SQL to analyze rectangular data stored in IBM Cloud Object Storage. It is hosted on IBM Cloud and includes a publicly accessible REST API.

Getting started

Authentication

# Creating an IAM bearer token Before you can call a Cloud SQL Query API you must first create an [IAM](https://console.bluemix.net/docs/iam/index.html#iamoverview) bearer token. Each token is valid only for one hour, and after a token expires you must create a new one if you want to continue using the API. The recommended method to retrieve a token programmatically is to create an API key for your IBM Cloud identity and then use the IAM token API to exchange that key for a token. You can create a token in IBM Cloud or by using the IBM Cloud command line interface (CLI). To create a token in IBM Cloud: 1. Sign in to [IBM Cloud](https://console.bluemix.net) and select **Manage > Security > Platform API Keys**. 1. Create an API key for your own personal identity, copy the key value, and save it in a secure place. After you leave the page, you will no longer be able to access this value. 1. With your API key, set up Postman or another REST API tool and run the following command: ``` curl "https://iam.ng.bluemix.net/identity/token" \ -d "apikey=your-saved-value&grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Authorization: Basic Yng6Yng="``` This returns something like: ``` { "access_token": "eyJraWQiOiIyMDE3MDgwOS0wMDowMDowMCIsImFsZyI6...", "refresh_token": "zmRTQFKhASUdF76Av6IUzi9dtB7ip8F2XV5fNgoRQ0mbQgD5XCeWkQhjlJ1dZi8K...", "token_type": "Bearer", "expires_in": 3600, "expiration": 1505865282 } ``` 1. Use the value of the `access_token` property for your Cloud SQL Query API calls. Set the `access_token` value as the authorization header parameter for requests to the Watson Data Platform APIs. The format is `Authorization: Bearer `. For example: ```Authorization: Bearer eyJraWQiOiIyMDE3MDgwOS0wMDowMDowMCIsImFsZyI6IlJTMjU2In0... ``` To create a token by using the IBM Cloud CLI: 1. Follow the steps to install the CLI, log in to IBM Cloud, and get the token described [here](https://console.bluemix.net/docs/services/cloud-monitoring/security/auth_iam.html#auth_iam). Remove `Bearer` from the returned IAM token value in your API calls.

Security

Keys

Pick a key to use with this API. Make sure you are logged in with your IBM id for your keys to be populated in the dropdown below. By selecting a key, it will be pre-filled for each endpoint in the Documentation section that can be used with the built-in testing. If you want to change which key to use for a particular endpoint, you can do so at the endpoint in the Documentation section.
You can manage your API keys in the <MyAPIs> section. API keys authenticate you to your subscription, so make sure to keep them secret. Do not share the X-IBM-Client-Secret portion of any API key in publicly accessible places such as GitHub, or client-side code.



Manage your keys
 

Documentation

Cloud SQL Query (beta):

Loading content...