Skip to content

Azure Metadata Service: Scheduled Events for Virtual Machines

License

Notifications You must be signed in to change notification settings

isabella232/vm-scheduled-events

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project

A sample nodejs service subscribing to Azure Scheduled Events.

Docs articles:

Getting Started

Install nodejs and then run the below commands from the node/ directory in this sample.

Install

$ npm install

Build

$ npm run build

Run

$ npm run start

Example log output:

[INF] (UTC 2021-07-22 04:34:12) Service started.
[INF] (UTC 2021-07-22 04:35:12) Found new document:
{
    "DocumentIncarnation": 1,
    "Events": []
}
[INF] (UTC 2021-07-22 04:36:08) Found new document:
{
    "DocumentIncarnation": 2,
    "Events": [
        {
            "EventId": "4CAEA225-A741-474D-A72E-428C86FCD853",
            "EventStatus": "Scheduled",
            "EventType": "Reboot",
            "ResourceType": "VirtualMachine",
            "Resources": [
                "flatcar-vm1"
            ],
            "NotBefore": "Thu, 22 Jul 2021 04:50:17 GMT",
            "Description": "",
            "EventSource": "User",
            "DurationInSeconds": -1
        }
    ]
}
[INF] (UTC 2021-07-22 04:36:08) Accepting event 4CAEA225-A741-474D-A72E-428C86FCD853.
[INF] (UTC 2021-07-22 04:36:08) Handled event 4CAEA225-A741-474D-A72E-428C86FCD853.
[INF] (UTC 2021-07-22 04:36:08) Acknowledged event 4CAEA225-A741-474D-A72E-428C86FCD853:
[INF] (UTC 2021-07-22 04:37:09) Found new document:
{
    "DocumentIncarnation": 4,
    "Events": []
}
[INF] (UTC 2021-07-22 04:37:09) Clearing handled events cache:
[
    "4CAEA225-A741-474D-A72E-428C86FCD853"
]

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

Azure Metadata Service: Scheduled Events for Virtual Machines

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%