CData Python Connector for Cloudant

Build 22.0.8479

接続の確立

コネクタ内で利用可能なオブジェクトは、"cdata.cloudant" モジュールからアクセスできます。モジュールのオブジェクトを直接使用するには、はじめに以下のようにモジュールをインポートする必要があります。

import cdata.cloudant as mod

そこで、コネクタオブジェクトからconnect() メソッドを呼び出すと、以下のような適切な接続文字列を使用して接続を確立できます。

mod.connect("User=abc123; Password=abcdef;")

Authenticating to Cloudant

There are two authentication methods available for connecting to Cloudant: IBM Cloudant Legacy and IBM Cloud IAM.

IBM Cloudant Legacy

Set the User and Password to your service credentials.

To create an IBM Cloudant service credential:

  1. In the IBM Cloud dashboard, go to the Menu icon > Resource List, and open your IBM Cloudant service instance.
  2. In the menu, click Service credentials.
  3. Click New credential and enter a name for the new credential in the Add new credential window.
  4. Click Add. This adds your credentials to the Service credentials table.
  5. Click Actions > View credentials and extract the User and Password from the JSON file.

IBM Cloud IAM

IBM Cloud IAM

To connect with IBM Cloud, you will need the ApiKey and the Url of Cloudant instance ( i.e https://0c9d3837-8304-4aab-a65a-648169970943-bluemix.cloudant.com). After setting InitiateOAuth to GETANDREFRESH (default), you are ready to connect.

When you connect, the 本製品 completes the OAuth process.

  1. Extracts the access token and authenticates requests.
  2. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

After you have created an account in IBM Cloud you should follow the procedure below to retrieve the connection properties:

API Key

To obtain the ApiKey, take the following steps:

  1. Log in to your IBM Cloud account.
  2. Navigate to Platform API Keys page.
  3. On the middle right corner click "Create an IBM Cloud API Key" in order to create a new API Key.
  4. In the pop-up window, specify the API Key name and click "Create". Save the ApiKey somewhere as you can never access it again from the dashboard.

Register a new instance of Cloudant

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:

  1. Log in to your IBM Cloud account.
  2. Navigate to the Cloudant page, choose a name for your instance and click Create. You will be redirected to the instance of Cloudant.

Local Instances

We support Local instances from version 1.1.0 and above.

To authenticate to your local instance:

  1. Url: Set to the Url of your local instance. For example: http://localhost:8006
  2. User: Set to your Username.
  3. Password: Set to your Password.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8479