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

provide simpler --termination-time interface #127

Open
andy-v-h opened this issue Jun 2, 2021 · 4 comments
Open

provide simpler --termination-time interface #127

andy-v-h opened this issue Jun 2, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@andy-v-h
Copy link

andy-v-h commented Jun 2, 2021

What problem are you facing?

Having to do date math is cumbersome in a shell. While there are versions of date that attempt to make it easier to add 2 hours to now, it's not the most automation-friendly when you might have a different version of date. Or one might try a perl one-liner to manipulate a timestamp.

How could the Equinix Metal CLI help solve this problem?

the addition of a --ttl flag that accepts an int64 for seconds would be far easier to build automation around.

@andy-v-h andy-v-h added the enhancement New feature or request label Jun 2, 2021
@displague
Copy link
Member

displague commented Jun 2, 2021

This could benefit from the thinking that went into equinix/docker-machine-driver-metal#59 (comment)

@displague
Copy link
Member

I was flipping through kong docs as I'm considering how we could benefit from a move from kingpin / viper in this project to kong. Kong appears to support Parse and ParseDuration out of the box for timestamp fields.

@colemickens
Copy link

For now some documentation about what format it's even expecting would be good. The params aren't even documented here https://metal.equinix.com/developers/api/devices/ so I can't really tell what I'm doing. Is it a UTC time? Is the CLI going to convert it? etc?

@colemickens
Copy link

Actually, from an old script, seems like I was using something like this (again, may depend on the 'date' you have):

loc="ams1";  plan="c2.large.arm";   os="nixos_19_03"; price="0.5"; duration="6 hour";
termtime="$(TZ=UTC date --date="${duration}" --iso-8601=seconds)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants