[Automation] Collect examples from azure-sdk-for-net#Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1
This commit is contained in:
Родитель
495df00faf
Коммит
6fc97f59ff
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionGetUpgrade_example.json
|
||||
// this example is just showing the usage of "Applications_ReadUpgrade" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedApplication.ReadUpgradeAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionResumeUpgrade_example.json
|
||||
// this example is just showing the usage of "Applications_ResumeUpgrade" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
RuntimeResumeApplicationUpgradeContent content = new RuntimeResumeApplicationUpgradeContent()
|
||||
{
|
||||
UpgradeDomainName = "UD1",
|
||||
};
|
||||
await serviceFabricManagedApplication.ResumeUpgradeAsync(WaitUntil.Completed, content);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationActionStartRollback_example.json
|
||||
// this example is just showing the usage of "Applications_StartRollback" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedApplication.StartRollbackAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationDeleteOperation_example.json
|
||||
// this example is just showing the usage of "Applications_Delete" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedApplication.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationGetOperation_example.json
|
||||
// this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedApplicationResource result = await serviceFabricManagedApplication.GetAsync();
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationListOperation_example.json
|
||||
// this example is just showing the usage of "Applications_List" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationResource
|
||||
ServiceFabricManagedApplicationCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedApplications();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedApplicationResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedApplicationData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPatchOperation_example.json
|
||||
// this example is just showing the usage of "Applications_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationResource, please refer to the document of ServiceFabricManagedApplicationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationName = "myApp";
|
||||
ResourceIdentifier serviceFabricManagedApplicationResourceId = ServiceFabricManagedApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationName);
|
||||
ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedApplicationPatch patch = new ServiceFabricManagedApplicationPatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedApplicationResource result = await serviceFabricManagedApplication.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,67 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPutOperation_example_max.json
|
||||
// this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationResource
|
||||
ServiceFabricManagedApplicationCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedApplications();
|
||||
|
||||
// invoke the operation
|
||||
string applicationName = "myApp";
|
||||
ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(new AzureLocation("eastus"))
|
||||
{
|
||||
Version = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
|
||||
Parameters =
|
||||
{
|
||||
["param1"] = "value1",
|
||||
},
|
||||
UpgradePolicy = new ApplicationUpgradePolicy()
|
||||
{
|
||||
ApplicationHealthPolicy = new ApplicationHealthPolicy(true, 0)
|
||||
{
|
||||
DefaultServiceTypeHealthPolicy = new ServiceTypeHealthPolicy(0, 0, 0),
|
||||
ServiceTypeHealthPolicyMap =
|
||||
{
|
||||
["service1"] = new ServiceTypeHealthPolicy(30,30,30),
|
||||
},
|
||||
},
|
||||
ForceRestart = false,
|
||||
RollingUpgradeMonitoringPolicy = new RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction.Rollback, TimeSpan.Parse("00:02:00"), TimeSpan.Parse("00:05:00"), TimeSpan.Parse("00:10:00"), TimeSpan.Parse("01:00:00"), TimeSpan.Parse("00:15:00")),
|
||||
InstanceCloseDelayDurationInSeconds = 600L,
|
||||
UpgradeMode = RollingUpgradeMode.UnmonitoredAuto,
|
||||
UpgradeReplicaSetCheckTimeout = 3600L,
|
||||
RecreateApplication = false,
|
||||
},
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedApplicationResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationName, data);
|
||||
ServiceFabricManagedApplicationResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,42 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationPutOperation_example_min.json
|
||||
// this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationResource
|
||||
ServiceFabricManagedApplicationCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedApplications();
|
||||
|
||||
// invoke the operation
|
||||
string applicationName = "myApp";
|
||||
ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(new AzureLocation("eastus"))
|
||||
{
|
||||
Version = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0",
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedApplicationResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationName, data);
|
||||
ServiceFabricManagedApplicationResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameDeleteOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypes_Delete" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedApplicationType.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameGetOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypes_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedApplicationTypeResource result = await serviceFabricManagedApplicationType.GetAsync();
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,38 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNameListOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypes_List" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationTypeResource
|
||||
ServiceFabricManagedApplicationTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedApplicationTypes();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedApplicationTypeResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedApplicationTypeData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNamePatchOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypes_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedApplicationTypePatch patch = new ServiceFabricManagedApplicationTypePatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedApplicationTypeResource result = await serviceFabricManagedApplicationType.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,38 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeNamePutOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationTypeResource
|
||||
ServiceFabricManagedApplicationTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedApplicationTypes();
|
||||
|
||||
// invoke the operation
|
||||
string applicationTypeName = "myAppType";
|
||||
ServiceFabricManagedApplicationTypeData data = new ServiceFabricManagedApplicationTypeData(new AzureLocation("eastus"));
|
||||
ArmOperation<ServiceFabricManagedApplicationTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationTypeName, data);
|
||||
ServiceFabricManagedApplicationTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,31 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionDeleteOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypeVersions_Delete" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeVersionResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeVersionResource, please refer to the document of ServiceFabricManagedApplicationTypeVersionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
string version = "1.0";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeVersionResourceId = ServiceFabricManagedApplicationTypeVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version);
|
||||
ServiceFabricManagedApplicationTypeVersionResource serviceFabricManagedApplicationTypeVersion = client.GetServiceFabricManagedApplicationTypeVersionResource(serviceFabricManagedApplicationTypeVersionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedApplicationTypeVersion.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,45 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionGetOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypeVersions_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationTypeVersionResource
|
||||
ServiceFabricManagedApplicationTypeVersionCollection collection = serviceFabricManagedApplicationType.GetServiceFabricManagedApplicationTypeVersions();
|
||||
|
||||
// invoke the operation
|
||||
string version = "1.0";
|
||||
NullableResponse<ServiceFabricManagedApplicationTypeVersionResource> response = await collection.GetIfExistsAsync(version);
|
||||
ServiceFabricManagedApplicationTypeVersionResource result = response.HasValue ? response.Value : null;
|
||||
|
||||
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
|
||||
ServiceFabricManagedApplicationTypeVersionData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionListOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypeVersions_ListByApplicationTypes" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationTypeVersionResource
|
||||
ServiceFabricManagedApplicationTypeVersionCollection collection = serviceFabricManagedApplicationType.GetServiceFabricManagedApplicationTypeVersions();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedApplicationTypeVersionResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedApplicationTypeVersionData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,42 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionPatchOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypeVersions_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeVersionResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeVersionResource, please refer to the document of ServiceFabricManagedApplicationTypeVersionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
string version = "1.0";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeVersionResourceId = ServiceFabricManagedApplicationTypeVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version);
|
||||
ServiceFabricManagedApplicationTypeVersionResource serviceFabricManagedApplicationTypeVersion = client.GetServiceFabricManagedApplicationTypeVersionResource(serviceFabricManagedApplicationTypeVersionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedApplicationTypeVersionPatch patch = new ServiceFabricManagedApplicationTypeVersionPatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedApplicationTypeVersionResource result = await serviceFabricManagedApplicationTypeVersion.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationTypeVersionData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,42 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ApplicationTypeVersionPutOperation_example.json
|
||||
// this example is just showing the usage of "ApplicationTypeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedApplicationTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedApplicationTypeResource, please refer to the document of ServiceFabricManagedApplicationTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string applicationTypeName = "myAppType";
|
||||
ResourceIdentifier serviceFabricManagedApplicationTypeResourceId = ServiceFabricManagedApplicationTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, applicationTypeName);
|
||||
ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedApplicationTypeVersionResource
|
||||
ServiceFabricManagedApplicationTypeVersionCollection collection = serviceFabricManagedApplicationType.GetServiceFabricManagedApplicationTypeVersions();
|
||||
|
||||
// invoke the operation
|
||||
string version = "1.0";
|
||||
ServiceFabricManagedApplicationTypeVersionData data = new ServiceFabricManagedApplicationTypeVersionData(new AzureLocation("eastus"))
|
||||
{
|
||||
AppPackageUri = new Uri("http://fakelink.test.com/MyAppType"),
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedApplicationTypeVersionResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, version, data);
|
||||
ServiceFabricManagedApplicationTypeVersionResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedApplicationTypeVersionData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,37 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/DeleteNodes_example.json
|
||||
// this example is just showing the usage of "NodeTypes_DeleteNode" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
NodeTypeActionContent content = new NodeTypeActionContent()
|
||||
{
|
||||
Nodes =
|
||||
{
|
||||
"BE_0","BE_3"
|
||||
},
|
||||
};
|
||||
await serviceFabricManagedNodeType.DeleteNodeAsync(WaitUntil.Completed, content);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedApplyMaintenanceWindowPost_example.json
|
||||
// this example is just showing the usage of "managedApplyMaintenanceWindow_Post" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroup1";
|
||||
string clusterName = "mycluster1";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedCluster.PostManagedApplyMaintenanceWindowAsync();
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterDeleteOperation_example.json
|
||||
// this example is just showing the usage of "ManagedClusters_Delete" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedCluster.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterGetOperation_example.json
|
||||
// this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedClusterResource result = await serviceFabricManagedCluster.GetAsync();
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedClusterData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterListByResourceGroupOperation_example.json
|
||||
// this example is just showing the usage of "ManagedClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedClusterResource
|
||||
ServiceFabricManagedClusterCollection collection = resourceGroupResource.GetServiceFabricManagedClusters();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedClusterResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedClusterData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,35 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterListBySubscriptionOperation_example.json
|
||||
// this example is just showing the usage of "ManagedClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this SubscriptionResource created on azure
|
||||
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedClusterResource item in subscriptionResource.GetServiceFabricManagedClustersAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedClusterData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPatchOperation_example.json
|
||||
// this example is just showing the usage of "ManagedClusters_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedClusterPatch patch = new ServiceFabricManagedClusterPatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedClusterResource result = await serviceFabricManagedCluster.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedClusterData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,153 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPutOperation_example_max.json
|
||||
// this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedClusterResource
|
||||
ServiceFabricManagedClusterCollection collection = resourceGroupResource.GetServiceFabricManagedClusters();
|
||||
|
||||
// invoke the operation
|
||||
string clusterName = "mycluster";
|
||||
ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(new AzureLocation("eastus"), new ServiceFabricManagedClustersSku(ServiceFabricManagedClustersSkuName.Basic))
|
||||
{
|
||||
DnsName = "mycluster",
|
||||
ClientConnectionPort = 19000,
|
||||
HttpGatewayConnectionPort = 19080,
|
||||
AdminUserName = "vmadmin",
|
||||
AdminPassword = "{vm-password}",
|
||||
LoadBalancingRules =
|
||||
{
|
||||
new ManagedClusterLoadBalancingRule(80,80,new ManagedClusterLoadBalancingRuleTransportProtocol("http"),ManagedClusterLoadBalanceProbeProtocol.Http)
|
||||
{
|
||||
ProbePort = 80,
|
||||
},new ManagedClusterLoadBalancingRule(443,443,new ManagedClusterLoadBalancingRuleTransportProtocol("http"),ManagedClusterLoadBalanceProbeProtocol.Http)
|
||||
{
|
||||
ProbePort = 443,
|
||||
},new ManagedClusterLoadBalancingRule(10000,10000,ManagedClusterLoadBalancingRuleTransportProtocol.Tcp,ManagedClusterLoadBalanceProbeProtocol.Http)
|
||||
{
|
||||
ProbePort = 10000,
|
||||
LoadDistribution = "Default",
|
||||
}
|
||||
},
|
||||
IsRdpAccessAllowed = true,
|
||||
NetworkSecurityRules =
|
||||
{
|
||||
new ServiceFabricManagedNetworkSecurityRule("TestName",ServiceFabricManagedNsgProtocol.Tcp,ServiceFabricManagedNetworkTrafficAccess.Allow,1010,ServiceFabricManagedNetworkSecurityRuleDirection.Inbound)
|
||||
{
|
||||
Description = "Test description",
|
||||
SourceAddressPrefixes =
|
||||
{
|
||||
"*"
|
||||
},
|
||||
DestinationAddressPrefixes =
|
||||
{
|
||||
"*"
|
||||
},
|
||||
SourcePortRanges =
|
||||
{
|
||||
"*"
|
||||
},
|
||||
DestinationPortRanges =
|
||||
{
|
||||
"*"
|
||||
},
|
||||
},new ServiceFabricManagedNetworkSecurityRule("AllowARM",new ServiceFabricManagedNsgProtocol("*"),ServiceFabricManagedNetworkTrafficAccess.Allow,2002,ServiceFabricManagedNetworkSecurityRuleDirection.Inbound)
|
||||
{
|
||||
SourceAddressPrefix = "AzureResourceManager",
|
||||
DestinationAddressPrefix = "*",
|
||||
SourcePortRange = "*",
|
||||
DestinationPortRange = "33500-33699",
|
||||
}
|
||||
},
|
||||
FabricSettings =
|
||||
{
|
||||
new ClusterFabricSettingsSection("ManagedIdentityTokenService",new ClusterFabricSettingsParameterDescription[]
|
||||
{
|
||||
new ClusterFabricSettingsParameterDescription("IsEnabled","true")
|
||||
})
|
||||
},
|
||||
ClusterCodeVersion = "7.1.168.9494",
|
||||
ClusterUpgradeMode = ManagedClusterUpgradeMode.Manual,
|
||||
AddOnFeatures =
|
||||
{
|
||||
ManagedClusterAddOnFeature.DnsService,ManagedClusterAddOnFeature.BackupRestoreService,ManagedClusterAddOnFeature.ResourceMonitorService
|
||||
},
|
||||
IsAutoOSUpgradeEnabled = true,
|
||||
HasZoneResiliency = true,
|
||||
MaxUnusedVersionsToKeep = 3,
|
||||
IsIPv6Enabled = true,
|
||||
IPTags =
|
||||
{
|
||||
new ManagedClusterIPTag("FirstPartyUsage","SQL")
|
||||
},
|
||||
AuxiliarySubnets =
|
||||
{
|
||||
new ManagedClusterSubnet("testSubnet1")
|
||||
{
|
||||
IsIPv6Enabled = true,
|
||||
PrivateEndpointNetworkPolicies = ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.Enabled,
|
||||
PrivateLinkServiceNetworkPolicies = ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.Enabled,
|
||||
NetworkSecurityGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1"),
|
||||
}
|
||||
},
|
||||
ServiceEndpoints =
|
||||
{
|
||||
new ManagedClusterServiceEndpoint("Microsoft.Storage")
|
||||
{
|
||||
Locations =
|
||||
{
|
||||
new AzureLocation("eastus2"),new AzureLocation("usnorth")
|
||||
},
|
||||
}
|
||||
},
|
||||
ZonalUpdateMode = ZonalUpdateMode.Fast,
|
||||
UseCustomVnet = true,
|
||||
PublicIPPrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix"),
|
||||
PublicIPv6PrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix"),
|
||||
DdosProtectionPlanId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan"),
|
||||
UpgradeDescription = new ManagedClusterUpgradePolicy()
|
||||
{
|
||||
ForceRestart = false,
|
||||
HealthPolicy = new ManagedClusterHealthPolicy(10, 30),
|
||||
DeltaHealthPolicy = new ManagedClusterUpgradeDeltaHealthPolicy(20)
|
||||
{
|
||||
MaxPercentUpgradeDomainDeltaUnhealthyNodes = 40,
|
||||
MaxPercentDeltaUnhealthyApplications = 40,
|
||||
},
|
||||
MonitoringPolicy = new ManagedClusterMonitoringPolicy(TimeSpan.Parse("00:05:00"), TimeSpan.Parse("00:45:00"), "00:55:00", "12:00:00", "03:00:00"),
|
||||
},
|
||||
HttpGatewayTokenAuthConnectionPort = 19081,
|
||||
IsHttpGatewayExclusiveAuthModeEnabled = true,
|
||||
AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.SubscriptionReuse,
|
||||
Tags =
|
||||
{
|
||||
},
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedClusterResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data);
|
||||
ServiceFabricManagedClusterResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedClusterData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,53 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterPutOperation_example_min.json
|
||||
// this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedClusterResource
|
||||
ServiceFabricManagedClusterCollection collection = resourceGroupResource.GetServiceFabricManagedClusters();
|
||||
|
||||
// invoke the operation
|
||||
string clusterName = "myCluster";
|
||||
ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(new AzureLocation("eastus"), new ServiceFabricManagedClustersSku(ServiceFabricManagedClustersSkuName.Basic))
|
||||
{
|
||||
DnsName = "myCluster",
|
||||
AdminUserName = "vmadmin",
|
||||
AdminPassword = "{vm-password}",
|
||||
FabricSettings =
|
||||
{
|
||||
new ClusterFabricSettingsSection("ManagedIdentityTokenService",new ClusterFabricSettingsParameterDescription[]
|
||||
{
|
||||
new ClusterFabricSettingsParameterDescription("IsEnabled","true")
|
||||
})
|
||||
},
|
||||
ClusterUpgradeMode = ManagedClusterUpgradeMode.Automatic,
|
||||
ClusterUpgradeCadence = ManagedClusterUpgradeCadence.Wave1,
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedClusterResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data);
|
||||
ServiceFabricManagedClusterResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedClusterData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,31 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionGetByEnvironment_example.json
|
||||
// this example is just showing the usage of "ManagedClusterVersion_GetByEnvironment" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this SubscriptionResource created on azure
|
||||
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
AzureLocation location = new AzureLocation("eastus");
|
||||
ManagedClusterVersionEnvironment environment = ManagedClusterVersionEnvironment.Windows;
|
||||
string clusterVersion = "7.2.477.9590";
|
||||
ServiceFabricManagedClusterVersion result = await subscriptionResource.GetManagedClusterVersionByEnvironmentAsync(location, environment, clusterVersion);
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionGet_example.json
|
||||
// this example is just showing the usage of "ManagedClusterVersion_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this SubscriptionResource created on azure
|
||||
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
AzureLocation location = new AzureLocation("eastus");
|
||||
string clusterVersion = "7.2.477.9590";
|
||||
ServiceFabricManagedClusterVersion result = await subscriptionResource.GetManagedClusterVersionAsync(location, clusterVersion);
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionListByEnvironment.json
|
||||
// this example is just showing the usage of "ManagedClusterVersion_ListByEnvironment" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this SubscriptionResource created on azure
|
||||
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("eastus");
|
||||
ManagedClusterVersionEnvironment environment = ManagedClusterVersionEnvironment.Windows;
|
||||
await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsByEnvironmentAsync(location, environment))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,32 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedClusterVersionList_example.json
|
||||
// this example is just showing the usage of "ManagedClusterVersion_List" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this SubscriptionResource created on azure
|
||||
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("eastus");
|
||||
await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsAsync(location))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ManagedMaintenanceWindowStatusGet_example.json
|
||||
// this example is just showing the usage of "managedMaintenanceWindowStatus_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroup1";
|
||||
string clusterName = "mycluster1";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ManagedMaintenanceWindowStatus result = await serviceFabricManagedCluster.GetManagedMaintenanceWindowStatuAsync();
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeDeleteOperation_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Delete" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await serviceFabricManagedNodeType.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeGetOperation_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Get" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "FE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedNodeTypeResource result = await serviceFabricManagedNodeType.GetAsync();
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeListOperation_example.json
|
||||
// this example is just showing the usage of "NodeTypes_ListByManagedClusters" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceFabricManagedNodeTypeResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,46 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePatchOperationAutoScale_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
Sku = new NodeTypeSku(10)
|
||||
{
|
||||
Name = "Standard_S0",
|
||||
Tier = "Standard",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedNodeTypeResource result = await serviceFabricManagedNodeType.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePatchOperation_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Update" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch()
|
||||
{
|
||||
Tags =
|
||||
{
|
||||
["a"] = "b",
|
||||
},
|
||||
};
|
||||
ServiceFabricManagedNodeTypeResource result = await serviceFabricManagedNodeType.UpdateAsync(patch);
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,88 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationAutoScale_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = -1,
|
||||
DataDiskSizeInGB = 200,
|
||||
DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs,
|
||||
PlacementProperties =
|
||||
{
|
||||
["HasSSD"] = "true",
|
||||
["NodeColor"] = "green",
|
||||
["SomeProperty"] = "5",
|
||||
},
|
||||
Capacities =
|
||||
{
|
||||
["ClientConnections"] = "65536",
|
||||
},
|
||||
VmSize = "Standard_DS3",
|
||||
VmImagePublisher = "MicrosoftWindowsServer",
|
||||
VmImageOffer = "WindowsServer",
|
||||
VmImageSku = "2016-Datacenter-Server-Core",
|
||||
VmImageVersion = "latest",
|
||||
VmSecrets =
|
||||
{
|
||||
new NodeTypeVaultSecretGroup(new WritableSubResource()
|
||||
{
|
||||
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
|
||||
},new NodeTypeVaultCertificate[]
|
||||
{
|
||||
new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),"My")
|
||||
})
|
||||
},
|
||||
VmExtensions =
|
||||
{
|
||||
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
|
||||
{
|
||||
AutoUpgradeMinorVersion = true,
|
||||
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
|
||||
{
|
||||
}),
|
||||
}
|
||||
},
|
||||
UserAssignedIdentities =
|
||||
{
|
||||
new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")
|
||||
},
|
||||
IsStateless = true,
|
||||
HasMultiplePlacementGroups = true,
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,48 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationCustomImage_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
VmSize = "Standard_D3",
|
||||
VmImageResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"),
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,48 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
VmSize = "Standard_D3",
|
||||
VmSharedGalleryImageId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"),
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,63 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
DataDiskType = ServiceFabricManagedDataDiskType.StandardSsdLrs,
|
||||
PlacementProperties =
|
||||
{
|
||||
},
|
||||
Capacities =
|
||||
{
|
||||
},
|
||||
VmSize = "Standard_D8s_v3",
|
||||
VmImagePublisher = "MicrosoftWindowsServer",
|
||||
VmImageOffer = "WindowsServer",
|
||||
VmImageSku = "2019-Datacenter",
|
||||
VmImageVersion = "latest",
|
||||
Zones =
|
||||
{
|
||||
"1"
|
||||
},
|
||||
HostGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,64 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationStateless_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
VmSize = "Standard_DS3",
|
||||
VmImagePublisher = "MicrosoftWindowsServer",
|
||||
VmImageOffer = "WindowsServer",
|
||||
VmImageSku = "2016-Datacenter-Server-Core",
|
||||
VmImageVersion = "latest",
|
||||
VmExtensions =
|
||||
{
|
||||
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
|
||||
{
|
||||
AutoUpgradeMinorVersion = true,
|
||||
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
|
||||
{
|
||||
}),
|
||||
}
|
||||
},
|
||||
IsStateless = true,
|
||||
HasMultiplePlacementGroups = true,
|
||||
IsEncryptionAtHostEnabled = true,
|
||||
UseTempDataDisk = true,
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,57 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
VmSize = "Standard_D3",
|
||||
VmImagePublisher = "testpublisher",
|
||||
VmImageOffer = "windows_2022_test",
|
||||
VmImageSku = "win_2022_test_20_10_gen2",
|
||||
VmImageVersion = "latest",
|
||||
VmImagePlan = new VmImagePlan()
|
||||
{
|
||||
Name = "win_2022_test_20_10_gen2",
|
||||
Product = "windows_2022_test",
|
||||
Publisher = "testpublisher",
|
||||
},
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,184 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperation_example_max.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE-testResourceGroup-testRegion-test";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs,
|
||||
DataDiskLetter = "S",
|
||||
PlacementProperties =
|
||||
{
|
||||
["HasSSD"] = "true",
|
||||
["NodeColor"] = "green",
|
||||
["SomeProperty"] = "5",
|
||||
},
|
||||
Capacities =
|
||||
{
|
||||
["ClientConnections"] = "65536",
|
||||
},
|
||||
VmSize = "Standard_DS3",
|
||||
VmImagePublisher = "MicrosoftWindowsServer",
|
||||
VmImageOffer = "WindowsServer",
|
||||
VmImageSku = "2016-Datacenter-Server-Core",
|
||||
VmImageVersion = "latest",
|
||||
VmSecrets =
|
||||
{
|
||||
new NodeTypeVaultSecretGroup(new WritableSubResource()
|
||||
{
|
||||
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
|
||||
},new NodeTypeVaultCertificate[]
|
||||
{
|
||||
new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),"My")
|
||||
})
|
||||
},
|
||||
VmExtensions =
|
||||
{
|
||||
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
|
||||
{
|
||||
AutoUpgradeMinorVersion = true,
|
||||
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
|
||||
{
|
||||
}),
|
||||
ForceUpdateTag = "v.1.0",
|
||||
IsAutomaticUpgradeEnabled = true,
|
||||
SetupOrder =
|
||||
{
|
||||
VmssExtensionSetupOrder.BeforeSFRuntime
|
||||
},
|
||||
}
|
||||
},
|
||||
UserAssignedIdentities =
|
||||
{
|
||||
new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")
|
||||
},
|
||||
IsStateless = true,
|
||||
HasMultiplePlacementGroups = true,
|
||||
FrontendConfigurations =
|
||||
{
|
||||
new NodeTypeFrontendConfiguration()
|
||||
{
|
||||
LoadBalancerBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
|
||||
LoadBalancerInboundNatPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
|
||||
ApplicationGatewayBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
|
||||
}
|
||||
},
|
||||
AdditionalDataDisks =
|
||||
{
|
||||
new NodeTypeVmssDataDisk(1,256,ServiceFabricManagedDataDiskType.StandardSsdLrs,"F"),new NodeTypeVmssDataDisk(2,150,ServiceFabricManagedDataDiskType.PremiumLrs,"G")
|
||||
},
|
||||
IsEncryptionAtHostEnabled = true,
|
||||
IsAcceleratedNetworkingEnabled = true,
|
||||
UseDefaultPublicLoadBalancer = true,
|
||||
IsOverProvisioningEnabled = false,
|
||||
IsSpotVm = true,
|
||||
UseEphemeralOSDisk = true,
|
||||
SpotRestoreTimeout = "PT30M",
|
||||
EvictionPolicy = SpotNodeVmEvictionPolicyType.Deallocate,
|
||||
SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
|
||||
VmSetupActions =
|
||||
{
|
||||
VmSetupAction.EnableContainers,VmSetupAction.EnableHyperV
|
||||
},
|
||||
SecurityType = ServiceFabricManagedClusterSecurityType.TrustedLaunch,
|
||||
IsSecureBootEnabled = true,
|
||||
IsNodePublicIPEnabled = true,
|
||||
IsNodePublicIPv6Enabled = true,
|
||||
NatGatewayId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"),
|
||||
ServiceArtifactReferenceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"),
|
||||
DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
|
||||
AdditionalNetworkInterfaceConfigurations =
|
||||
{
|
||||
new AdditionalNetworkInterfaceConfiguration("nic-1",new ServiceFabricManagedClusterIPConfiguration[]
|
||||
{
|
||||
new ServiceFabricManagedClusterIPConfiguration("ipconfig-1")
|
||||
{
|
||||
ApplicationGatewayBackendAddressPools =
|
||||
{
|
||||
new WritableSubResource()
|
||||
{
|
||||
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
|
||||
}
|
||||
},
|
||||
LoadBalancerBackendAddressPools =
|
||||
{
|
||||
new WritableSubResource()
|
||||
{
|
||||
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
|
||||
}
|
||||
},
|
||||
LoadBalancerInboundNatPools =
|
||||
{
|
||||
new WritableSubResource()
|
||||
{
|
||||
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
|
||||
}
|
||||
},
|
||||
SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
|
||||
PrivateIPAddressVersion = ServiceFabricManagedClusterPrivateIPAddressVersion.IPv4,
|
||||
PublicIPAddressConfiguration = new ServiceFabricManagedClusterPublicIPAddressConfiguration("publicip-1")
|
||||
{
|
||||
IPTags =
|
||||
{
|
||||
new ManagedClusterIPTag("RoutingPreference","Internet")
|
||||
},
|
||||
PublicIPAddressVersion = ServiceFabricManagedClusterPublicIPAddressVersion.IPv4,
|
||||
},
|
||||
}
|
||||
})
|
||||
{
|
||||
EnableAcceleratedNetworking = true,
|
||||
DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
|
||||
}
|
||||
},
|
||||
ComputerNamePrefix = "BE",
|
||||
VmApplications =
|
||||
{
|
||||
new ServiceFabricManagedVmApplication(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"))
|
||||
{
|
||||
ConfigurationReference = new Uri("https://mystorageaccount.blob.core.windows.net/containername/blobname"),
|
||||
EnableAutomaticUpgrade = true,
|
||||
Order = 1,
|
||||
VmGalleryTags = "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}",
|
||||
TreatFailureAsDeploymentFailure = false,
|
||||
}
|
||||
},
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,51 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypePutOperation_example_min.json
|
||||
// this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedClusterResource created on azure
|
||||
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
|
||||
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
|
||||
|
||||
// get the collection of this ServiceFabricManagedNodeTypeResource
|
||||
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
|
||||
|
||||
// invoke the operation
|
||||
string nodeTypeName = "BE";
|
||||
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
|
||||
{
|
||||
IsPrimary = false,
|
||||
VmInstanceCount = 10,
|
||||
DataDiskSizeInGB = 200,
|
||||
VmSize = "Standard_D3",
|
||||
VmImagePublisher = "MicrosoftWindowsServer",
|
||||
VmImageOffer = "WindowsServer",
|
||||
VmImageSku = "2016-Datacenter-Server-Core",
|
||||
VmImageVersion = "latest",
|
||||
};
|
||||
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
|
||||
ServiceFabricManagedNodeTypeResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
ServiceFabricManagedNodeTypeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/NodeTypeSkusListOperation_example.json
|
||||
// this example is just showing the usage of "NodeTypeSkus_List" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (NodeTypeAvailableSku item in serviceFabricManagedNodeType.GetAvailableSkusAsync())
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ReimageNodes_UD_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Reimage" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
NodeTypeActionContent content = new NodeTypeActionContent()
|
||||
{
|
||||
UpdateType = ServiceFabricManagedClusterUpdateType.ByUpgradeDomain,
|
||||
};
|
||||
await serviceFabricManagedNodeType.ReimageAsync(WaitUntil.Completed, content);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,37 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/ReimageNodes_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Reimage" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
NodeTypeActionContent content = new NodeTypeActionContent()
|
||||
{
|
||||
Nodes =
|
||||
{
|
||||
"BE_0","BE_3"
|
||||
},
|
||||
};
|
||||
await serviceFabricManagedNodeType.ReimageAsync(WaitUntil.Completed, content);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
|
@ -0,0 +1,37 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
|
||||
using Azure.ResourceManager.ServiceFabricManagedClusters;
|
||||
|
||||
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-06-01-preview/examples/RestartNodes_example.json
|
||||
// this example is just showing the usage of "NodeTypes_Restart" operation, for the dependent resources, they will have to be created separately.
|
||||
|
||||
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
|
||||
TokenCredential cred = new DefaultAzureCredential();
|
||||
// authenticate your client
|
||||
ArmClient client = new ArmClient(cred);
|
||||
|
||||
// this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure
|
||||
// for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resRg";
|
||||
string clusterName = "myCluster";
|
||||
string nodeTypeName = "BE";
|
||||
ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName);
|
||||
ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
NodeTypeActionContent content = new NodeTypeActionContent()
|
||||
{
|
||||
Nodes =
|
||||
{
|
||||
"BE_0","BE_3"
|
||||
},
|
||||
};
|
||||
await serviceFabricManagedNodeType.RestartAsync(WaitUntil.Completed, content);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.ServiceFabricManagedClusters_1.3.0-beta.1/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md"}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче