|
2 | 2 |
|
3 | 3 | ## All Cloudant SDKs |
4 | 4 |
|
| 5 | +### Cloudant (Gen 2) Compatibility |
| 6 | + |
| 7 | +Cloudant Gen 2 is compatible with IAM authentication only. |
| 8 | +The SDK authentication types `BASIC` and `COUCHDB_SESSION` do not work with Cloudant Gen 2 instances. |
| 9 | + |
| 10 | +Instances of Cloudant Gen 2 do not provide some configuration and monitoring APIs that were available in Gen 1. |
| 11 | + |
| 12 | +Migrating an application using this SDK from Cloudant Gen 1 to Cloudant Gen 2 requires either removing calls to these operations |
| 13 | +or replacing them with alternatives. |
| 14 | + |
| 15 | +This table summarizes the SDK operations that are incompatible with Cloudant Gen 2 instances and the recommended replacement operations. |
| 16 | + |
| 17 | +| Gen 1 operation | Summary | Gen 1 Endpoint | API docs link | Replacement operation for Gen 2 | |
| 18 | +|---|---|---|---|---| |
| 19 | +| **Authentication and authorization** | | | | | |
| 20 | +| `postApiKeys` | Generates API keys for apps or persons to enable database access | `POST /_api/v2/api_keys` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#postapikeys) | Use IAM authentication | |
| 21 | +| `putCloudantSecurityConfiguration` | Modify only Cloudant related database permissions | `PUT /_api/v2/db/{db}/_security` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#putcloudantsecurity) | Use [database level IAM policies](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-managing-access-for-cloudant#database-level-iam-policies) | |
| 22 | +| **Audit events configuration** | | | | | |
| 23 | +`getActivityTrackerEvents` | Retrieve activity tracking events information | `GET /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | |
| 24 | +`postActivityTrackerEvents` | Modify activity tracking events configuration | `POST /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#postactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | |
| 25 | +| **CORS configuration** | | | | | |
| 26 | +| `getCorsInformation` | Retrieve CORS configuration information | `GET /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getcorsinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) |
| 27 | +| `putCorsConfiguration` | Modify CORS configuration | `PUT /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#putcorsconfiguration) | Use the [Platform Services SDK](#using-the-platform-services-sdk) |
| 28 | +| **Capacity configuration** | | | | | |
| 29 | +| `getCapacityDatabasesInformation` | Retrieve maximum allowed database count | `GET /_api/v2/user/capacity/databases` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getcapacitydatabasesinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) |
| 30 | +| `getCapacityThroughputInformation` | Retrieve provisioned throughput capacity information | `GET /_api/v2/user/capacity/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getcapacitythroughputinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) |
| 31 | +| `putCapacityThroughputConfiguration` | Update the target provisioned throughput capacity | `PUT /_api/v2/user/capacity/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#putcapacitythroughputconfiguration) | Use the [Platform Services SDK](#using-the-platform-services-sdk) |
| 32 | +| **Capacity monitoring** | | | | | |
| 33 | +| `getCurrentDatabasesInformation` | Retrieve current database count | `GET /_api/v2/user/current/databases` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getcurrentdatabasesinformation) | Use the length of the list returned from the `getAllDbs` operation. |
| 34 | +| `getCurrentThroughputInformation` | Retrieve the current provisioned throughput capacity consumption | `GET /_api/v2/user/current/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=java#getcurrentthroughputinformation) | Use a Prometheus instant query with IBM Cloud Monitoring APIs. For example to get the capacity consumption rate over the last minute use a query like `rate(ibm_cloudant_permitted_operations_total[1m])`. See the [IBM Cloud Monitoring docs for an example](https://cloud.ibm.com/docs/monitoring?topic=monitoring-metrics_api#metrics-api-sample-prom). |
| 35 | + |
| 36 | +#### Using the Platform Services SDK |
| 37 | + |
| 38 | +Use the [IBM Cloud Platform Services Java SDK](https://github.com/IBM/platform-services-java-sdk) Resource Controller APIs to programmatically configure your Cloudant Gen 2 instance. |
| 39 | + |
| 40 | +Update the configuration values in the `parameters` mapping of key-value pairs. |
| 41 | +Read the current values from the `extensions` mapping of key-value pairs. |
| 42 | + |
| 43 | +| Key path in `parameters` or `extensions` | Value description | |
| 44 | +| --- | --- | |
| 45 | +`dataservices.cloudant.capacity_units` | The provisioned throughput capacity of the instance in [units](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-usage-and-charges#provisioned-throughput-capacity-units) |
| 46 | +`dataservices.cloudant.configuration.cors` | The CORS configuration object of the instance with booleans for `enabled` and `allowCredentials` and a string array of `origins` |
| 47 | +`dataservices.cloudant.configuration.db_count_limit` | Read only value of the maximum number of databases allowed on the instance |
| 48 | + |
| 49 | +##### Viewing configuration |
| 50 | + |
| 51 | +Use [Get a resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#get-resource-instance) to retrieve the resource instance configuration. |
| 52 | + |
| 53 | +##### Modifying configuration |
| 54 | + |
| 55 | +For a new instance use [Create (provision) a new resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#create-resource-instance). |
| 56 | +For a pre-existing instance use [Update a resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#update-resource-instance). |
| 57 | + |
| 58 | + |
5 | 59 | ### Path elements containing the `+` character |
6 | 60 |
|
7 | 61 | Path elements containing the `+` character in the SDKs are not interoperable with: |
|
0 commit comments