Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Include cluster creation time in output of cluster list and cluster get #678

Merged
merged 4 commits into from
Nov 2, 2018

Conversation

emlyn
Copy link
Contributor

@emlyn emlyn commented Nov 1, 2018

When listing clusters I find it's useful to have the creation time in order to differentiate between similar clusters (e.g. to shut down the older one), or to make it easier to spot clusters that have been unintentionally left running.

What do you think?

Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

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

Sounds like a good idea.

@@ -50,6 +50,7 @@ def print_cluster(client, cluster: models.Cluster, internal: bool = False):
log.info("------------------------------------------")
log.info("State: %s", cluster.state.value)
log.info("Node Size: %s", cluster.vm_size)
log.info("Created: %s", cluster.pool.creation_time.strftime('%Y-%m-%d %H:%M:%S'))
Copy link
Member

Choose a reason for hiding this comment

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

can you make an helper function for converting the date to string so we only provide the format once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I didn't include the seconds in the table listing to keep the width down, so added a parameter for that, but can remove it if you'd prefer to keep it simple.

@jafreck jafreck merged commit a0bc2f0 into Azure:master Nov 2, 2018
@jafreck
Copy link
Member

jafreck commented Nov 2, 2018

@emlyn Thanks for the contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants