Add new endpoint for joining a cluster#61
Add new endpoint for joining a cluster#61mbarnes wants to merge 1 commit intoprojectatomic:masterfrom mbarnes:cluster-join
Conversation
|
🙀 |
|
The idea of using the requesting address makes a lot of sense. Though why not update the current host endpoint instead of creating a new one? |
|
@cgwalters-bot retry |
Captures most of the host PUT handler logic for host creation. Pull request: #61 Approved by: <try>
Endpoint: /api/v0/cluster/{NAME}/join
Accepts a PUT request from the host wishing to join cluster {NAME}.
This is equivalent to:
PUT /api/v0/host/{ADDRESS}
{
cluster: {NAME}
...
}
except the host's {ADDRESS} is derived from the request itself.
This is intended to aid host initialization, since determining one's
own IP address programmatically can be non-trivial.
The PUT response body will include the host's IP address.
Pull request: #61
Approved by: <try>
|
💡 This pull request was already approved, no need to approve it again.
|
|
Messing with the bot a bit here to see what happens 😄 @cgwalters-bot clean |
Maybe I misunderstand what you mean, but the host endpoint URL embeds the host's IP address, which defeats the purpose here. I'm trying to avoid forcing the host to know its own IP address before automatically registering itself to Commissaire. Using the endpoint of the cluster it wants to join seemed the most straight-forward. I'm open to other ideas though. |
|
@mbarnes I see what you mean. Since the What about having a |
|
@cgwalters-bot clean |
|
Hmm...I'd have expected "clean" to work. Let me debug. |
|
Oh although, I bet this needs to be rebased on master so we have the webhook in the PR series. |
|
@ashcrow: I was with you until that last bit:
Wouldn't that impose a new requirement that a host creation request has to come from the host itself? Unless that was always the intention, I think we'd want to keep both ways for the sake of administrators. If you still prefer a |
|
@mbarnes good point. Scratch the last bit. Yeah throw it on |
|
@mbarnes mind rebasing to see if that makes homu happier? |
|
@ashcrow You'll need to re- |
Captures most of the host PUT handler logic for host creation. Pull request: #61 Approved by: ashcrow
Endpoint: /api/v0/cluster/{NAME}/join
Accepts a PUT request from the host wishing to join cluster {NAME}.
This is equivalent to:
PUT /api/v0/host/{ADDRESS}
{
cluster: {NAME}
...
}
except the host's {ADDRESS} is derived from the request itself.
This is intended to aid host initialization, since determining one's
own IP address programmatically can be non-trivial.
The PUT response body will include the host's IP address.
Pull request: #61
Approved by: ashcrow
|
☀️ Test successful - travis |
|
Why was this PR closed? |
|
It was closed because it was merged...sorry I know it's a bit confusing right now. See barosl/homu#139 |
Endpoint: /api/v0/host
Accepts a PUT request from the host wishing to add itself. The host
IP address is inferred from the request itself, but otherwise works
exactly like "PUT /api/v0/host/{ADDRESS}".
This is intended to aid host initialization, since determining one's
own IP address programmatically can be non-trivial.
|
This accidentally got merged to
For the endpoint docs I just added a note to the host creation part. This is kind of a special case so it didn't seem worth a whole new section to me. |
|
@cgwalters-bot try |
|
@ashcrow I think that may currently not do anything because the PR already passed? Ah yes, look at: Since |
|
@cgwalters ah ok. |
|
💡 This pull request was already approved, no need to approve it again. |
Endpoint: /api/v0/host
Accepts a PUT request from the host wishing to add itself. The host
IP address is inferred from the request itself, but otherwise works
exactly like "PUT /api/v0/host/{ADDRESS}".
This is intended to aid host initialization, since determining one's
own IP address programmatically can be non-trivial.
Pull request: #61
Approved by: ashcrow
|
☀️ Test successful - travis |
This was an idea I had to help with the host auto-join feature.
Programmatically determining a host's own IP address to send to the Commissaire server can be non-trivial given the possibility of multiple network devices. And even if you know the right device name, parsing it out from
ip addressorifconfigis still a pain.This helps alleviate the problem by offering a convenient endpoint for hosts to add themselves directly to a cluster.
_Update:_ After further discussion the endpoint was changed to
/api/v0/host.Endpoint:
/api/v0/cluster/{NAME}/joinAccepts a
PUTrequest from the host wishing to join cluster{NAME}.This is equivalent to:
except the host's
{ADDRESS}is derived from the request itself.