enroll_node.asciidoc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --
  2. :api: node-enrollment
  3. :request: NodeEnrollmentRequest
  4. :response: NodeEnrollmentResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Enroll Node API
  8. Allows a new node to join an existing cluster with security features enabled.
  9. The purpose of the enroll node API is to allow a new node to join an existing cluster
  10. where security is enabled. The enroll node API response contains all the necessary information
  11. for the joining node to bootstrap discovery and security related settings so that it
  12. can successfully join the cluster.
  13. NOTE: The response contains key and certificate material that allows the
  14. caller to generate valid signed certificates for the HTTP layer of all nodes in the cluster.
  15. include::../execution.asciidoc[]
  16. [id="{upid}-{api}-response"]
  17. ==== Enroll Node Response
  18. The returned +{response}+ allows to retrieve information about the
  19. executed operation as follows:
  20. ["source","java",subs="attributes,callouts,macros"]
  21. --------------------------------------------------
  22. include-tagged::{doc-tests-file}[{api}-response]
  23. --------------------------------------------------
  24. <1> The CA private key that can be used by the new node in order to sign its certificate
  25. for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.
  26. <2> The CA certificate that can be used by the new node in order to sign its certificate
  27. for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.
  28. <3> The private key that the node can use for TLS for its transport layer, as a Base64
  29. encoded string of the ASN.1 DER encoding of the key.
  30. <4> The certificate that the node can use for TLS for its transport layer, as a Base64
  31. encoded string of the ASN.1 DER encoding of the certificate.
  32. <5> The name of the cluster the new node is joining
  33. <6> A list of transport addresses in the form of `host:port` for the nodes that are already
  34. members of the cluster.
  35. [id="{upid}-{api}-execute-async"]
  36. ==== Asynchronous Execution
  37. This request can be executed asynchronously using the `security().enrollNodeAsync()`
  38. method:
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[{api}-execute-async]
  42. --------------------------------------------------
  43. A typical listener for a `NodeEnrollmentResponse` looks like:
  44. ["source","java",subs="attributes,callouts,macros"]
  45. --------------------------------------------------
  46. include-tagged::{doc-tests-file}[{api}-execute-listener]
  47. --------------------------------------------------
  48. <1> Called when the execution is successfully completed. The response is
  49. provided as an argument
  50. <2> Called in case of failure. The raised exception is provided as an argument