Skip to content

Commit

Permalink
Initial commit of the DevTestLabs SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
iouri-s committed Apr 29, 2016
1 parent c8a6016 commit 068a906
Show file tree
Hide file tree
Showing 112 changed files with 26,308 additions and 1 deletion.
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"src/ResourceManagement/DataLake.Analytics/Microsoft.Azure.Management.DataLake.Analytics",
"src/ResourceManagement/DataLake.Store/Microsoft.Azure.Management.DataLake.Store",
"src/ResourceManagement/DataLake.StoreUploader/Microsoft.Azure.Management.DataLake.StoreUploader",
"src/ResourceManagement/Microsoft.Azure.Management.RemoteApp"
"src/ResourceManagement/Microsoft.Azure.Management.RemoteApp",
"src/ResourceManagement/DevTestLabs/Microsoft.Azure.Management.DevTestLabs"
],
"sdk": {
"version": "1.0.0-rc1-final"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.24711" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24711</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>7772CC5B-1548-474E-AD0D-39D2B7BB3D05</ProjectGuid>
<RootNamespace>MDevTestLabs.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// 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 System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace Microsoft.Azure.Management.DevTestLabs
{
public class RecordedDelegatingHandler : DelegatingHandler
{
private HttpResponseMessage _response;

public RecordedDelegatingHandler()
{
StatusCodeToReturn = HttpStatusCode.Created;
}

public RecordedDelegatingHandler(HttpResponseMessage response)
{
StatusCodeToReturn = HttpStatusCode.Created;
_response = response;
}

public HttpStatusCode StatusCodeToReturn { get; set; }

public string Request { get; private set; }

public HttpRequestHeaders RequestHeaders { get; private set; }

public HttpContentHeaders ContentHeaders { get; private set; }

public HttpMethod Method { get; private set; }

public Uri Uri { get; private set; }

public bool IsPassThrough { get; set; }

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
// Save request
if (request.Content == null)
{
Request = string.Empty;
}
else
{
Request = await request.Content.ReadAsStringAsync();
}
RequestHeaders = request.Headers;
if (request.Content != null)
{
ContentHeaders = request.Content.Headers;
}
Method = request.Method;
Uri = request.RequestUri;

// Prepare response
if (IsPassThrough)
{
return await base.SendAsync(request, cancellationToken);
}
else
{
if (_response != null)
{
return _response;
}
else
{
HttpResponseMessage response = new HttpResponseMessage(StatusCodeToReturn);
response.Content = new StringContent("");
return response;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Reflection;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DevTestLabs.")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("DevTestLabs.Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"profiles": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/providers/Microsoft.DevTestLab/labs?api-version=2015-05-21-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzM4NTVjOTAtYzhjZi00NGEwLWEyNjYtOWI1NDhmYjhlN2IwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2VGVzdExhYi9sYWJzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMjEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"5bfda224-f05e-4b27-95ee-9b70e209c43c"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"Microsoft.Azure.Management.DevTestLabs.DevTestLabsClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0316174700-0/providers/Microsoft.Storage/storageAccounts/msdtlvm1881981289\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0316174700-0/providers/Microsoft.Storage/storageAccounts/msdtlvm1400996595\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0316174700-0/providers/Microsoft.Storage/storageAccounts/msdtlvm1881981289\"\r\n ],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0316174700-0/providers/Microsoft.KeyVault/vaults/msdtl432506258\",\r\n \"labStorageType\": \"Standard\",\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0316174700-0/providers/microsoft.devtestlab/labs/inttest-0316174700-1\",\r\n \"name\": \"IntTest-0316174700-1\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/17/2016 12:47:09 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-03-21T18:14:25.7330403-07:00\",\r\n \"provisioningState\": \"Creating\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0321181420-0/providers/microsoft.devtestlab/labs/inttest-0321181420-5\",\r\n \"name\": \"IntTest-0321181420-5\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/22/2016 1:14:25 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-03-21T18:14:26.3781431-07:00\",\r\n \"provisioningState\": \"Creating\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0321181420-1/providers/microsoft.devtestlab/labs/inttest-0321181420-7\",\r\n \"name\": \"IntTest-0321181420-7\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/22/2016 1:14:26 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-03-21T18:14:26.7552062-07:00\",\r\n \"provisioningState\": \"Creating\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0321181420-1/providers/microsoft.devtestlab/labs/inttest-0321181420-8\",\r\n \"name\": \"IntTest-0321181420-8\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/22/2016 1:14:26 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"labStorageType\": \"Premium\",\r\n \"createdDate\": \"2016-03-21T18:14:26.7162066-07:00\",\r\n \"provisioningState\": \"Creating\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0321181420-2/providers/microsoft.devtestlab/labs/inttest-0321181420-6\",\r\n \"name\": \"IntTest-0321181420-6\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/22/2016 1:14:26 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-03-21T18:14:26.630161-07:00\",\r\n \"provisioningState\": \"Creating\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0321181420-3/providers/microsoft.devtestlab/labs/inttest-0321181420-4\",\r\n \"name\": \"IntTest-0321181420-4\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/22/2016 1:14:26 AM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"storageAccounts\": [],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0323095927-3/providers/Microsoft.KeyVault/vaults/msdtl1698321349\",\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-03-23T09:59:39.5576971-07:00\",\r\n \"provisioningState\": \"Deleting\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0323095927-3/providers/microsoft.devtestlab/labs/inttest-0323095929-7\",\r\n \"name\": \"IntTest-0323095929-7\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"3/23/2016 4:59:36 PM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-1/providers/Microsoft.Storage/storageAccounts/msdtlvm288896385\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-1/providers/Microsoft.Storage/storageAccounts/msdtlvm1998597145\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-1/providers/Microsoft.Storage/storageAccounts/msdtlvm288896385\"\r\n ],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-1/providers/Microsoft.KeyVault/vaults/msdtl2025388812\",\r\n \"labStorageType\": \"Premium\",\r\n \"createdDate\": \"2016-04-20T16:29:57.9653459-07:00\",\r\n \"provisioningState\": \"Deleting\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0420162932-1/providers/microsoft.devtestlab/labs/inttest-0420162932-5\",\r\n \"name\": \"IntTest-0420162932-5\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"4/20/2016 11:29:55 PM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-2/providers/Microsoft.Storage/storageAccounts/msdtlvm2128197011\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-2/providers/Microsoft.Storage/storageAccounts/msdtlvm1723410618\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-2/providers/Microsoft.Storage/storageAccounts/msdtlvm2128197011\"\r\n ],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-2/providers/Microsoft.KeyVault/vaults/msdtl262833198\",\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-04-20T16:30:00.3142319-07:00\",\r\n \"provisioningState\": \"Deleting\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0420162932-2/providers/microsoft.devtestlab/labs/inttest-0420162932-6\",\r\n \"name\": \"IntTest-0420162932-6\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"4/20/2016 11:29:54 PM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm384113627\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm1683826612\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm384113627\"\r\n ],\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-04-20T16:29:58.4496895-07:00\",\r\n \"provisioningState\": \"Deleting\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0420162932-3/providers/microsoft.devtestlab/labs/inttest-0420162936-7\",\r\n \"name\": \"IntTest-0420162936-7\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"4/20/2016 11:29:55 PM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm801308730\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm1805048846\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.Storage/storageAccounts/msdtlvm801308730\"\r\n ],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/inttest-0420162932-3/providers/Microsoft.KeyVault/vaults/msdtl638222719\",\r\n \"labStorageType\": \"Standard\",\r\n \"createdDate\": \"2016-04-20T16:29:58.8246664-07:00\",\r\n \"provisioningState\": \"Deleting\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/inttest-0420162932-3/providers/microsoft.devtestlab/labs/inttest-0420162936-8\",\r\n \"name\": \"IntTest-0420162936-8\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"4/20/2016 11:29:55 PM +00:00\"\r\n }\r\n },\r\n {\r\n \"properties\": {\r\n \"defaultStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/keepintegrationtestresources2/providers/Microsoft.Storage/storageAccounts/msdtlvm631495722\",\r\n \"artifactsStorageAccount\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/keepintegrationtestresources2/providers/Microsoft.Storage/storageAccounts/msdtlvm1139230356\",\r\n \"storageAccounts\": [\r\n \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/keepintegrationtestresources2/providers/Microsoft.Storage/storageAccounts/msdtlvm631495722\"\r\n ],\r\n \"vaultName\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourceGroups/keepintegrationtestresources2/providers/Microsoft.KeyVault/vaults/msdtl1935373064\",\r\n \"labStorageType\": \"Standard\",\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/resourcegroups/keepintegrationtestresources2/providers/microsoft.devtestlab/labs/labforintegration2\",\r\n \"name\": \"LabForIntegration2\",\r\n \"type\": \"Microsoft.DevTestLab/labs\",\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\r\n \"CreatedOn\": \"2/24/2016 4:06:39 AM +00:00\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"9215"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Wed, 27 Apr 2016 19:12:39 GMT"
],
"Pragma": [
"no-cache"
],
"Server": [
"Microsoft-IIS/8.0"
],
"Set-Cookie": [
"ARRAffinity=6e02650f559bfa6453547296cbd6f3e1f792ce3b262aa023c1d1ee8ee502b4a6;Path=/;Domain=dev.rp1.vsdth.visualstudio.com",
"ARRAffinity=cd89fbb42c462be375050f01a60b505b563ce42a0a4ae6af6d1c3c96a7590832;Path=/;Domain=dev.rp1.vsdth.visualstudio.com"
],
"Vary": [
"Accept-Encoding",
"Accept-Encoding"
],
"x-rp-requesturi": [
"https://dtl-dev-rp.azurewebsites.net/subscriptions/33855c90-c8cf-44a0-a266-9b548fb8e7b0/providers/Microsoft.DevTestLab/labs?api-version=2015-05-21-preview"
],
"x-dtl-ProcessedBy": [
"dtl-dev-rp.azurewebsites.net"
],
"X-AspNet-Version": [
"4.0.30319"
],
"X-Powered-By": [
"ASP.NET",
"ASP.NET"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14839"
],
"x-ms-request-id": [
"28c657e2-0d95-4f67-ac1f-5190d7c058ef"
],
"x-ms-correlation-request-id": [
"28c657e2-0d95-4f67-ac1f-5190d7c058ef"
],
"x-ms-routing-request-id": [
"WESTUS:20160427T191239Z:28c657e2-0d95-4f67-ac1f-5190d7c058ef"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "33855c90-c8cf-44a0-a266-9b548fb8e7b0"
}
}
Loading

0 comments on commit 068a906

Please sign in to comment.