| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | --:api: node-enrollment:request: NodeEnrollmentRequest:response: NodeEnrollmentResponse--[id="{upid}-{api}"]=== Enroll Node APIAllows a new node to join an existing cluster with security features enabled.The purpose of the enroll node API is to allow a new node to join an existing clusterwhere security is enabled. The enroll node API response contains all the necessary informationfor the joining node to bootstrap discovery and security related settings so that itcan successfully join the cluster.NOTE: The response contains key and certificate material that allows thecaller to generate valid signed certificates for the HTTP layer of all nodes in the cluster.include::../execution.asciidoc[][id="{upid}-{api}-response"]==== Enroll Node ResponseThe returned +{response}+ allows to retrieve information about theexecuted operation as follows:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-response]--------------------------------------------------<1> The CA private key that can be used by the new node in order to sign its certificatefor the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.<2> The CA certificate that can be used by the new node in order to sign its certificatefor the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.<3> The private key that the node can use for  TLS for its transport layer, as a Base64encoded string of the ASN.1 DER encoding of the key.<4> The certificate that the node can use for  TLS for its transport layer, as a Base64encoded string of the ASN.1 DER encoding of the certificate.<5> A list of transport addresses in the form of `host:port` for the nodes that are alreadymembers of the cluster.[id="{upid}-{api}-execute-async"]==== Asynchronous ExecutionThis request can be executed asynchronously using the `security().enrollNodeAsync()`method:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-execute-async]--------------------------------------------------A typical listener for a `NodeEnrollmentResponse` looks like:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-execute-listener]--------------------------------------------------<1> Called when the execution is successfully completed. The response isprovided as an argument<2> Called in case of failure. The raised exception is provided as an argument
 |