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

apiserver: new /actions/reboot endpoint #936

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Jun 2, 2020

Issue number:
N/A

Description of changes:
Adds new API path: /actions/reboot for initiating reboots.

Testing done:
Built images, created AMI, launched instance with said AMI
Was able to reboot the machine from both the control container and admin container with:
apiclient -v -u /actions/reboot -m POST.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@etungsten etungsten requested review from tjkirch and zmrow June 2, 2020 16:01
sources/api/apiserver/src/server/mod.rs Outdated Show resolved Hide resolved
sources/api/openapi.yaml Outdated Show resolved Hide resolved
sources/api/apiserver/src/server/mod.rs Outdated Show resolved Hide resolved
@etungsten
Copy link
Contributor Author

Addresses @tjkirch 's comments.

  • Removed the arbitrary delay.
  • Directly call /sbin/shutdown instead of going through systemd
  • Added more information to the Reboot error.

Tested with multiple instance and I am able to get a reponse status back every time.

@etungsten
Copy link
Contributor Author

Push above renames SystemdRun error to Shutdown.

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔩

Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nits

sources/api/apiserver/src/server/error.rs Outdated Show resolved Hide resolved
sources/api/apiserver/src/server/mod.rs Outdated Show resolved Hide resolved
Adds new API path: `/actions/reboot` for initiating reboots.
@etungsten
Copy link
Contributor Author

Addresses @tjkirch 's comments.

@etungsten etungsten requested a review from tjkirch June 8, 2020 16:19
@etungsten etungsten merged commit 29e207a into bottlerocket-os:develop Jun 8, 2020
@etungsten etungsten deleted the api-reboot branch June 8, 2020 18:42
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.

5 participants