Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31",
"parameters": {
"properties": {
"logVerbose": false,
"logProgress": true,
"runbookType": "PowerShellWorkflow",
"publishContentLink": {
"uri": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
"contentHash": {
"algorithm": "SHA256",
"value": "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"
}
},
"description": "Description of the Runbook",
"logActivityTrace": 1
},
"name": "Get-AzureVMTutorial",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
}
}
},
"responses": {
"201": {
"headers": {},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
"name": "Get-AzureVMTutorial",
"type": "Microsoft.Automation/AutomationAccounts/Runbooks",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
},
"etag": "\"636263318837230000\"",
"properties": {
"description": "Description of the Runbook",
"logVerbose": false,
"logProgress": true,
"logActivityTrace": 1,
"runbookType": "PowerShellWorkflow",
"parameters": {},
"state": "Published",
"jobCount": 0,
"provisioningState": "Succeeded",
"outputTypes": [],
"creationTime": "2017-03-28T21:04:43.66+00:00",
"lastModifiedBy": "myEmaild@microsoft.com",
"lastModifiedTime": "2017-03-28T21:04:43.723+00:00"
}
}
},
"200": {
"headers": {},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
"name": "Get-AzureVMTutorial",
"type": "Microsoft.Automation/AutomationAccounts/Runbooks",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
},
"etag": "\"636263318866000000\"",
"properties": {
"description": "Description of the Runbook",
"logVerbose": true,
"logProgress": true,
"logActivityTrace": 1,
"runbookType": "PowerShellWorkflow",
"parameters": {},
"state": "Published",
"jobCount": 0,
"provisioningState": "Succeeded",
"outputTypes": [],
"creationTime": "2017-03-28T21:04:43.66+00:00",
"lastModifiedBy": "myEmaild@microsoft.com",
"lastModifiedTime": "2017-03-28T21:04:46.6+00:00"
}
}
},
"400": {
"code": "BadRequest",
"message": "{\"Message\":\"Cannot specify the content link for a published runbook and draft at the same time.\"}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31",
"parameters": {
"properties": {
"logVerbose": false,
"logProgress": false,
"runbookType": "PowerShellWorkflow",
"description": "Description of the Runbook",
"draft": { }
},
"name": "Get-AzureVMTutorial",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
}
}
},
"responses": {
"201": {
"headers": {},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
"name": "Get-AzureVMTutorial",
"type": "Microsoft.Automation/AutomationAccounts/Runbooks",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
},
"etag": "\"636263318837230000\"",
"properties": {
"description": "Description of the Runbook",
"logVerbose": false,
"logProgress": false,
"logActivityTrace": 0,
"runbookType": "Script",
"parameters": {},
"state": "New",
"jobCount": 0,
"provisioningState": "Succeeded",
"creationTime": "2018-02-09T03:25:59.097+00:00",
"lastModifiedTime": "2018-02-09T03:25:59.097+00:00",
"outputTypes": []
}
}
},
"200": {
"headers": {},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
"name": "Get-AzureVMTutorial",
"type": "Microsoft.Automation/AutomationAccounts/Runbooks",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
},
"etag": "\"636263318866000000\"",
"properties": {
"description": "Description of the Runbook",
"logVerbose": false,
"logProgress": false,
"logActivityTrace": 0,
"runbookType": "Script",
"parameters": {},
"state": "New",
"jobCount": 0,
"provisioningState": "Succeeded",
"creationTime": "2018-02-09T03:25:59.097+00:00",
"lastModifiedTime": "2018-02-09T03:25:59.097+00:00"
}
}
},
"400": {
"code": "BadRequest",
"message": "{\"Message\":\"Cannot specify the content link for a published runbook and draft at the same time.\"}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parameters": {
"subscriptionId": "51766542-3ed7-4a72-a187-0c8ab644ddab",
"resourceGroupName": "mygroup",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31",
"parameters": {
"parameters": {
"key01": "value01",
"key02": "value02"
},
"runOn": ""
}
},
"responses": {
"201": {
"headers": {},
"body": {
"creationTime": "2018-02-09T05:51:59.82+00:00",
"status": "New",
"statusDetails": "None",
"startTime": null,
"endTime": null,
"lastModifiedTime": "2018-02-09T05:51:59.82+00:00",
"lastStatusModifiedTime": "2018-02-09T05:51:59.82+00:00",
"exception": null,
"parameters": {},
"runOn": null,
"logActivityTrace": null
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
"name": "Get-AzureVMTutorial",
"type": "Microsoft.Automation/AutomationAccounts/Runbooks",
"location": "East US 2",
"tags": {
"tag01": "value01",
"tag02": "value02"
},
"etag": "\"636263335437500000\"",
"properties": {
"description": "Description of the Runbook",
"logVerbose": false,
"logProgress": true,
"logActivityTrace": 1,
"runbookType": "PowerShellWorkflow",
"parameters": {},
"state": "Published",
"jobCount": 0,
"provisioningState": "Succeeded",
"outputTypes": [],
"creationTime": "2017-03-28T21:32:23.75+00:00",
"lastModifiedBy": "myEmaild@microsoft.com",
"lastModifiedTime": "2017-03-28T21:32:23.75+00:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {
"Content-Type": "text/powershell"
},
"body": "<#\r\n .DESCRIPTION\r\n An example runbook which prints out the first10 Azure VMs in your subscription (ordered alphabetically).\r\n For more information about how this runbook authenticates to your Azure subscription, see our documentation here: http: \/\/aka.ms\/fxu3mn\r\n\r\n .NOTES\r\n AUTHOR: Azure Automation Team\r\n LASTEDIT: Mar27,\r\n 2015\r\n#>\r\nworkflow Get-AzureVMTutorial{\r\n #The name of the Automation Credential Asset this runbook will use to authenticate to Azure.\r\n $CredentialAssetName = 'DefaultAzureCredential'\r\n\r\n #Get the credential with the above name from the Automation Asset store\r\n $Cred = Get-AutomationPSCredential -Name $CredentialAssetName\r\n if(!$Cred){\r\n Throw\"Could not find an Automation Credential Asset named '${CredentialAssetName}'. Make sure you have created one in this Automation Account.\"\r\n }\r\n\r\n #Connect to your Azure Account\r\n $Account = Add-AzureAccount -Credential $Cred\r\n if(!$Account){\r\n Throw\"Could not authenticate to Azure using the credential asset '${CredentialAssetName}'. Make sure the user name and password are correct.\"\r\n }\r\n\r\n #TODO (optional): pick the right subscription to use. Without this line, the default subscription for your Azure Account will be used.\r\n #Select-AzureSubscription -SubscriptionName\"TODO: your Azure subscription name here\"\r\n \r\n #Get all the VMs you have in your Azure subscription\r\n $VMs = Get-AzureVM\r\n\r\n #Print out up to10 of those VMs\r\n if(!$VMs){\r\n Write-Output\"No VMs were found in your subscription.\"\r\n } else{\r\n Write-Output $VMs[0..9\r\n ]\r\n }\r\n }"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"body": {
"creationTime": "2018-02-09T03:25:59.11+00:00",
"lastModifiedTime": "2018-02-09T04:48:56.43+00:00",
"inEdit": true,
"parameters": {},
"outputTypes": []
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {
"Content-Type": "text/powershell"
},
"body": "<#\r\n .DESCRIPTION\r\n An example runbook which prints out the first10 Azure VMs in your subscription (ordered alphabetically).\r\n For more information about how this runbook authenticates to your Azure subscription, see our documentation here: http: \/\/aka.ms\/fxu3mn\r\n\r\n .NOTES\r\n AUTHOR: Azure Automation Team\r\n LASTEDIT: Mar27,\r\n 2015\r\n#>\r\nworkflow Get-AzureVMTutorial{\r\n #The name of the Automation Credential Asset this runbook will use to authenticate to Azure.\r\n $CredentialAssetName = 'DefaultAzureCredential'\r\n\r\n #Get the credential with the above name from the Automation Asset store\r\n $Cred = Get-AutomationPSCredential -Name $CredentialAssetName\r\n if(!$Cred){\r\n Throw\"Could not find an Automation Credential Asset named '${CredentialAssetName}'. Make sure you have created one in this Automation Account.\"\r\n }\r\n\r\n #Connect to your Azure Account\r\n $Account = Add-AzureAccount -Credential $Cred\r\n if(!$Account){\r\n Throw\"Could not authenticate to Azure using the credential asset '${CredentialAssetName}'. Make sure the user name and password are correct.\"\r\n }\r\n\r\n #TODO (optional): pick the right subscription to use. Without this line, the default subscription for your Azure Account will be used.\r\n #Select-AzureSubscription -SubscriptionName\"TODO: your Azure subscription name here\"\r\n \r\n #Get all the VMs you have in your Azure subscription\r\n $VMs = Get-AzureVM\r\n\r\n #Print out up to10 of those VMs\r\n if(!$VMs){\r\n Write-Output\"No VMs were found in your subscription.\"\r\n } else{\r\n Write-Output $VMs[0..9\r\n ]\r\n }\r\n }"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"subscriptionId": "51766542-3ed7-4a72-a187-0c8ab644ddab",
"resourceGroupName": "mygroup",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {},
"body": {
"creationTime": "2018-02-09T05:52:00.9344172+00:00",
"status": "Completed",
"statusDetails": "None",
"startTime": "2018-02-09T05:55:10.8344743+00:00",
"endTime": "2018-02-09T05:55:16.7827254+00:00",
"lastModifiedTime": "2018-02-09T05:55:16.7827254+00:00",
"lastStatusModifiedTime": "2018-02-09T05:55:16.7827254+00:00",
"exception": null,
"parameters": {},
"runOn": null,
"logActivityTrace": null
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"subscriptionId": "51766542-3ed7-4a72-a187-0c8ab644ddab",
"resourceGroupName": "mygroup",
"automationAccountName": "ContoseAutomationAccount",
"runbookName": "Get-AzureVMTutorial",
"jobStreamId": "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourcegroups/mygroup/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/foo/draft/testJob/streams/851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001",
"properties": {
"jobStreamId": "851b2101-686f-40e2-8a4b-5b8df08afbd1:00636535684910693884:00000000000000000001",
"summary": null,
"time": "2018-02-07T02:48:11.0693884+00:00",
"streamType": "Output",
"streamText": "",
"value": {
}
}
}
}
}
}
Loading