update-connector-pipeline-api.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. [[update-connector-pipeline-api]]
  2. === Update connector pipeline API
  3. ++++
  4. <titleabbrev>Update connector pipeline</titleabbrev>
  5. ++++
  6. beta::[]
  7. Updates the `pipeline` configuration of a connector.
  8. When you create a new connector, the configuration of an <<ingest-pipeline-search-details-generic-reference, ingest pipeline>> is populated with default settings.
  9. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  10. [[update-connector-pipeline-api-request]]
  11. ==== {api-request-title}
  12. `PUT _connector/<connector_id>/_pipeline`
  13. [[update-connector-pipeline-api-prereq]]
  14. ==== {api-prereq-title}
  15. * To sync data using self-managed connectors, you need to deploy the {enterprise-search-ref}/build-connector.html[Elastic connector service] on your own infrastructure. This service runs automatically on Elastic Cloud for native connectors.
  16. * The `connector_id` parameter should reference an existing connector.
  17. [[update-connector-pipeline-api-path-params]]
  18. ==== {api-path-parms-title}
  19. `<connector_id>`::
  20. (Required, string)
  21. [role="child_attributes"]
  22. [[update-connector-pipeline-api-request-body]]
  23. ==== {api-request-body-title}
  24. `pipeline`::
  25. (Required, object) The pipeline configuration of the connector. The pipeline determines how data is processed during ingestion into Elasticsearch.
  26. Pipeline configuration must include the following attributes:
  27. - `extract_binary_content` (Required, boolean) A flag indicating whether to extract binary content during ingestion.
  28. - `name` (Required, string) The name of the ingest pipeline.
  29. - `reduce_whitespace` (Required, boolean) A flag indicating whether to reduce extra whitespace in the ingested content.
  30. - `run_ml_inference` (Required, boolean) A flag indicating whether to run machine learning inference on the ingested content.
  31. [[update-connector-pipeline-api-response-codes]]
  32. ==== {api-response-codes-title}
  33. `200`::
  34. Connector `pipeline` field was successfully updated.
  35. `400`::
  36. The `connector_id` was not provided or the request payload was malformed.
  37. `404` (Missing resources)::
  38. No connector matching `connector_id` could be found.
  39. [[update-connector-pipeline-api-example]]
  40. ==== {api-examples-title}
  41. The following example updates the `pipeline` property for the connector with ID `my-connector`:
  42. ////
  43. [source, console]
  44. --------------------------------------------------
  45. PUT _connector/my-connector
  46. {
  47. "index_name": "search-google-drive",
  48. "name": "My Connector",
  49. "service_type": "google_drive"
  50. }
  51. --------------------------------------------------
  52. // TESTSETUP
  53. [source,console]
  54. --------------------------------------------------
  55. DELETE _connector/my-connector
  56. --------------------------------------------------
  57. // TEARDOWN
  58. ////
  59. [source,console]
  60. ----
  61. PUT _connector/my-connector/_pipeline
  62. {
  63. "pipeline": {
  64. "extract_binary_content": true,
  65. "name": "my-connector-pipeline",
  66. "reduce_whitespace": true,
  67. "run_ml_inference": true
  68. }
  69. }
  70. ----
  71. [source,console-result]
  72. ----
  73. {
  74. "result": "updated"
  75. }
  76. ----