Skip to content

Commit

Permalink
Merge pull request Azure#12 from MabOneSdk/dev2
Browse files Browse the repository at this point in the history
Merging MAB bits to ASR
  • Loading branch information
avneeshraiusit committed Dec 18, 2015
2 parents 9433d12 + 9f97509 commit c78bbe5
Show file tree
Hide file tree
Showing 24 changed files with 853 additions and 557 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static RecoveryServicesManagementClient GetRecoveryServicesManagementClie
}

return new RecoveryServicesManagementClient(
"Microsoft.RecoveryServicesBVTD2",
"Microsoft.RecoveryServicesseadev01",
(SubscriptionCloudCredentials)environment.Credentials,
environment.BaseUri).WithHandler(HttpMockServer.CreateInstance());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScenarioTests\RecoveryServicesTestsBase.cs" />
<Compile Include="ScenarioTests\VaultTests.cs" />
<Compile Include="ScenarioTests\VaultUsageTests.cs" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down Expand Up @@ -51,6 +52,9 @@
</None>
<None Include="SessionRecords\RecoveryServices.Tests.VaultTests\RetrieveVault.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\RecoveryServices.Tests.VaultUsageTests\RetrieveVaultUsage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.Azure;
using Microsoft.Azure.Management.RecoveryServices;
using Microsoft.Azure.Management.RecoveryServices.Models;
using Microsoft.Azure.Test;
using System.Net;
using Xunit;

namespace RecoveryServices.Tests
{
public class VaultUsageTests : RecoveryServicesTestsBase
{
string resourceGroupName = "testsitegroup";
string resourceName = "rsv5";

[Fact]
public void RetrieveVaultUsage()
{
using (UndoContext context = UndoContext.Current)
{
context.Start();
var rsmClient = GetRecoveryServicesClient(CustomHttpHandler);
VaultUsageListResponse response = rsmClient.VaultUsage.List(resourceGroupName, resourceName, RequestHeaders);

Assert.NotNull(response.Value);
Assert.NotEqual(response.Value.Count, 0);
foreach (var usage in response.Value)
{
Assert.NotNull(usage.Name.Value);
Assert.NotNull(usage.Name.LocalizedValue);
Assert.NotNull(usage.Unit);
Assert.NotNull(usage.CurrentValue);
Assert.NotNull(usage.Limit);
}
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5/extendedInformation/vaultExtendedInfo?api-version=2015-08-15",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzQlZURDIvdmF1bHRzL3JzdjUvZXh0ZW5kZWRJbmZvcm1hdGlvbi92YXVsdEV4dGVuZGVkSW5mbz9hcGktdmVyc2lvbj0yMDE1LTA4LTE1",
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5/extendedInformation/vaultExtendedInfo?api-version=2015-11-10",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2Vzc2VhZGV2MDEvdmF1bHRzL3JzdjUvZXh0ZW5kZWRJbmZvcm1hdGlvbi92YXVsdEV4dGVuZGVkSW5mbz9hcGktdmVyc2lvbj0yMDE1LTExLTEw",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"properties\": {\r\n \"integrityKey\": \"integrity key\",\r\n \"algorithm\": \"none\"\r\n }\r\n}",
"RequestHeaders": {
Expand All @@ -13,19 +13,19 @@
"91"
],
"x-ms-client-request-id": [
"274f20cc-dbc5-4a3a-b9d9-c5e6a0e50ac8"
"d2e0b599-2610-4659-a064-b4b5de2d22d0"
],
"x-ms-version": [
"2015-01-01"
],
"User-Agent": [
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/5.0.0.0"
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/1.0.0.0"
]
},
"ResponseBody": "{\r\n \"location\": null,\r\n \"name\": \"vaultExtendedInfo\",\r\n \"etag\": \"e2107110-4780-4874-89cf-bfac46eb44f0\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"integrityKey\": \"integrity key\",\r\n \"algorithm\": \"none\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5extendedInformation/vaultExtendedInfo\",\r\n \"type\": \"Microsoft.RecoveryServicesBVTD2/vaults/extendedInformation\",\r\n \"sku\": null\r\n}",
"ResponseBody": "{\r\n \"location\": null,\r\n \"name\": \"vaultExtendedInfo\",\r\n \"etag\": \"ae2444f5-f73f-4652-8d24-079813d44f95\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"integrityKey\": \"integrity key\",\r\n \"algorithm\": \"none\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5extendedInformation/vaultExtendedInfo\",\r\n \"type\": \"Microsoft.RecoveryServicesseadev01/vaults/extendedInformation\",\r\n \"sku\": null\r\n}",
"ResponseHeaders": {
"Content-Length": [
"425"
"431"
],
"Content-Type": [
"application/json"
Expand All @@ -37,10 +37,10 @@
"no-cache"
],
"x-ms-request-id": [
"50050f7b-6576-43a2-a7df-049d75bd4fa7"
"97d3c846-4907-45d5-a7e0-05455fd59fd3"
],
"x-ms-client-request-id": [
"274f20cc-dbc5-4a3a-b9d9-c5e6a0e50ac8"
"d2e0b599-2610-4659-a064-b4b5de2d22d0"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -49,16 +49,16 @@
"1199"
],
"x-ms-correlation-request-id": [
"50050f7b-6576-43a2-a7df-049d75bd4fa7"
"97d3c846-4907-45d5-a7e0-05455fd59fd3"
],
"x-ms-routing-request-id": [
"CENTRALUS:20151117T155530Z:50050f7b-6576-43a2-a7df-049d75bd4fa7"
"CENTRALUS:20151214T055928Z:97d3c846-4907-45d5-a7e0-05455fd59fd3"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Tue, 17 Nov 2015 15:55:30 GMT"
"Mon, 14 Dec 2015 05:59:28 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
Expand All @@ -67,25 +67,25 @@
"StatusCode": 200
},
{
"RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5/extendedInformation/vaultExtendedInfo?api-version=2015-08-15",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzQlZURDIvdmF1bHRzL3JzdjUvZXh0ZW5kZWRJbmZvcm1hdGlvbi92YXVsdEV4dGVuZGVkSW5mbz9hcGktdmVyc2lvbj0yMDE1LTA4LTE1",
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5/extendedInformation/vaultExtendedInfo?api-version=2015-11-10",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2Vzc2VhZGV2MDEvdmF1bHRzL3JzdjUvZXh0ZW5kZWRJbmZvcm1hdGlvbi92YXVsdEV4dGVuZGVkSW5mbz9hcGktdmVyc2lvbj0yMDE1LTExLTEw",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"274f20cc-dbc5-4a3a-b9d9-c5e6a0e50ac8"
"d2e0b599-2610-4659-a064-b4b5de2d22d0"
],
"x-ms-version": [
"2015-01-01"
],
"User-Agent": [
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/5.0.0.0"
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/1.0.0.0"
]
},
"ResponseBody": "{\r\n \"location\": null,\r\n \"name\": \"vaultExtendedInfo\",\r\n \"etag\": \"e2107110-4780-4874-89cf-bfac46eb44f0\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"integrityKey\": \"integrity key\",\r\n \"algorithm\": \"none\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5extendedInformation/vaultExtendedInfo\",\r\n \"type\": \"Microsoft.RecoveryServicesBVTD2/vaults/extendedInformation\",\r\n \"sku\": null\r\n}",
"ResponseBody": "{\r\n \"location\": null,\r\n \"name\": \"vaultExtendedInfo\",\r\n \"etag\": \"ae2444f5-f73f-4652-8d24-079813d44f95\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"integrityKey\": \"integrity key\",\r\n \"algorithm\": \"none\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5extendedInformation/vaultExtendedInfo\",\r\n \"type\": \"Microsoft.RecoveryServicesseadev01/vaults/extendedInformation\",\r\n \"sku\": null\r\n}",
"ResponseHeaders": {
"Content-Length": [
"425"
"431"
],
"Content-Type": [
"application/json"
Expand All @@ -97,10 +97,10 @@
"no-cache"
],
"x-ms-request-id": [
"c682bfee-47c7-422d-9b94-6c4d5e5c2394"
"6fc0bfed-f82e-4a65-8790-dff008d476a3"
],
"x-ms-client-request-id": [
"274f20cc-dbc5-4a3a-b9d9-c5e6a0e50ac8"
"d2e0b599-2610-4659-a064-b4b5de2d22d0"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -109,16 +109,16 @@
"14999"
],
"x-ms-correlation-request-id": [
"c682bfee-47c7-422d-9b94-6c4d5e5c2394"
"6fc0bfed-f82e-4a65-8790-dff008d476a3"
],
"x-ms-routing-request-id": [
"CENTRALUS:20151117T155531Z:c682bfee-47c7-422d-9b94-6c4d5e5c2394"
"CENTRALUS:20151214T055930Z:6fc0bfed-f82e-4a65-8790-dff008d476a3"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Tue, 17 Nov 2015 15:55:31 GMT"
"Mon, 14 Dec 2015 05:59:29 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
Expand All @@ -129,6 +129,6 @@
],
"Names": {},
"Variables": {
"SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499"
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5?api-version=2015-08-15",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzQlZURDIvdmF1bHRzL3JzdjU/YXBpLXZlcnNpb249MjAxNS0wOC0xNQ==",
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5?api-version=2015-11-10",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2Vzc2VhZGV2MDEvdmF1bHRzL3JzdjU/YXBpLXZlcnNpb249MjAxNS0xMS0xMA==",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"properties\": {}\r\n}",
"RequestHeaders": {
Expand All @@ -19,13 +19,13 @@
"2015-01-01"
],
"User-Agent": [
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/5.0.0.0"
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/1.0.0.0"
]
},
"ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"rsv5\",\r\n \"etag\": \"1d4e37cd-5ff3-47c6-a68e-55436cfd3e0e\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5\",\r\n \"type\": \"Microsoft.RecoveryServicesBVTD2/vaults\",\r\n \"sku\": {\r\n \"name\": \"standard\",\r\n \"tier\": null,\r\n \"size\": null,\r\n \"family\": null,\r\n \"capacity\": null\r\n }\r\n}",
"ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"rsv5\",\r\n \"etag\": \"1acb266c-37d9-4420-97d4-a03abc324d55\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5\",\r\n \"type\": \"Microsoft.RecoveryServicesseadev01/vaults\",\r\n \"sku\": {\r\n \"name\": \"standard\",\r\n \"tier\": null,\r\n \"size\": null,\r\n \"family\": null,\r\n \"capacity\": null\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"410"
"416"
],
"Content-Type": [
"application/json"
Expand All @@ -37,10 +37,10 @@
"no-cache"
],
"x-ms-request-id": [
"7f222829-875a-4ee7-91c1-f1b8f2ab3a49"
"69486eb6-1c50-4630-a84c-d927654c28b4"
],
"x-ms-client-request-id": [
"b97cbf61-0a3e-45ba-a3ee-ca33dee4fa77"
"b515f137-e2a2-47ba-9d22-83172217788b"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -49,16 +49,16 @@
"1199"
],
"x-ms-correlation-request-id": [
"7f222829-875a-4ee7-91c1-f1b8f2ab3a49"
"69486eb6-1c50-4630-a84c-d927654c28b4"
],
"x-ms-routing-request-id": [
"CENTRALUS:20151117T155504Z:7f222829-875a-4ee7-91c1-f1b8f2ab3a49"
"CENTRALUS:20151214T055850Z:69486eb6-1c50-4630-a84c-d927654c28b4"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Tue, 17 Nov 2015 15:55:03 GMT"
"Mon, 14 Dec 2015 05:58:50 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
Expand All @@ -69,6 +69,6 @@
],
"Names": {},
"Variables": {
"SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499"
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesBVTD2/vaults/rsv5?api-version=2015-08-15",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzQlZURDIvdmF1bHRzL3JzdjU/YXBpLXZlcnNpb249MjAxNS0wOC0xNQ==",
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/testsitegroup/providers/Microsoft.RecoveryServicesseadev01/vaults/rsv5?api-version=2015-11-10",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2Vzc2VhZGV2MDEvdmF1bHRzL3JzdjU/YXBpLXZlcnNpb249MjAxNS0xMS0xMA==",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
Expand All @@ -13,7 +13,7 @@
"2015-01-01"
],
"User-Agent": [
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/5.0.0.0"
"Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/1.0.0.0"
]
},
"ResponseBody": "",
Expand All @@ -28,10 +28,10 @@
"no-cache"
],
"x-ms-request-id": [
"5f17f666-1d7c-4f3e-ad46-5df2faaad05f"
"2e6aa792-b5ee-4416-a302-d70335b90412"
],
"x-ms-client-request-id": [
"95a07618-a661-4c95-b5d5-66168463c640"
"4b4708fa-af17-4a2b-9619-f2a495d41f92"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -40,23 +40,23 @@
"1198"
],
"x-ms-correlation-request-id": [
"5f17f666-1d7c-4f3e-ad46-5df2faaad05f"
"2e6aa792-b5ee-4416-a302-d70335b90412"
],
"x-ms-routing-request-id": [
"CENTRALUS:20151117T155552Z:5f17f666-1d7c-4f3e-ad46-5df2faaad05f"
"CENTRALUS:20151214T055714Z:2e6aa792-b5ee-4416-a302-d70335b90412"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Tue, 17 Nov 2015 15:55:52 GMT"
"Mon, 14 Dec 2015 05:57:14 GMT"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499"
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26"
}
}
Loading

0 comments on commit c78bbe5

Please sign in to comment.