Skip to content

[DOC] Add documentation for api of configuring notifications on Index Management operations #4170

@zhichao-aws

Description

@zhichao-aws

What do you want to do?

  • Request a change to existing documentation
  • Add new documentation
  • Report a technical problem with the documentation
  • Other

Tell us about your request. Provide a summary of the request and all versions that are affected.
Version equals / greater than 2.8 will be affected. In 2.8, admins can configure notifications for some long-runnig Index Management operations #4037 . We introduce some new APIs for this feature and we want to add new documentation to these APIs.

By using these APIs, users create configs to bind notification channels and conditions with the input task id or action. If task id is provided, this config is an ad-hoc config(normally used by front-end) and will be automatically deleted after the task end. The task id can be obtained by setting wait_for_completion parameter as false #3186 . If task id is null, this config will be binded with the action type. It is a global setting and won't be deleted automatically. Every index operation of this type will use this config to send notification, no matter triggerred by front-end, command line API or ISM policy.
Here is the introduction for these APIs:

  • create
// example request
POST /_plugins/_im/lron
{
  "lron_config": {
      "task_id":"dQlcQ0hQS2mwF-AQ7icCMw:12354",
      "action_name":"indices:data/write/reindex",
      "lron_condition": {
        "success": false,
        "failure": true
      },
      "channels":[
          {"id":"channel1"},
          {"id":"channel2"}
      ]
  }
}

// example response
{
  "_id": "LRON:dQlcQ0hQS2mwF-AQ7icCMw:12354",
  "lron_config": {
    "lron_condition": {
      "success": false,
      "failure": true
    },
    "task_id": "dQlcQ0hQS2mwF-AQ7icCMw:12354",
    "action_name": "indices:data/write/reindex",
    "channels": [
      {
        "id": "channel1"
      },
      {
        "id": "channel2"
      }
    ]
  }
}

The lron_condition is true, true by default.

  • update
PUT /_plugins/_im/lron/{lronID}
{
   // request body is same with POST
   ...
}
// response is same with POST
  • get
// get one doc
 GET /_plugins/_im/lron/{lronID}
// get all docs
GET /_plugins/_im/lron

//example response
{
  "lron_configs": [
    {
      "_id": "LRON:dQlcQ0hQS2mwF-AQ7icCMw:12354",
      "lron_config": {
           xxxxxxxxx
      }
    },
   {
      "_id": "LRON:dQlcQ0hQS2mwF-AQ7icCMw:12355",
      "lron_config": {
           xxxxxxxxx
      }
    }
  ],
  "total_number": 2
}
  • delete
DELETE /_plugins/_im/lron/{lronID}

# response is same with DeleteResponse in Opensearch core

What other resources are available? Provide links to related issues, POCs, steps for testing, etc.
UX RFC: opensearch-project/index-management-dashboards-plugin#687
API: opensearch-project/index-management#700
The PR of the whole feature in documentation-website: #4037

Metadata

Metadata

Labels

In progressIssue/PR: The issue or PR is in progress.v2.8.0

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions