Skip to content

Commit

Permalink
Merge pull request Azure#5 from deathly809/mgazs2
Browse files Browse the repository at this point in the history
Update admin - add powershell tests
  • Loading branch information
deathly809 committed Mar 15, 2018
2 parents 8001769 + aa7941c commit 70746dd
Show file tree
Hide file tree
Showing 12 changed files with 1,276 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ function Get-AzsDirectoryTenant
[System.String]
$ResourceId,

[Parameter(Mandatory = $true, ParameterSetName = 'ResourceId_DirectoryTenants_Get')]
[Parameter(Mandatory = $true, ParameterSetName = 'DirectoryTenants_List')]
[Parameter(Mandatory = $true, ParameterSetName = 'DirectoryTenants_Get')]
[Parameter(Mandatory = $false, ParameterSetName = 'DirectoryTenants_List')]
[Parameter(Mandatory = $false, ParameterSetName = 'DirectoryTenants_Get')]
[System.String]
$ResourceGroupName,

Expand Down Expand Up @@ -97,6 +96,11 @@ function Get-AzsDirectoryTenant

$Tenant = $Name

if (-not $PSBoundParameters.ContainsKey('ResourceGroupName'))
{
$ResourceGroupName = "System." + (Get-AzureRMLocation).Location
$PSBoundParameters.Add("ResourceGroupName", $ResourceGroupName)
}

if('ResourceId_DirectoryTenants_Get' -eq $PsCmdlet.ParameterSetName) {
$GetArmResourceIdParameterValue_params = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="SessionRecords\UpdateAdminClient\TestGetUpdate.json" />
<None Include="SessionRecords\UpdateAdminClient\TestGetUpdateLocation.json" />
<None Include="SessionRecords\UpdateAdminClient\TestGetUpdateRun.json" />
<None Include="SessionRecords\UpdateAdminClient\TestListUpdateLocations.json" />
<None Include="SessionRecords\UpdateAdminClient\TestListUpdateRuns.json" />
<None Include="SessionRecords\UpdateAdminClient\TestListUpdates.json" />
<None Include="src\*.ps1" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/?api-version=2016-05-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjNkNjZmZDEtNDc0My00MmZmLWIzOTEtZTI5ZGM1MWQ3OTllL3Jlc291cmNlZ3JvdXBzL1N5c3RlbS5SZWRtb25kL3Byb3ZpZGVycy9NaWNyb3NvZnQuVXBkYXRlLkFkbWluL3VwZGF0ZUxvY2F0aW9ucy8/YXBpLXZlcnNpb249MjAxNi0wNS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"a0eac0bd-f7e7-4e86-bdec-29ff567ed958"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.26011.01",
"Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient/0.1.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourceGroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond\",\r\n \"name\": \"redmond\",\r\n \"type\": \"Microsoft.Update.Admin/updateLocations\",\r\n \"location\": \"redmond\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"currentVersion\": \"1.0.180302.1\",\r\n \"currentOemVersion\": \"1.0.1709.3\",\r\n \"lastUpdated\": \"2018-03-03T08:09:12.8824552Z\",\r\n \"state\": \"AppliedSuccessfully\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"410"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 05 Mar 2018 19:46:39 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0"
],
"WWW-Authenticate": [
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvkyV6m4/bE0NkpUw+8igWjWdtuz9Cz5tCdxdU8rGRBpNBjOgmyJgeAhDeAEa0b+dc6wnvIxKHFBfpZvAJMlPWDE4UxHOlEv6AAAitYbg5tI2RPCd0eUQntiqS+1OAjEK1gF4uh73ehgeANxl0SLw2"
],
"x-ms-correlation-request-id": [
"911691ac-911d-4b0c-91e4-2bd776493399"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"12861"
],
"x-ms-request-id": [
"911691ac-911d-4b0c-91e4-2bd776493399"
],
"x-ms-routing-request-id": [
"REDMOND:20180305T194639Z:911691ac-911d-4b0c-91e4-2bd776493399"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"X-Content-Type-Options": [
"nosniff"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond/updates?api-version=2016-05-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjNkNjZmZDEtNDc0My00MmZmLWIzOTEtZTI5ZGM1MWQ3OTllL3Jlc291cmNlZ3JvdXBzL1N5c3RlbS5SZWRtb25kL3Byb3ZpZGVycy9NaWNyb3NvZnQuVXBkYXRlLkFkbWluL3VwZGF0ZUxvY2F0aW9ucy9yZWRtb25kL3VwZGF0ZXM/YXBpLXZlcnNpb249MjAxNi0wNS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"815ca6e9-e686-4515-b31e-95175b2940a0"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.26011.01",
"Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient/0.1.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourceGroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond/updates/Microsoft1.0.180302.1\",\r\n \"name\": \"Microsoft1.0.180302.1\",\r\n \"type\": \"Microsoft.Update.Admin/updateLocations/updates\",\r\n \"location\": \"redmond\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"dateAvailable\": \"0001-01-01T00:00:00\",\r\n \"installedDate\": \"2018-03-03T08:09:12.8824552Z\",\r\n \"description\": \"MAS Update 1.0.180302.1\",\r\n \"state\": \"Installed\",\r\n \"kbLink\": \"https://aka.ms/azurestackupdate\",\r\n \"minVersionRequired\": \"1.0.180103.2\",\r\n \"packagePath\": \"\\\\\\\\SU1FileServer\\\\SU1_Infrastructure_2\\\\Updates\\\\Packages\\\\Microsoft1.0.180302.1\",\r\n \"packageSizeInMb\": 2144,\r\n \"updateName\": \"MAS - 1.0.180302.1\",\r\n \"version\": \"1.0.180302.1\",\r\n \"updateOemFile\": \"\",\r\n \"publisher\": \"Microsoft\",\r\n \"packageType\": \"Microsoft\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"795"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 05 Mar 2018 19:46:39 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0"
],
"WWW-Authenticate": [
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvl1bC7HKHgSr0ceqOL7pbkHXXGUrgtrDg/bw8uRQ4ukEyF73DBdYST0PElWbedqwWIK2pzN0RsMmh3319xL9SyxMy4RVVHyIv7hsNlv6k16BoCPAoOQamIDrbzI2hn7yq48v+A6uATLhqxwa7Ck9+"
],
"x-ms-correlation-request-id": [
"ac1de53e-133a-4668-86b8-12cc5fa7430e"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"12860"
],
"x-ms-request-id": [
"ac1de53e-133a-4668-86b8-12cc5fa7430e"
],
"x-ms-routing-request-id": [
"REDMOND:20180305T194640Z:ac1de53e-133a-4668-86b8-12cc5fa7430e"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"X-Content-Type-Options": [
"nosniff"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond/updates/Microsoft1.0.180302.1?api-version=2016-05-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjNkNjZmZDEtNDc0My00MmZmLWIzOTEtZTI5ZGM1MWQ3OTllL3Jlc291cmNlZ3JvdXBzL1N5c3RlbS5SZWRtb25kL3Byb3ZpZGVycy9NaWNyb3NvZnQuVXBkYXRlLkFkbWluL3VwZGF0ZUxvY2F0aW9ucy9yZWRtb25kL3VwZGF0ZXMvTWljcm9zb2Z0MS4wLjE4MDMwMi4xP2FwaS12ZXJzaW9uPTIwMTYtMDUtMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"2817a7c5-cec5-4e19-b2bd-34fb8c6d7721"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.26011.01",
"Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient/0.1.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond/updates/Microsoft1.0.180302.1\",\r\n \"name\": \"Microsoft1.0.180302.1\",\r\n \"type\": \"Microsoft.Update.Admin/updateLocations/updates\",\r\n \"location\": \"redmond\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"dateAvailable\": \"0001-01-01T00:00:00\",\r\n \"installedDate\": \"2018-03-03T08:09:12.8824552Z\",\r\n \"description\": \"MAS Update 1.0.180302.1\",\r\n \"state\": \"Installed\",\r\n \"kbLink\": \"https://aka.ms/azurestackupdate\",\r\n \"minVersionRequired\": \"1.0.180103.2\",\r\n \"packagePath\": \"\\\\\\\\SU1FileServer\\\\SU1_Infrastructure_2\\\\Updates\\\\Packages\\\\Microsoft1.0.180302.1\",\r\n \"packageSizeInMb\": 2144,\r\n \"updateName\": \"MAS - 1.0.180302.1\",\r\n \"version\": \"1.0.180302.1\",\r\n \"updateOemFile\": \"\",\r\n \"publisher\": \"Microsoft\",\r\n \"packageType\": \"Microsoft\"\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"783"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 05 Mar 2018 19:46:50 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0"
],
"WWW-Authenticate": [
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRveq7kXAR2JWP3tqQ6XbamnsHlf/HigJyQmzY6IJ/zERf/lo849mlGd40qJ7l1UTB8vxOWJQRMzFSp/cf0ckkYUvLFMA/yq3Qsn/f8Su2v6VGMVjnVxzt0B596UMfWFjaQtX6em3YxjoqnQQXnMN1/"
],
"x-ms-correlation-request-id": [
"deccf1c3-684a-4e09-a1c5-bb24c7454ff8"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"12859"
],
"x-ms-request-id": [
"deccf1c3-684a-4e09-a1c5-bb24c7454ff8"
],
"x-ms-routing-request-id": [
"REDMOND:20180305T194650Z:deccf1c3-684a-4e09-a1c5-bb24c7454ff8"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"X-Content-Type-Options": [
"nosniff"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "23d66fd1-4743-42ff-b391-e29dc51d799e"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/?api-version=2016-05-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjNkNjZmZDEtNDc0My00MmZmLWIzOTEtZTI5ZGM1MWQ3OTllL3Jlc291cmNlZ3JvdXBzL1N5c3RlbS5SZWRtb25kL3Byb3ZpZGVycy9NaWNyb3NvZnQuVXBkYXRlLkFkbWluL3VwZGF0ZUxvY2F0aW9ucy8/YXBpLXZlcnNpb249MjAxNi0wNS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"5434b094-951e-4d21-9c63-594914625d9e"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.26011.01",
"Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient/0.1.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourceGroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond\",\r\n \"name\": \"redmond\",\r\n \"type\": \"Microsoft.Update.Admin/updateLocations\",\r\n \"location\": \"redmond\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"currentVersion\": \"1.0.180302.1\",\r\n \"currentOemVersion\": \"1.0.1709.3\",\r\n \"lastUpdated\": \"2018-03-03T08:09:12.8824552Z\",\r\n \"state\": \"AppliedSuccessfully\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"410"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 05 Mar 2018 19:49:41 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0"
],
"WWW-Authenticate": [
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvF6whX5Lt94p0C4QueGeMCIfBGF6cfecGCN4fiDCJZ7x7ttz3EJSgG0IDVXKXL2/5id7HkJuVxB6qfXf1jh3ECVW96Q36PhwMHOXkWuLDIddflrQ2C1AmHZl2EZ18CiGVt3F4Yvz0hJwhg+8pFD5E"
],
"x-ms-correlation-request-id": [
"caa79df2-5de5-473d-863c-23378b95661f"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"12843"
],
"x-ms-request-id": [
"caa79df2-5de5-473d-863c-23378b95661f"
],
"x-ms-routing-request-id": [
"REDMOND:20180305T194941Z:caa79df2-5de5-473d-863c-23378b95661f"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"X-Content-Type-Options": [
"nosniff"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond?api-version=2016-05-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjNkNjZmZDEtNDc0My00MmZmLWIzOTEtZTI5ZGM1MWQ3OTllL3Jlc291cmNlZ3JvdXBzL1N5c3RlbS5SZWRtb25kL3Byb3ZpZGVycy9NaWNyb3NvZnQuVXBkYXRlLkFkbWluL3VwZGF0ZUxvY2F0aW9ucy9yZWRtb25kP2FwaS12ZXJzaW9uPTIwMTYtMDUtMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"00ec8ef4-2112-4db6-b99e-ce9fd14fb1fb"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.26011.01",
"Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient/0.1.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/23d66fd1-4743-42ff-b391-e29dc51d799e/resourcegroups/System.Redmond/providers/Microsoft.Update.Admin/updateLocations/redmond\",\r\n \"name\": \"redmond\",\r\n \"type\": \"Microsoft.Update.Admin/updateLocations\",\r\n \"location\": \"redmond\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"currentVersion\": \"1.0.180302.1\",\r\n \"currentOemVersion\": \"1.0.1709.3\",\r\n \"lastUpdated\": \"2018-03-03T08:09:12.8824552Z\",\r\n \"state\": \"AppliedSuccessfully\"\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"398"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 05 Mar 2018 19:49:41 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0"
],
"WWW-Authenticate": [
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRv6KqwObp1KeZ+qXNeJRPjQ9g+YU2Ur8YoBIhzQpGZ4Kd7b6Z67aP3tfKp12Nb3kRGAX98u7apx1xlGvHhHk+1aaDqFKL6N3CP88F22G6xUYAN3JvDgLPmjzW91YVPPaHnkE/+8GSI4MzYX7+sn1Q6"
],
"x-ms-correlation-request-id": [
"6ca3e2ec-cc0c-4378-9058-9b4134d9bbdf"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"12842"
],
"x-ms-request-id": [
"6ca3e2ec-cc0c-4378-9058-9b4134d9bbdf"
],
"x-ms-routing-request-id": [
"REDMOND:20180305T194941Z:6ca3e2ec-cc0c-4378-9058-9b4134d9bbdf"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"X-Content-Type-Options": [
"nosniff"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "23d66fd1-4743-42ff-b391-e29dc51d799e"
}
}
Loading

0 comments on commit 70746dd

Please sign in to comment.