diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.cs new file mode 100644 index 00000000000..8cb2724db93 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_CreateOrUpdate_MaximumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverAgentResource +StorageMoverAgentCollection collection = storageMover.GetStorageMoverAgents(); + +// invoke the operation +string agentName = "examples-agentName"; +StorageMoverAgentData data = new StorageMoverAgentData(null, null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentName, data); +StorageMoverAgentResource 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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MaximumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.cs new file mode 100644 index 00000000000..ec64ba3b936 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_CreateOrUpdate_MinimumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverAgentResource +StorageMoverAgentCollection collection = storageMover.GetStorageMoverAgents(); + +// invoke the operation +string agentName = "examples-agentName"; +StorageMoverAgentData data = new StorageMoverAgentData(null, null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentName, data); +StorageMoverAgentResource 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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_MinimumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.cs new file mode 100644 index 00000000000..7bdf5a0b029 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json +// this example is just showing the usage of "Agent_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverAgentResource +StorageMoverAgentCollection collection = storageMover.GetStorageMoverAgents(); + +// invoke the operation +string agentName = "examples-agentName"; +StorageMoverAgentData data = new StorageMoverAgentData(null, null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentName, data); +StorageMoverAgentResource 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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.cs new file mode 100644 index 00000000000..63b12639c83 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.cs @@ -0,0 +1,30 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_Delete.json +// this example is just showing the usage of "Agent_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 StorageMoverAgentResource created on azure +// for more information of creating StorageMoverAgentResource, please refer to the document of StorageMoverAgentResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string agentName = "examples-agentName"; +ResourceIdentifier storageMoverAgentResourceId = StorageMoverAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, agentName); +StorageMoverAgentResource storageMoverAgent = client.GetStorageMoverAgentResource(storageMoverAgentResourceId); + +// invoke the operation +await storageMoverAgent.DeleteAsync(WaitUntil.Completed); + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Delete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.cs new file mode 100644 index 00000000000..3559f334c8a --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.cs @@ -0,0 +1,34 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_Get_MaximumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverAgentResource created on azure +// for more information of creating StorageMoverAgentResource, please refer to the document of StorageMoverAgentResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string agentName = "examples-agentName"; +ResourceIdentifier storageMoverAgentResourceId = StorageMoverAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, agentName); +StorageMoverAgentResource storageMoverAgent = client.GetStorageMoverAgentResource(storageMoverAgentResourceId); + +// invoke the operation +StorageMoverAgentResource result = await storageMoverAgent.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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MaximumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.cs new file mode 100644 index 00000000000..43f317631b4 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.cs @@ -0,0 +1,34 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_Get_MinimumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverAgentResource created on azure +// for more information of creating StorageMoverAgentResource, please refer to the document of StorageMoverAgentResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string agentName = "examples-agentName"; +ResourceIdentifier storageMoverAgentResourceId = StorageMoverAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, agentName); +StorageMoverAgentResource storageMoverAgent = client.GetStorageMoverAgentResource(storageMoverAgentResourceId); + +// invoke the operation +StorageMoverAgentResource result = await storageMoverAgent.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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Get_MinimumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.cs new file mode 100644 index 00000000000..bc209b40b53 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_List_MaximumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverAgentResource +StorageMoverAgentCollection collection = storageMover.GetStorageMoverAgents(); + +// invoke the operation and iterate over the result +await foreach (StorageMoverAgentResource 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 + StorageMoverAgentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MaximumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.cs new file mode 100644 index 00000000000..f27e5dceee8 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_List_MinimumSet.json +// this example is just showing the usage of "Agent_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverAgentResource +StorageMoverAgentCollection collection = storageMover.GetStorageMoverAgents(); + +// invoke the operation and iterate over the result +await foreach (StorageMoverAgentResource 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 + StorageMoverAgentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_List_MinimumSet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.cs new file mode 100644 index 00000000000..4625b69adcc --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Agents_Update.json +// this example is just showing the usage of "Agent_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 StorageMoverAgentResource created on azure +// for more information of creating StorageMoverAgentResource, please refer to the document of StorageMoverAgentResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string agentName = "examples-agentName"; +ResourceIdentifier storageMoverAgentResourceId = StorageMoverAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, agentName); +StorageMoverAgentResource storageMoverAgent = client.GetStorageMoverAgentResource(storageMoverAgentResourceId); + +// invoke the operation +StorageMoverAgentPatch patch = new StorageMoverAgentPatch(); +StorageMoverAgentResource result = await storageMoverAgent.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 +StorageMoverAgentData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Agents_Update.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.cs new file mode 100644 index 00000000000..ab8c97e0b52 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.cs new file mode 100644 index 00000000000..beea2be5bff --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.cs new file mode 100644 index 00000000000..4692c1ca5b9 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.cs new file mode 100644 index 00000000000..5dceede3422 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.cs new file mode 100644 index 00000000000..3b71f231a09 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_NfsMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_NfsMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.cs new file mode 100644 index 00000000000..9b6eaaedd6c --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_CreateOrUpdate_SmbMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +StorageMoverEndpointData data = new StorageMoverEndpointData(null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); +StorageMoverEndpointResource 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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_CreateOrUpdate_SmbMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.cs new file mode 100644 index 00000000000..9331ec26065 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.cs @@ -0,0 +1,30 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Delete.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +await storageMoverEndpoint.DeleteAsync(WaitUntil.Completed); + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Delete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.cs new file mode 100644 index 00000000000..c4c7e0ce5f6 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_AzureMultiCloudConnector.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureMultiCloudConnector.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.cs new file mode 100644 index 00000000000..146a49bfcd9 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_AzureStorageBlobContainer.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageBlobContainer.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.cs new file mode 100644 index 00000000000..7f5765549c7 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_AzureStorageNfsFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageNfsFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.cs new file mode 100644 index 00000000000..dc475bd6042 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_AzureStorageSmbFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_AzureStorageSmbFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.cs new file mode 100644 index 00000000000..298c46c854d --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_NfsMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_NfsMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.cs new file mode 100644 index 00000000000..1eb74a1eaff --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Get_SmbMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation +string endpointName = "examples-endpointName"; +NullableResponse response = await collection.GetIfExistsAsync(endpointName); +StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Get_SmbMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.cs new file mode 100644 index 00000000000..603ba88a830 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.cs @@ -0,0 +1,39 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_List.json +// this example is just showing the usage of "Endpoint_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverEndpointResource +StorageMoverEndpointCollection collection = storageMover.GetStorageMoverEndpoints(); + +// invoke the operation and iterate over the result +await foreach (StorageMoverEndpointResource 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 + StorageMoverEndpointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_List.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.cs new file mode 100644 index 00000000000..1405ab342af --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_AzureMultiCloudConnector.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureMultiCloudConnector.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.cs new file mode 100644 index 00000000000..ed7c57770fd --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_AzureStorageBlobContainer.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageBlobContainer.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.cs new file mode 100644 index 00000000000..bade9ea179b --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_AzureStorageNfsFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageNfsFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.cs new file mode 100644 index 00000000000..9dd1fd53fac --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_AzureStorageSmbFileShare.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_AzureStorageSmbFileShare.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.cs new file mode 100644 index 00000000000..b75909200f1 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_NfsMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_NfsMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.cs new file mode 100644 index 00000000000..0d68cd87225 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Endpoints_Update_SmbMount.json +// this example is just showing the usage of "Endpoint_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 StorageMoverEndpointResource created on azure +// for more information of creating StorageMoverEndpointResource, please refer to the document of StorageMoverEndpointResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string endpointName = "examples-endpointName"; +ResourceIdentifier storageMoverEndpointResourceId = StorageMoverEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, endpointName); +StorageMoverEndpointResource storageMoverEndpoint = client.GetStorageMoverEndpointResource(storageMoverEndpointResourceId); + +// invoke the operation +StorageMoverEndpointPatch patch = new StorageMoverEndpointPatch(); +StorageMoverEndpointResource result = await storageMoverEndpoint.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 +StorageMoverEndpointData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Endpoints_Update_SmbMount.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.cs new file mode 100644 index 00000000000..af4b403ab26 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.cs @@ -0,0 +1,40 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_CreateOrUpdate.json +// this example is just showing the usage of "JobDefinition_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// get the collection of this JobDefinitionResource +JobDefinitionCollection collection = storageMoverProject.GetJobDefinitions(); + +// invoke the operation +string jobDefinitionName = "examples-jobDefinitionName"; +JobDefinitionData data = new JobDefinitionData(default, null, null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobDefinitionName, data); +JobDefinitionResource 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 +JobDefinitionData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.cs new file mode 100644 index 00000000000..3037c46790e --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.cs @@ -0,0 +1,40 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_CreateOrUpdate_CloudToCloud.json +// this example is just showing the usage of "JobDefinition_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// get the collection of this JobDefinitionResource +JobDefinitionCollection collection = storageMoverProject.GetJobDefinitions(); + +// invoke the operation +string jobDefinitionName = "examples-jobDefinitionName"; +JobDefinitionData data = new JobDefinitionData(default, null, null); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobDefinitionName, data); +JobDefinitionResource 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 +JobDefinitionData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_CreateOrUpdate_CloudToCloud.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.cs new file mode 100644 index 00000000000..9957a613a89 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.cs @@ -0,0 +1,31 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_Delete.json +// this example is just showing the usage of "JobDefinition_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 JobDefinitionResource created on azure +// for more information of creating JobDefinitionResource, please refer to the document of JobDefinitionResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +ResourceIdentifier jobDefinitionResourceId = JobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName); +JobDefinitionResource jobDefinition = client.GetJobDefinitionResource(jobDefinitionResourceId); + +// invoke the operation +await jobDefinition.DeleteAsync(WaitUntil.Completed); + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Delete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.cs new file mode 100644 index 00000000000..70c2bcb3531 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.cs @@ -0,0 +1,46 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_Get.json +// this example is just showing the usage of "JobDefinition_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// get the collection of this JobDefinitionResource +JobDefinitionCollection collection = storageMoverProject.GetJobDefinitions(); + +// invoke the operation +string jobDefinitionName = "examples-jobDefinitionName"; +NullableResponse response = await collection.GetIfExistsAsync(jobDefinitionName); +JobDefinitionResource 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 + JobDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Get.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.cs new file mode 100644 index 00000000000..9103ae43560 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.cs @@ -0,0 +1,40 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_List.json +// this example is just showing the usage of "JobDefinition_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// get the collection of this JobDefinitionResource +JobDefinitionCollection collection = storageMoverProject.GetJobDefinitions(); + +// invoke the operation and iterate over the result +await foreach (JobDefinitionResource 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 + JobDefinitionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_List.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.cs new file mode 100644 index 00000000000..f6930695145 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.cs @@ -0,0 +1,31 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_StartJob.json +// this example is just showing the usage of "JobDefinitions_StartJob" 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 JobDefinitionResource created on azure +// for more information of creating JobDefinitionResource, please refer to the document of JobDefinitionResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +ResourceIdentifier jobDefinitionResourceId = JobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName); +JobDefinitionResource jobDefinition = client.GetJobDefinitionResource(jobDefinitionResourceId); + +// invoke the operation +JobRunResourceId result = await jobDefinition.StartJobAsync(); + +Console.WriteLine($"Succeeded: {result}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StartJob.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.cs new file mode 100644 index 00000000000..5d5b20336f3 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.cs @@ -0,0 +1,31 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_StopJob.json +// this example is just showing the usage of "JobDefinitions_StopJob" 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 JobDefinitionResource created on azure +// for more information of creating JobDefinitionResource, please refer to the document of JobDefinitionResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +ResourceIdentifier jobDefinitionResourceId = JobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName); +JobDefinitionResource jobDefinition = client.GetJobDefinitionResource(jobDefinitionResourceId); + +// invoke the operation +JobRunResourceId result = await jobDefinition.StopJobAsync(); + +Console.WriteLine($"Succeeded: {result}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_StopJob.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.cs new file mode 100644 index 00000000000..34745905b34 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.cs @@ -0,0 +1,36 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobDefinitions_Update.json +// this example is just showing the usage of "JobDefinition_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 JobDefinitionResource created on azure +// for more information of creating JobDefinitionResource, please refer to the document of JobDefinitionResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +ResourceIdentifier jobDefinitionResourceId = JobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName); +JobDefinitionResource jobDefinition = client.GetJobDefinitionResource(jobDefinitionResourceId); + +// invoke the operation +JobDefinitionPatch patch = new JobDefinitionPatch(); +JobDefinitionResource result = await jobDefinition.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 +JobDefinitionData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobDefinitions_Update.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.cs new file mode 100644 index 00000000000..0874220f3e4 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobRuns_Get.json +// this example is just showing the usage of "JobRun_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 JobRunResource created on azure +// for more information of creating JobRunResource, please refer to the document of JobRunResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +string jobRunName = "examples-jobRunName"; +ResourceIdentifier jobRunResourceId = JobRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName, jobRunName); +JobRunResource jobRun = client.GetJobRunResource(jobRunResourceId); + +// invoke the operation +JobRunResource result = await jobRun.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 +JobRunData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_Get.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.cs new file mode 100644 index 00000000000..07521c20d83 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.cs @@ -0,0 +1,40 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/JobRuns_List.json +// this example is just showing the usage of "JobRun_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 JobDefinitionResource created on azure +// for more information of creating JobDefinitionResource, please refer to the document of JobDefinitionResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +string jobDefinitionName = "examples-jobDefinitionName"; +ResourceIdentifier jobDefinitionResourceId = JobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName, jobDefinitionName); +JobDefinitionResource jobDefinition = client.GetJobDefinitionResource(jobDefinitionResourceId); + +// get the collection of this JobRunResource +JobRunCollection collection = jobDefinition.GetJobRuns(); + +// invoke the operation and iterate over the result +await foreach (JobRunResource 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 + JobRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/JobRuns_List.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.cs new file mode 100644 index 00000000000..25c0dc15ae3 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Projects_CreateOrUpdate.json +// this example is just showing the usage of "Project_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverProjectResource +StorageMoverProjectCollection collection = storageMover.GetStorageMoverProjects(); + +// invoke the operation +string projectName = "examples-projectName"; +StorageMoverProjectData data = new StorageMoverProjectData(); +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); +StorageMoverProjectResource 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 +StorageMoverProjectData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_CreateOrUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.cs new file mode 100644 index 00000000000..d03b07323c1 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.cs @@ -0,0 +1,30 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Projects_Delete.json +// this example is just showing the usage of "Project_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// invoke the operation +await storageMoverProject.DeleteAsync(WaitUntil.Completed); + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Delete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.cs new file mode 100644 index 00000000000..a0385cafe65 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.cs @@ -0,0 +1,44 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Projects_Get.json +// this example is just showing the usage of "Project_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverProjectResource +StorageMoverProjectCollection collection = storageMover.GetStorageMoverProjects(); + +// invoke the operation +string projectName = "examples-projectName"; +NullableResponse response = await collection.GetIfExistsAsync(projectName); +StorageMoverProjectResource 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 + StorageMoverProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Get.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.cs new file mode 100644 index 00000000000..cbf8cca09dc --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Projects_List.json +// this example is just showing the usage of "Project_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// get the collection of this StorageMoverProjectResource +StorageMoverProjectCollection collection = storageMover.GetStorageMoverProjects(); + +// invoke the operation and iterate over the result +await foreach (StorageMoverProjectResource 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 + StorageMoverProjectData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_List.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.cs new file mode 100644 index 00000000000..eaf1e0b1141 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.cs @@ -0,0 +1,35 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/Projects_Update.json +// this example is just showing the usage of "Project_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 StorageMoverProjectResource created on azure +// for more information of creating StorageMoverProjectResource, please refer to the document of StorageMoverProjectResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +string projectName = "examples-projectName"; +ResourceIdentifier storageMoverProjectResourceId = StorageMoverProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName, projectName); +StorageMoverProjectResource storageMoverProject = client.GetStorageMoverProjectResource(storageMoverProjectResourceId); + +// invoke the operation +StorageMoverProjectPatch patch = new StorageMoverProjectPatch(); +StorageMoverProjectResource result = await storageMoverProject.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 +StorageMoverProjectData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/Projects_Update.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.cs new file mode 100644 index 00000000000..4ce2fe62bcb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.cs @@ -0,0 +1,45 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_CreateOrUpdate.json +// this example is just showing the usage of "StorageMover_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 = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); +ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + +// get the collection of this StorageMoverResource +StorageMoverCollection collection = resourceGroupResource.GetStorageMovers(); + +// invoke the operation +string storageMoverName = "examples-storageMoverName"; +StorageMoverData data = new StorageMoverData(new AzureLocation("eastus2")) +{ + Tags = + { + ["key1"] = "value1", + ["key2"] = "value2" + }, +}; +ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageMoverName, data); +StorageMoverResource 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 +StorageMoverData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_CreateOrUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.cs new file mode 100644 index 00000000000..5ce59aed458 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.cs @@ -0,0 +1,29 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_Delete.json +// this example is just showing the usage of "StorageMover_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// invoke the operation +await storageMover.DeleteAsync(WaitUntil.Completed); + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Delete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.cs new file mode 100644 index 00000000000..8efb5ba7633 --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.cs @@ -0,0 +1,33 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_Get.json +// this example is just showing the usage of "StorageMover_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// invoke the operation +StorageMoverResource result = await storageMover.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 +StorageMoverData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Get.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.cs new file mode 100644 index 00000000000..35bc7983afb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.cs @@ -0,0 +1,38 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_List.json +// this example is just showing the usage of "StorageMover_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 ResourceGroupResource created on azure +// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); +ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + +// get the collection of this StorageMoverResource +StorageMoverCollection collection = resourceGroupResource.GetStorageMovers(); + +// invoke the operation and iterate over the result +await foreach (StorageMoverResource 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 + StorageMoverData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_List.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.cs new file mode 100644 index 00000000000..93726506e3b --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.cs @@ -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.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_ListBySubscription.json +// this example is just showing the usage of "StorageMover_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 = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); +SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + +// invoke the operation and iterate over the result +await foreach (StorageMoverResource item in subscriptionResource.GetStorageMoversAsync()) +{ + // 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 + StorageMoverData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +Console.WriteLine("Succeeded"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_ListBySubscription.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.cs b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.cs new file mode 100644 index 00000000000..2b89c334d1b --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.cs @@ -0,0 +1,34 @@ +using Azure; +using Azure.ResourceManager; +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.StorageMover.Models; +using Azure.ResourceManager.StorageMover; + +// Generated from example definition: 2025-07-01/StorageMovers_Update.json +// this example is just showing the usage of "StorageMover_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 StorageMoverResource created on azure +// for more information of creating StorageMoverResource, please refer to the document of StorageMoverResource +string subscriptionId = "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; +string resourceGroupName = "examples-rg"; +string storageMoverName = "examples-storageMoverName"; +ResourceIdentifier storageMoverResourceId = StorageMoverResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storageMoverName); +StorageMoverResource storageMover = client.GetStorageMoverResource(storageMoverResourceId); + +// invoke the operation +StorageMoverPatch patch = new StorageMoverPatch(); +StorageMoverResource result = await storageMover.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 +StorageMoverData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); diff --git a/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.json b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.json new file mode 100644 index 00000000000..de1a22a9dfb --- /dev/null +++ b/specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2025-07-01/examples-dotnet/StorageMovers_Update.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.StorageMover_1.3.0/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md"} \ No newline at end of file