Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automation] Collect examples from azure-sdk-for-net#Azure.ResourceManager.DevTestLabs_1.1.1 #5407

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
@@ -1,8 +1,9 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json
Expand All @@ -13,21 +14,32 @@
// authenticate your client
ArmClient client = new ArmClient(cred);

// this example assumes you already have this DevTestLabArmTemplateResource created on azure
// for more information of creating DevTestLabArmTemplateResource, please refer to the document of DevTestLabArmTemplateResource
// this example assumes you already have this DevTestLabArtifactSourceResource created on azure
// for more information of creating DevTestLabArtifactSourceResource, please refer to the document of DevTestLabArtifactSourceResource
string subscriptionId = "{subscriptionId}";
string resourceGroupName = "resourceGroupName";
string labName = "{labName}";
string artifactSourceName = "{artifactSourceName}";
string name = "{armTemplateName}";
ResourceIdentifier devTestLabArmTemplateResourceId = DevTestLabArmTemplateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, artifactSourceName, name);
DevTestLabArmTemplateResource devTestLabArmTemplate = client.GetDevTestLabArmTemplateResource(devTestLabArmTemplateResourceId);
ResourceIdentifier devTestLabArtifactSourceResourceId = DevTestLabArtifactSourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, artifactSourceName);
DevTestLabArtifactSourceResource devTestLabArtifactSource = client.GetDevTestLabArtifactSourceResource(devTestLabArtifactSourceResourceId);

// get the collection of this DevTestLabArmTemplateResource
DevTestLabArmTemplateCollection collection = devTestLabArtifactSource.GetDevTestLabArmTemplates();

// invoke the operation
DevTestLabArmTemplateResource result = await devTestLabArmTemplate.GetAsync();
string name = "{armTemplateName}";
NullableResponse<DevTestLabArmTemplateResource> response = await collection.GetIfExistsAsync(name);
DevTestLabArmTemplateResource result = response.HasValue ? response.Value : null;

// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArmTemplateData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArmTemplateData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json
Expand Down Expand Up @@ -36,4 +36,4 @@
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}

Console.WriteLine($"Succeeded");
Console.WriteLine("Succeeded");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json
// this example is just showing the usage of "ArtifactSources_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
Expand All @@ -28,7 +28,7 @@

// invoke the operation
string name = "{artifactSourceName}";
DevTestLabArtifactSourceData data = new DevTestLabArtifactSourceData(new AzureLocation("placeholder"))
DevTestLabArtifactSourceData data = new DevTestLabArtifactSourceData(default)
{
DisplayName = "{displayName}",
Uri = new Uri("{artifactSourceUri}"),
Expand All @@ -40,7 +40,7 @@
Status = new DevTestLabEnableStatus("{Enabled|Disabled}"),
Tags =
{
["tagName1"] = "tagValue1",
["tagName1"] = "tagValue1"
},
};
ArmOperation<DevTestLabArtifactSourceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json
// this example is just showing the usage of "ArtifactSources_Delete" operation, for the dependent resources, they will have to be created separately.
Expand All @@ -27,4 +27,4 @@
// invoke the operation
await devTestLabArtifactSource.DeleteAsync(WaitUntil.Completed);

Console.WriteLine($"Succeeded");
Console.WriteLine("Succeeded");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json
// this example is just showing the usage of "ArtifactSources_Get" operation, for the dependent resources, they will have to be created separately.
Expand All @@ -15,31 +15,20 @@
// authenticate your client
ArmClient client = new ArmClient(cred);

// this example assumes you already have this DevTestLabResource created on azure
// for more information of creating DevTestLabResource, please refer to the document of DevTestLabResource
// this example assumes you already have this DevTestLabArtifactSourceResource created on azure
// for more information of creating DevTestLabArtifactSourceResource, please refer to the document of DevTestLabArtifactSourceResource
string subscriptionId = "{subscriptionId}";
string resourceGroupName = "resourceGroupName";
string labName = "{labName}";
ResourceIdentifier devTestLabResourceId = DevTestLabResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName);
DevTestLabResource devTestLab = client.GetDevTestLabResource(devTestLabResourceId);

// get the collection of this DevTestLabArtifactSourceResource
DevTestLabArtifactSourceCollection collection = devTestLab.GetDevTestLabArtifactSources();
string name = "{artifactSourceName}";
ResourceIdentifier devTestLabArtifactSourceResourceId = DevTestLabArtifactSourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, name);
DevTestLabArtifactSourceResource devTestLabArtifactSource = client.GetDevTestLabArtifactSourceResource(devTestLabArtifactSourceResourceId);

// invoke the operation
string name = "{artifactSourceName}";
NullableResponse<DevTestLabArtifactSourceResource> response = await collection.GetIfExistsAsync(name);
DevTestLabArtifactSourceResource result = response.HasValue ? response.Value : null;
DevTestLabArtifactSourceResource result = await devTestLabArtifactSource.GetAsync();

if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArtifactSourceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArtifactSourceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json
// this example is just showing the usage of "ArtifactSources_List" operation, for the dependent resources, they will have to be created separately.
Expand Down Expand Up @@ -36,4 +36,4 @@
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}

Console.WriteLine($"Succeeded");
Console.WriteLine("Succeeded");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json
// this example is just showing the usage of "ArtifactSources_Update" operation, for the dependent resources, they will have to be created separately.
Expand All @@ -25,11 +25,11 @@
DevTestLabArtifactSourceResource devTestLabArtifactSource = client.GetDevTestLabArtifactSourceResource(devTestLabArtifactSourceResourceId);

// invoke the operation
DevTestLabArtifactSourcePatch patch = new DevTestLabArtifactSourcePatch()
DevTestLabArtifactSourcePatch patch = new DevTestLabArtifactSourcePatch
{
Tags =
{
["tagName1"] = "tagValue1",
["tagName1"] = "tagValue1"
},
};
DevTestLabArtifactSourceResource result = await devTestLabArtifactSource.UpdateAsync(patch);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json
// this example is just showing the usage of "Artifacts_GenerateArmTemplate" operation, for the dependent resources, they will have to be created separately.
Expand All @@ -25,7 +26,7 @@
DevTestLabArtifactResource devTestLabArtifact = client.GetDevTestLabArtifactResource(devTestLabArtifactResourceId);

// invoke the operation
DevTestLabArtifactGenerateArmTemplateContent content = new DevTestLabArtifactGenerateArmTemplateContent()
DevTestLabArtifactGenerateArmTemplateContent content = new DevTestLabArtifactGenerateArmTemplateContent
{
VmName = "{vmName}",
Location = new AzureLocation("{location}"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs.Models;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json
Expand All @@ -14,32 +15,21 @@
// authenticate your client
ArmClient client = new ArmClient(cred);

// this example assumes you already have this DevTestLabArtifactSourceResource created on azure
// for more information of creating DevTestLabArtifactSourceResource, please refer to the document of DevTestLabArtifactSourceResource
// this example assumes you already have this DevTestLabArtifactResource created on azure
// for more information of creating DevTestLabArtifactResource, please refer to the document of DevTestLabArtifactResource
string subscriptionId = "{subscriptionId}";
string resourceGroupName = "resourceGroupName";
string labName = "{labName}";
string artifactSourceName = "{artifactSourceName}";
ResourceIdentifier devTestLabArtifactSourceResourceId = DevTestLabArtifactSourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, artifactSourceName);
DevTestLabArtifactSourceResource devTestLabArtifactSource = client.GetDevTestLabArtifactSourceResource(devTestLabArtifactSourceResourceId);

// get the collection of this DevTestLabArtifactResource
DevTestLabArtifactCollection collection = devTestLabArtifactSource.GetDevTestLabArtifacts();
string name = "{artifactName}";
ResourceIdentifier devTestLabArtifactResourceId = DevTestLabArtifactResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, artifactSourceName, name);
DevTestLabArtifactResource devTestLabArtifact = client.GetDevTestLabArtifactResource(devTestLabArtifactResourceId);

// invoke the operation
string name = "{artifactName}";
NullableResponse<DevTestLabArtifactResource> response = await collection.GetIfExistsAsync(name);
DevTestLabArtifactResource result = response.HasValue ? response.Value : null;
DevTestLabArtifactResource result = await devTestLabArtifact.GetAsync();

if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
DevTestLabArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;

// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json
Expand Down Expand Up @@ -36,4 +36,4 @@
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}

Console.WriteLine($"Succeeded");
Console.WriteLine("Succeeded");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.0/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.DevTestLabs_1.1.1/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md"}
Loading