IBM / cloudant-java-sdk

Cloudant SDK for Java
Apache License 2.0
22 stars 17 forks source link

com.ibm.cloud.cloudant.v1.model.ActiveTask is missing index-related fields #390

Closed jnhagelberg closed 1 year ago

jnhagelberg commented 1 year ago

When you call GET /_active_tasks, indexing entries look like the following:

{
    "node": "dbcore@db1.bm-cc-us-south-28.cloudant.net",
    "pid": "<0.10773.2388>",
    "process_status": "waiting",
    "changes_done": 119918,
    "database": "shards/00000000-3fffffff/03f2006b-f00d-4659-b3bf-c3768a87ec43-bluemix/ys1_dev_v2_lite_25_assets.1644092133",
    "design_document": "_design/search_hardware_specification_temporary",
    "index": "search_hardware_specification",
    "progress": 87,
    "started_on": 1675825452,
    "total_changes": 137358,
    "type": "search_indexer",
    "updated_on": 1675866514
  },

The following fields are missing from ActiveTask:

mojito317 commented 1 year ago

Hi @jnhagelberg! We are aware of this problem. Meanwhile, you can use a workaround by using a custom OkHttp request and passing it to the SDK client object.

Cloudant client = Cloudant.newInstance("SERVER");
HttpUrl requestUrl =  
  HttpUrl.parse(client.getServiceUrl())
    .newBuilder()
    .addPathSegment("_active_tasks")
    .build();
Request.Builder rb = new Request.Builder().url(requestUrl).get(); // an okhttp3.Request.Builder
client.getAuthenticator().authenticate(rb); // add existing authentication to the custom request
Response response = client.getClient().newCall(rb.build()).execute();
ricellis commented 1 year ago

These were added via https://github.com/IBM/cloudant-java-sdk/pull/402 and will be in the next release.