Skip to content

Commit

Permalink
Add terminate profile and scheduled events profile to Microsoft.Compu…
Browse files Browse the repository at this point in the history
…te (#6683)

* Add terminate notification profile and scheduled events profile to the Microosft.Compute
autorest config.

* Correct definition format

* Update specification/compute/resource-manager/Microsoft.Compute/stable/2019-03-01/compute.json

Co-Authored-By: Nick Schonning <nschonni@gmail.com>

* Update specification/compute/resource-manager/Microsoft.Compute/stable/2019-03-01/compute.json

Co-Authored-By: Nick Schonning <nschonni@gmail.com>

* Add ScheduledEventsProfile to the UpdateVMScaleSetVM model, and add instance
view expansion to get VM Scale Set VM.

* Add an example for terminate scheduled events, and add type:object to scheudled events
and termiante profile schemas.

* Add example reference into compute.json

* Fix example file naming.

* Fix terminate scheduled event reference.
  • Loading branch information
szimmer-dev authored and amarzavery committed Aug 1, 2019
1 parent e30b61d commit ab88105
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,9 @@
},
"Create a scale set with ephemeral os disks.": {
"$ref": "./examples/CreateAScaleSetWithDiffOsDisk.json"
},
"Create a scale set with terminate scheduled events enabled.": {
"$ref": "./examples/CreateAScaleSetWithTerminateScheduledEventEnabled.json"
}
}
},
Expand Down Expand Up @@ -4681,6 +4684,20 @@
"type": "string",
"description": "The instance ID of the virtual machine."
},
{
"name": "$expand",
"in": "query",
"required": false,
"type": "string",
"description": "The expand expression to apply on the operation.",
"enum": [
"instanceView"
],
"x-ms-enum": {
"name": "InstanceViewTypes",
"modelAsString": false
}
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
Expand Down Expand Up @@ -8498,6 +8515,10 @@
"name": "VirtualMachineEvictionPolicyTypes",
"modelAsString": true
}
},
"scheduledEventsProfile" : {
"$ref":"#/definitions/ScheduledEventsProfile",
"description": "Specifies Scheduled Event related configurations."
}
},
"description": "Describes a virtual machine scale set virtual machine profile."
Expand Down Expand Up @@ -8527,6 +8548,10 @@
"licenseType": {
"type": "string",
"description": "The license type, which is for bring your own license scenario."
},
"scheduledEventsProfile" : {
"$ref":"#/definitions/ScheduledEventsProfile",
"description": "Specifies Scheduled Event related configurations."
}
},
"description": "Describes a virtual machine scale set virtual machine profile."
Expand Down Expand Up @@ -9241,6 +9266,29 @@
},
"description": "The protection policy of a virtual machine scale set VM."
},
"ScheduledEventsProfile": {
"type": "object",
"properties": {
"terminateNotificationProfile":
{
"$ref":"#/definitions/TerminateNotificationProfile",
"description": "Specifies Terminate Scheduled Event related configurations."
}
}
},
"TerminateNotificationProfile": {
"type": "object",
"properties": {
"notBeforeTimeout": {
"type": "string",
"description" : "Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M)"
},
"enable" : {
"type": "boolean",
"description": "Specifies whether the Terminate Scheduled event is enabled or disabled."
}
}
},
"VirtualMachineHealthStatus": {
"properties": {
"status": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"vmScaleSetName": "{vmss-name}",
"api-version": "2019-03-01",
"parameters": {
"sku": {
"tier": "Standard",
"capacity": 3,
"name": "Standard_D1_v2"
},
"location": "westus",
"properties": {
"overprovision": true,
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"adminPassword": "{your-password}"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
}
}
}
]
}
}
]
},
"scheduledEventsProfile" : {
"terminateNotificationProfile" : {
"enable": true,
"notBeforeTimeout": "PT5M"
}
}
},
"upgradePolicy": {
"mode": "Manual"
}
}
}
},
"responses": {
"200": {
"body": {
"sku": {
"tier": "Standard",
"capacity": 3,
"name": "Standard_D1_v2"
},
"name": "{vmss-name}",
"properties": {
"singlePlacementGroup": true,
"overprovision": true,
"uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"secrets": [],
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
}
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"dnsSettings": {
"dnsServers": []
},
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
},
"privateIPAddressVersion": "IPv4"
}
}
],
"enableAcceleratedNetworking": false
}
}
]
},
"scheduledEventsProfile" : {
"terminateNotificationProfile" : {
"enable": true,
"notBeforeTimeout": "PT5M"
}
}
},
"upgradePolicy": {
"mode": "Manual"
},
"provisioningState": "Creating"
},
"location": "westus",
"type": "Microsoft.Compute/virtualMachineScaleSets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
},
"201": {
"body": {
"sku": {
"tier": "Standard",
"capacity": 3,
"name": "Standard_D1_v2"
},
"name": "{vmss-name}",
"properties": {
"singlePlacementGroup": true,
"overprovision": true,
"uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"secrets": [],
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
}
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"dnsSettings": {
"dnsServers": []
},
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
},
"privateIPAddressVersion": "IPv4"
}
}
],
"enableAcceleratedNetworking": false
}
}
]
},
"scheduledEventsProfile" : {
"terminateNotificationProfile" : {
"enable": true,
"notBeforeTimeout": "PT5M"
}
}
},
"upgradePolicy": {
"mode": "Manual"
},
"provisioningState": "Creating"
},
"location": "westus",
"type": "Microsoft.Compute/virtualMachineScaleSets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
}
}
}

0 comments on commit ab88105

Please sign in to comment.