Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: return next_actions data on create #72

Merged
1 commit merged into from
Jan 30, 2023
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 27, 2023

When a server is created, it can return a field next_actions containing actions that will be executed after the server was created. Most commonly, this contains start_server. But for example if we directly pass networks or firewalls, it also contains the actions for adding the server to the network or applying the firewall to the server.

To cleanly start a server and wait for all actions to complete, we need to know these next_actions.

Example from a test run:

# next_actions = 
[
#<Hcloud::Action:0x924 {"id"=>881261022, "command"=>"start_server", "status"=>"running", "progress"=>0,
"started"=>2023-01-27 12:51:55 +0000, "finished"=>nil, "resources"=>[{"id"=>28067295, "type"=>"server"}],
"error"=>nil}>,
#<Hcloud::Action:0x938 {"id"=>881261023, "command"=>"attach_to_network",
"status"=>"running", "progress"=>0, "started"=>2023-01-27 12:51:55 +0000, "finished"=>nil,
"resources"=>[{"id"=>28067295, "type"=>"server"}, {"id"=>2450993, "type"=>"network"}],
"error"=>nil}>
]

@ghost ghost self-assigned this Jan 27, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #72 (4329f3f) into master (170a91a) will decrease coverage by 0.03%.
The diff coverage is 80.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   98.42%   98.40%   -0.03%     
==========================================
  Files         119      119              
  Lines        4266     4269       +3     
==========================================
+ Hits         4199     4201       +2     
- Misses         67       68       +1     
Impacted Files Coverage Δ
lib/hcloud/server_resource.rb 91.66% <0.00%> (-8.34%) ⬇️
spec/hcloud/server_spec.rb 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

When a server is created, it can return a field `next_actions` containing
actions that will be executed after the server was created. Most commonly, this
contains `start_server`. But for example if we directly pass networks or
firewalls, it also contains the actions for adding the server to the network or
applying the firewall to the server.

To cleanly start a server and wait for all actions to complete, we need to know
these `next_actions`.
@ghost ghost force-pushed the server-next-actions branch from 4329f3f to de2cdbd Compare January 27, 2023 13:12
@ghost ghost merged commit b3e3a64 into master Jan 30, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants