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

Implement a basic API client #36

Merged
merged 7 commits into from Mar 25, 2024
Merged

Implement a basic API client #36

merged 7 commits into from Mar 25, 2024

Conversation

barrucadu
Copy link
Owner

thing-doer API client

Usage: apiclient [OPTIONS] <COMMAND>

Commands:
  run           Run a single-container pod, like `podman run`.  Prints the name of the pod to stdout
  apply         Create a resource, if it does not already exist, or patch it, if it does
  list          List matching resources
  get           Get a single resource
  delete        Delete a single resource.  If this is a running pod, it is killed
  aliases       List all DNS aliases from a given source name
  create-alias  Create a DNS alias
  delete-alias  Delete a DNS alias
  gen-name      Generate a random name
  help          Print this message or the help of the given subcommand(s)

Options:
      --apid-url <APID_URL>  Address of the API server [default: http://127.0.0.1/]
  -h, --help                 Print help

This replaces the ad-hoc collection of testing tools with something that more closely matches the API, with a couple of helpers: a run to quickly create a single-container pod without needing to provide json, and an apply to create or patch a resource.

This is modelled off `podman run` as a shorthand to launch a
single-container pod.
The `apiclient` can now do everything that these did (well, it doesn't
have a built-in `pod_spammer`, but that's not very useful any more - and
it could be easily reconstructed as a shell script).
@barrucadu barrucadu merged commit ba072ab into master Mar 25, 2024
3 checks passed
@barrucadu barrucadu deleted the apiclient branch March 25, 2024 22:57
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

1 participant