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

Add creation timestamp to hostvars #1221

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

Rickmarges
Copy link
Contributor

SUMMARY

This small change will add the timeCreated field from the API to the hostvars as creation_time.
The timeCreated field was introduced in version 2021-11-01 of the API.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

inventory_azure

ADDITIONAL INFORMATION

https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.virtualmachine.timecreated?view=azure-dotnet

Before:
$ ansible-inventory -i azure_dynamic_inventory_azure_rm.yml --host xxxxx | jq -c '.creation_time'
null

After:
$ ansible-inventory -i azure_dynamic_inventory_azure_rm.yml --host xxxxx | jq -c '.creation_time'
"2023-07-21T09:30:30.4710164+00:00"

@Fred-sun Fred-sun added inventory plugin/Inventory/azure_rm.py related issues medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged labels Jul 24, 2023
@xuzhang3 xuzhang3 merged commit b5bcf1d into ansible-collections:dev Jul 24, 2023
@Klaas-
Copy link
Contributor

Klaas- commented Jul 25, 2023

should they maybe be normalized to a time format ansible uses? at the moment they are .net ticks (100ns), and maybe normalize them to iso8601_micro or something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inventory plugin/Inventory/azure_rm.py related issues medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants