1
0

update-connector-api-key-id-api.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. [[update-connector-api-key-id-api]]
  2. === Update connector API key ID API
  3. ++++
  4. <titleabbrev>Update connector API key id</titleabbrev>
  5. ++++
  6. beta::[]
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-connector[Connector APIs].
  11. --
  12. Updates the `api_key_id` and/or `api_key_secret_id` field(s) of a connector, specifying:
  13. . The ID of the API key used for authorization
  14. . The ID of the Connector Secret where the API key is stored
  15. The Connector Secret ID is only required for Elastic managed connectors.
  16. Self-managed connectors do not use this field.
  17. See the documentation for <<es-native-connectors-manage-API-keys-programmatically,programmatically managed connector API keys>> for more details.
  18. To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
  19. [[update-connector-api-key-id-api-request]]
  20. ==== {api-request-title}
  21. `PUT _connector/<connector_id>/_api_key_id`
  22. [[update-connector-api-key-id-api-prereq]]
  23. ==== {api-prereq-title}
  24. * To sync data using self-managed connectors, you need to deploy the <<es-connectors-deploy-connector-service,Elastic connector service>>. on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.
  25. * The `connector_id` parameter should reference an existing connector.
  26. * The `api_key_id` parameter should reference an existing API key.
  27. * The `api_key_secret_id` parameter should reference an existing Connector Secret containing an encoded API key value.
  28. [[update-connector-api-key-id-api-path-params]]
  29. ==== {api-path-parms-title}
  30. `<connector_id>`::
  31. (Required, string)
  32. [role="child_attributes"]
  33. [[update-connector-api-key-id-api-request-body]]
  34. ==== {api-request-body-title}
  35. `api_key_id`::
  36. (Optional, string) ID of the API key that the connector will use to authorize access to required indices. Each connector can be associated with at most one API key.
  37. `api_key_secret_id`::
  38. (Optional, string) ID of the Connector Secret that contains the encoded API key. This should be the same API key as `api_key_id` references. This is only required for Elastic managed connectors.
  39. [[update-connector-api-key-id-api-response-codes]]
  40. ==== {api-response-codes-title}
  41. `200`::
  42. Connector `api_key_id` and/or `api_key_secret_id` field(s) successfully updated.
  43. `400`::
  44. The `connector_id` was not provided or the request payload was malformed.
  45. `404` (Missing resources)::
  46. No connector matching `connector_id` could be found.
  47. [[update-connector-api-key-id-api-example]]
  48. ==== {api-examples-title}
  49. The following example updates the `api_key_id` and `api_key_secret_id` field(s) for the connector with ID `my-connector`:
  50. ////
  51. [source, console]
  52. --------------------------------------------------
  53. PUT _connector/my-connector
  54. {
  55. "index_name": "search-google-drive",
  56. "name": "My Connector",
  57. "service_type": "google_drive"
  58. }
  59. --------------------------------------------------
  60. // TESTSETUP
  61. [source,console]
  62. --------------------------------------------------
  63. DELETE _connector/my-connector
  64. --------------------------------------------------
  65. // TEARDOWN
  66. ////
  67. [source,console]
  68. ----
  69. PUT _connector/my-connector/_api_key_id
  70. {
  71. "api_key_id": "my-api-key-id",
  72. "api_key_secret_id": "my-connector-secret-id"
  73. }
  74. ----
  75. [source,console-result]
  76. ----
  77. {
  78. "result": "updated"
  79. }
  80. ----