Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 4 tasks
zhichao-aws opened this issue May 25, 2023 · 2 comments · Fixed by #4210
Closed
1 of 4 tasks
Assignees
Labels
2 - In progress Issue/PR: The issue or PR is in progress. Sev2 High-medium priority. Upcoming release or incorrect information. v2.8.0
Milestone

Comments

@zhichao-aws
Copy link
Member

zhichao-aws commented May 25, 2023

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

@vagimeli
Copy link
Contributor

vagimeli commented May 31, 2023

@zhichao-aws I'm the tech writer assigned to this issue. Before getting started with writing, I have some questions:

  1. Where do you think the documentation should be structured? Under this section https://opensearch.org/docs/latest/im-plugin/index/?
  2. Do you have a draft of the developer documentation for this feature? If not, can we sync to discuss/demo?

Thanks!

@zhichao-aws
Copy link
Member Author

Hi @vagimeli , I think it's good to put the document under this section https://opensearch.org/docs/latest/im-plugin/index/.

@hdhalter hdhalter self-assigned this May 31, 2023
@hdhalter hdhalter added 2 - In progress Issue/PR: The issue or PR is in progress. and removed 1 - Backlog Issue: The issue is unassigned or assigned but not started labels May 31, 2023
@vagimeli vagimeli linked a pull request Jun 1, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In progress Issue/PR: The issue or PR is in progress. Sev2 High-medium priority. Upcoming release or incorrect information. v2.8.0
Projects
None yet
4 participants