diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersOperations.cs
deleted file mode 100644
index b6c615fad0c8a..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersOperations.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- /// The CodeContainers service client.
- public partial class CodeContainersOperations
- {
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly HttpPipeline _pipeline;
- internal CodeContainersRestOperations RestClient { get; }
-
- /// Initializes a new instance of CodeContainersOperations for mocking.
- protected CodeContainersOperations()
- {
- }
-
- /// Initializes a new instance of CodeContainersOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- internal CodeContainersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- RestClient = new CodeContainersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- public virtual async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, CodeContainerResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return await RestClient.CreateOrUpdateAsync(name, resourceGroupName, workspaceName, body, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- public virtual Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, CodeContainerResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return RestClient.CreateOrUpdate(name, resourceGroupName, workspaceName, body, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.Get");
- scope.Start();
- try
- {
- return await RestClient.GetAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.Get");
- scope.Start();
- try
- {
- return RestClient.Get(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.Delete");
- scope.Start();
- try
- {
- return await RestClient.DeleteAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.Delete");
- scope.Start();
- try
- {
- return RestClient.Delete(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public virtual AsyncPageable ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- async Task> FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListAsync(resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public virtual Pageable List(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- Page FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.List(resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- Page NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeContainersOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.ListNextPage(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersRestOperations.cs
deleted file mode 100644
index 1a60eb58e45de..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeContainersRestOperations.cs
+++ /dev/null
@@ -1,520 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- internal partial class CodeContainersRestOperations
- {
- private string subscriptionId;
- private Uri endpoint;
- private string apiVersion;
- private ClientDiagnostics _clientDiagnostics;
- private HttpPipeline _pipeline;
-
- /// Initializes a new instance of CodeContainersRestOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- /// or is null.
- public CodeContainersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- if (subscriptionId == null)
- {
- throw new ArgumentNullException(nameof(subscriptionId));
- }
- endpoint ??= new Uri("https://management.azure.com");
- if (apiVersion == null)
- {
- throw new ArgumentNullException(nameof(apiVersion));
- }
-
- this.subscriptionId = subscriptionId;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- internal HttpMessage CreateCreateOrUpdateRequest(string name, string resourceGroupName, string workspaceName, CodeContainerResource body)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Put;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- if (body != null)
- {
- request.Headers.Add("Content-Type", "application/json");
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(body);
- request.Content = content;
- }
- return message;
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, CodeContainerResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- CodeContainerResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeContainerResource.DeserializeCodeContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- /// , , or is null.
- public Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, CodeContainerResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- CodeContainerResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeContainerResource.DeserializeCodeContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateGetRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeContainerResource.DeserializeCodeContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeContainerResource.DeserializeCodeContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateDeleteRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Delete;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListRequest(string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes", false);
- uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
- {
- uri.AppendQuery("$skiptoken", skiptoken, true);
- }
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public async Task> ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeContainerResourceArmPaginatedResult.DeserializeCodeContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public Response List(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeContainerResourceArmPaginatedResult.DeserializeCodeContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendRawNextLink(nextLink, false);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List containers.
- /// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> ListNextPageAsync(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeContainerResourceArmPaginatedResult.DeserializeCodeContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List containers.
- /// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public Response ListNextPage(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeContainerResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeContainerResourceArmPaginatedResult.DeserializeCodeContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsOperations.cs
deleted file mode 100644
index 6341a3a2eb29e..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsOperations.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- /// The CodeVersions service client.
- public partial class CodeVersionsOperations
- {
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly HttpPipeline _pipeline;
- internal CodeVersionsRestOperations RestClient { get; }
-
- /// Initializes a new instance of CodeVersionsOperations for mocking.
- protected CodeVersionsOperations()
- {
- }
-
- /// Initializes a new instance of CodeVersionsOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- internal CodeVersionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- RestClient = new CodeVersionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- public virtual async Task> CreateOrUpdateAsync(string name, string version, string resourceGroupName, string workspaceName, CodeVersionResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return await RestClient.CreateOrUpdateAsync(name, version, resourceGroupName, workspaceName, body, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- public virtual Response CreateOrUpdate(string name, string version, string resourceGroupName, string workspaceName, CodeVersionResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return RestClient.CreateOrUpdate(name, version, resourceGroupName, workspaceName, body, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> GetAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.Get");
- scope.Start();
- try
- {
- return await RestClient.GetAsync(name, version, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Get(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.Get");
- scope.Start();
- try
- {
- return RestClient.Get(name, version, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.Delete");
- scope.Start();
- try
- {
- return await RestClient.DeleteAsync(name, version, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Delete(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.Delete");
- scope.Start();
- try
- {
- return RestClient.Delete(name, version, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public virtual AsyncPageable ListAsync(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- async Task> FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListAsync(name, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListNextPageAsync(nextLink, name, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public virtual Pageable List(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- Page FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.List(name, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- Page NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("CodeVersionsOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.ListNextPage(nextLink, name, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsRestOperations.cs
deleted file mode 100644
index 625f76955ad78..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/CodeVersionsRestOperations.cs
+++ /dev/null
@@ -1,578 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- internal partial class CodeVersionsRestOperations
- {
- private string subscriptionId;
- private Uri endpoint;
- private string apiVersion;
- private ClientDiagnostics _clientDiagnostics;
- private HttpPipeline _pipeline;
-
- /// Initializes a new instance of CodeVersionsRestOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- /// or is null.
- public CodeVersionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- if (subscriptionId == null)
- {
- throw new ArgumentNullException(nameof(subscriptionId));
- }
- endpoint ??= new Uri("https://management.azure.com");
- if (apiVersion == null)
- {
- throw new ArgumentNullException(nameof(apiVersion));
- }
-
- this.subscriptionId = subscriptionId;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- internal HttpMessage CreateCreateOrUpdateRequest(string name, string version, string resourceGroupName, string workspaceName, CodeVersionResource body)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Put;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- if (body != null)
- {
- request.Headers.Add("Content-Type", "application/json");
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(body);
- request.Content = content;
- }
- return message;
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> CreateOrUpdateAsync(string name, string version, string resourceGroupName, string workspaceName, CodeVersionResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, version, resourceGroupName, workspaceName, body);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- CodeVersionResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeVersionResource.DeserializeCodeVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response CreateOrUpdate(string name, string version, string resourceGroupName, string workspaceName, CodeVersionResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, version, resourceGroupName, workspaceName, body);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- CodeVersionResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeVersionResource.DeserializeCodeVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateGetRequest(string name, string version, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> GetAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, version, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeVersionResource.DeserializeCodeVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response Get(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, version, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeVersionResource.DeserializeCodeVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateDeleteRequest(string name, string version, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Delete;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task DeleteAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, version, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response Delete(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, version, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListRequest(string name, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/codes/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions", false);
- uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
- {
- uri.AppendQuery("$skiptoken", skiptoken, true);
- }
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> ListAsync(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(name, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeVersionResourceArmPaginatedResult.DeserializeCodeVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public Response List(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(name, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeVersionResourceArmPaginatedResult.DeserializeCodeVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListNextPageRequest(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendRawNextLink(nextLink, false);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List versions.
- /// The URL to the next page of results.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> ListNextPageAsync(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, name, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = CodeVersionResourceArmPaginatedResult.DeserializeCodeVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List versions.
- /// The URL to the next page of results.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response ListNextPage(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, name, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- CodeVersionResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = CodeVersionResourceArmPaginatedResult.DeserializeCodeVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateHeaders.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateHeaders.cs
similarity index 78%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateHeaders.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateHeaders.cs
index cfbc8056b9c67..b25b76e5524ed 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateHeaders.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateHeaders.cs
@@ -10,10 +10,10 @@
namespace Azure.ResourceManager.MachineLearningServices
{
- internal partial class MachineLearningComputeCreateOrUpdateHeaders
+ internal partial class ComputeCreateOrUpdateHeaders
{
private readonly Response _response;
- public MachineLearningComputeCreateOrUpdateHeaders(Response response)
+ public ComputeCreateOrUpdateHeaders(Response response)
{
_response = response;
}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateOperation.cs
similarity index 83%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateOperation.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateOperation.cs
index 0287ac30fddad..7bdfbfa5be5b4 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeCreateOrUpdateOperation.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeCreateOrUpdateOperation.cs
@@ -17,18 +17,18 @@
namespace Azure.ResourceManager.MachineLearningServices
{
/// Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet.
- public partial class MachineLearningComputeCreateOrUpdateOperation : Operation, IOperationSource
+ public partial class ComputeCreateOrUpdateOperation : Operation, IOperationSource
{
private readonly ArmOperationHelpers _operation;
- /// Initializes a new instance of MachineLearningComputeCreateOrUpdateOperation for mocking.
- protected MachineLearningComputeCreateOrUpdateOperation()
+ /// Initializes a new instance of ComputeCreateOrUpdateOperation for mocking.
+ protected ComputeCreateOrUpdateOperation()
{
}
- internal MachineLearningComputeCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ internal ComputeCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
- _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "MachineLearningComputeCreateOrUpdateOperation");
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeCreateOrUpdateOperation");
}
///
public override string Id => _operation.Id;
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteHeaders.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteHeaders.cs
similarity index 84%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteHeaders.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteHeaders.cs
index dbbeae529358c..898cfa9955f34 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteHeaders.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteHeaders.cs
@@ -10,10 +10,10 @@
namespace Azure.ResourceManager.MachineLearningServices
{
- internal partial class MachineLearningComputeDeleteHeaders
+ internal partial class ComputeDeleteHeaders
{
private readonly Response _response;
- public MachineLearningComputeDeleteHeaders(Response response)
+ public ComputeDeleteHeaders(Response response)
{
_response = response;
}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteOperation.cs
similarity index 82%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteOperation.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteOperation.cs
index ddec2d35ab8e2..c6ad67e332f80 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeDeleteOperation.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeDeleteOperation.cs
@@ -15,18 +15,18 @@
namespace Azure.ResourceManager.MachineLearningServices
{
/// Deletes specified Machine Learning compute.
- public partial class MachineLearningComputeDeleteOperation : Operation, IOperationSource
+ public partial class ComputeDeleteOperation : Operation, IOperationSource
{
private readonly ArmOperationHelpers _operation;
- /// Initializes a new instance of MachineLearningComputeDeleteOperation for mocking.
- protected MachineLearningComputeDeleteOperation()
+ /// Initializes a new instance of ComputeDeleteOperation for mocking.
+ protected ComputeDeleteOperation()
{
}
- internal MachineLearningComputeDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ internal ComputeDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
- _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "MachineLearningComputeDeleteOperation");
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeDeleteOperation");
}
///
public override string Id => _operation.Id;
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeOperations.cs
similarity index 54%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeOperations.cs
index 93b2565798131..54be8ef55616c 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeOperations.cs
@@ -15,39 +15,39 @@
namespace Azure.ResourceManager.MachineLearningServices
{
- /// The MachineLearningCompute service client.
- public partial class MachineLearningComputeOperations
+ /// The Compute service client.
+ public partial class ComputeOperations
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly HttpPipeline _pipeline;
- internal MachineLearningComputeRestOperations RestClient { get; }
+ internal ComputeRestOperations RestClient { get; }
- /// Initializes a new instance of MachineLearningComputeOperations for mocking.
- protected MachineLearningComputeOperations()
+ /// Initializes a new instance of ComputeOperations for mocking.
+ protected ComputeOperations()
{
}
- /// Initializes a new instance of MachineLearningComputeOperations.
+ /// Initializes a new instance of ComputeOperations.
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
+ /// The ID of the target subscription.
/// server parameter.
/// Api Version.
- internal MachineLearningComputeOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
+ internal ComputeOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01")
{
- RestClient = new MachineLearningComputeRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
+ RestClient = new ComputeRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
/// Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
public virtual async Task> GetAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Get");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.Get");
scope.Start();
try
{
@@ -61,13 +61,13 @@ public virtual async Task> GetAsync(string resourceGro
}
/// Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
public virtual Response Get(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Get");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.Get");
scope.Start();
try
{
@@ -80,54 +80,14 @@ public virtual Response Get(string resourceGroupName, string wo
}
}
- /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
- /// The cancellation token to use.
- public virtual async Task> ListNodesAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListNodes");
- scope.Start();
- try
- {
- return await RestClient.ListNodesAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
- /// The cancellation token to use.
- public virtual Response ListNodes(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListNodes");
- scope.Start();
- try
- {
- return RestClient.ListNodes(resourceGroupName, workspaceName, computeName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
/// Gets secrets related to Machine Learning compute (storage keys, service credentials, etc).
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
public virtual async Task> ListKeysAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListKeys");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListKeys");
scope.Start();
try
{
@@ -141,13 +101,13 @@ public virtual async Task> ListKeysAsync(string resourc
}
/// Gets secrets related to Machine Learning compute (storage keys, service credentials, etc).
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
public virtual Response ListKeys(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListKeys");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListKeys");
scope.Start();
try
{
@@ -160,133 +120,113 @@ public virtual Response ListKeys(string resourceGroupName, strin
}
}
- /// Posts a start action to a compute instance.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
- /// The cancellation token to use.
- public virtual async Task StartAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Start");
- scope.Start();
- try
- {
- return await RestClient.StartAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Posts a start action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// Gets computes in specified workspace.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
+ /// Continuation token for pagination.
/// The cancellation token to use.
- public virtual Response Start(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ /// or is null.
+ public virtual AsyncPageable ListAsync(string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Start");
- scope.Start();
- try
+ if (resourceGroupName == null)
{
- return RestClient.Start(resourceGroupName, workspaceName, computeName, cancellationToken);
+ throw new ArgumentNullException(nameof(resourceGroupName));
}
- catch (Exception e)
+ if (workspaceName == null)
{
- scope.Failed(e);
- throw;
+ throw new ArgumentNullException(nameof(workspaceName));
}
- }
- /// Posts a stop action to a compute instance.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
- /// The cancellation token to use.
- public virtual async Task StopAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Stop");
- scope.Start();
- try
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- return await RestClient.StopAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.List");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListAsync(resourceGroupName, workspaceName, skip, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
- catch (Exception e)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- scope.Failed(e);
- throw;
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.List");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, workspaceName, skip, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
}
- /// Posts a stop action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// Gets computes in specified workspace.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
+ /// Continuation token for pagination.
/// The cancellation token to use.
- public virtual Response Stop(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ /// or is null.
+ public virtual Pageable List(string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Stop");
- scope.Start();
- try
+ if (resourceGroupName == null)
{
- return RestClient.Stop(resourceGroupName, workspaceName, computeName, cancellationToken);
+ throw new ArgumentNullException(nameof(resourceGroupName));
}
- catch (Exception e)
+ if (workspaceName == null)
{
- scope.Failed(e);
- throw;
+ throw new ArgumentNullException(nameof(workspaceName));
}
- }
- /// Posts a restart action to a compute instance.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Name of the Azure Machine Learning compute.
- /// The cancellation token to use.
- public virtual async Task RestartAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Restart");
- scope.Start();
- try
+ Page FirstPageFunc(int? pageSizeHint)
{
- return await RestClient.RestartAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.List");
+ scope.Start();
+ try
+ {
+ var response = RestClient.List(resourceGroupName, workspaceName, skip, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
- catch (Exception e)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- scope.Failed(e);
- throw;
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.List");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListNextPage(nextLink, resourceGroupName, workspaceName, skip, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
- /// Posts a restart action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
- public virtual Response Restart(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.Restart");
- scope.Start();
- try
- {
- return RestClient.Restart(resourceGroupName, workspaceName, computeName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Gets computes in specified workspace.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public virtual AsyncPageable ListByWorkspaceAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ /// , , or is null.
+ public virtual AsyncPageable ListNodesAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -296,15 +236,19 @@ public virtual AsyncPageable ListByWorkspaceAsync(string resour
{
throw new ArgumentNullException(nameof(workspaceName));
}
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListByWorkspace");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListNodes");
scope.Start();
try
{
- var response = await RestClient.ListByWorkspaceAsync(resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await RestClient.ListNodesAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Nodes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -312,14 +256,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListByWorkspace");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListNodes");
scope.Start();
try
{
- var response = await RestClient.ListByWorkspaceNextPageAsync(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await RestClient.ListNodesNextPageAsync(nextLink, resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Nodes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -330,13 +274,13 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHin
return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
}
- /// Gets computes in specified workspace.
- /// Name of the resource group in which workspace is located.
+ /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
+ /// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
- /// or is null.
- public virtual Pageable ListByWorkspace(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ /// , , or is null.
+ public virtual Pageable ListNodes(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -346,15 +290,19 @@ public virtual Pageable ListByWorkspace(string resourceGroupNam
{
throw new ArgumentNullException(nameof(workspaceName));
}
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListByWorkspace");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListNodes");
scope.Start();
try
{
- var response = RestClient.ListByWorkspace(resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = RestClient.ListNodes(resourceGroupName, workspaceName, computeName, cancellationToken);
+ return Page.FromValues(response.Value.Nodes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -362,14 +310,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.ListByWorkspace");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.ListNodes");
scope.Start();
try
{
- var response = RestClient.ListByWorkspaceNextPage(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = RestClient.ListNodesNextPage(nextLink, resourceGroupName, workspaceName, computeName, cancellationToken);
+ return Page.FromValues(response.Value.Nodes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -381,13 +329,13 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
/// Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Payload with Machine Learning compute definition.
/// The cancellation token to use.
/// , , , or is null.
- public virtual async Task StartCreateOrUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
+ public virtual async Task StartCreateOrUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -406,12 +354,12 @@ public virtual async Task StartCr
throw new ArgumentNullException(nameof(parameters));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartCreateOrUpdate");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartCreateOrUpdate");
scope.Start();
try
{
var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, cancellationToken).ConfigureAwait(false);
- return new MachineLearningComputeCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
+ return new ComputeCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
}
catch (Exception e)
{
@@ -421,13 +369,13 @@ public virtual async Task StartCr
}
/// Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Payload with Machine Learning compute definition.
/// The cancellation token to use.
/// , , , or is null.
- public virtual MachineLearningComputeCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
+ public virtual ComputeCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -446,12 +394,12 @@ public virtual MachineLearningComputeCreateOrUpdateOperation StartCreateOrUpdate
throw new ArgumentNullException(nameof(parameters));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartCreateOrUpdate");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartCreateOrUpdate");
scope.Start();
try
{
var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, workspaceName, computeName, parameters, cancellationToken);
- return new MachineLearningComputeCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
+ return new ComputeCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
}
catch (Exception e)
{
@@ -461,13 +409,13 @@ public virtual MachineLearningComputeCreateOrUpdateOperation StartCreateOrUpdate
}
/// Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Additional parameters for cluster update.
/// The cancellation token to use.
/// , , , or is null.
- public virtual async Task StartUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default)
+ public virtual async Task StartUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -486,12 +434,12 @@ public virtual async Task StartUpdateAsyn
throw new ArgumentNullException(nameof(parameters));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartUpdate");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartUpdate");
scope.Start();
try
{
var originalResponse = await RestClient.UpdateAsync(resourceGroupName, workspaceName, computeName, parameters, cancellationToken).ConfigureAwait(false);
- return new MachineLearningComputeUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
+ return new ComputeUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
}
catch (Exception e)
{
@@ -501,13 +449,13 @@ public virtual async Task StartUpdateAsyn
}
/// Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Additional parameters for cluster update.
/// The cancellation token to use.
/// , , , or is null.
- public virtual MachineLearningComputeUpdateOperation StartUpdate(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default)
+ public virtual ComputeUpdateOperation StartUpdate(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -526,12 +474,12 @@ public virtual MachineLearningComputeUpdateOperation StartUpdate(string resource
throw new ArgumentNullException(nameof(parameters));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartUpdate");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartUpdate");
scope.Start();
try
{
var originalResponse = RestClient.Update(resourceGroupName, workspaceName, computeName, parameters, cancellationToken);
- return new MachineLearningComputeUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
+ return new ComputeUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, workspaceName, computeName, parameters).Request, originalResponse);
}
catch (Exception e)
{
@@ -541,13 +489,13 @@ public virtual MachineLearningComputeUpdateOperation StartUpdate(string resource
}
/// Deletes specified Machine Learning compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'.
/// The cancellation token to use.
/// , , or is null.
- public virtual async Task StartDeleteAsync(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
+ public virtual async Task StartDeleteAsync(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -562,12 +510,12 @@ public virtual async Task StartDeleteAsyn
throw new ArgumentNullException(nameof(computeName));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartDelete");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartDelete");
scope.Start();
try
{
var originalResponse = await RestClient.DeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, cancellationToken).ConfigureAwait(false);
- return new MachineLearningComputeDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction).Request, originalResponse);
+ return new ComputeDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction).Request, originalResponse);
}
catch (Exception e)
{
@@ -577,13 +525,13 @@ public virtual async Task StartDeleteAsyn
}
/// Deletes specified Machine Learning compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'.
/// The cancellation token to use.
/// , , or is null.
- public virtual MachineLearningComputeDeleteOperation StartDelete(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
+ public virtual ComputeDeleteOperation StartDelete(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -598,12 +546,222 @@ public virtual MachineLearningComputeDeleteOperation StartDelete(string resource
throw new ArgumentNullException(nameof(computeName));
}
- using var scope = _clientDiagnostics.CreateScope("MachineLearningComputeOperations.StartDelete");
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartDelete");
scope.Start();
try
{
var originalResponse = RestClient.Delete(resourceGroupName, workspaceName, computeName, underlyingResourceAction, cancellationToken);
- return new MachineLearningComputeDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction).Request, originalResponse);
+ return new ComputeDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a start action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartStartAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartStart");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.StartAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ return new ComputeStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a start action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual ComputeStartOperation StartStart(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartStart");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Start(resourceGroupName, workspaceName, computeName, cancellationToken);
+ return new ComputeStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a stop action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartStopAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartStop");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.StopAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ return new ComputeStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a stop action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual ComputeStopOperation StartStop(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartStop");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Stop(resourceGroupName, workspaceName, computeName, cancellationToken);
+ return new ComputeStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a restart action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartRestartAsync(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartRestart");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.RestartAsync(resourceGroupName, workspaceName, computeName, cancellationToken).ConfigureAwait(false);
+ return new ComputeRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRestartRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Posts a restart action to a compute instance.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual ComputeRestartOperation StartRestart(string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("ComputeOperations.StartRestart");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Restart(resourceGroupName, workspaceName, computeName, cancellationToken);
+ return new ComputeRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRestartRequest(resourceGroupName, workspaceName, computeName).Request, originalResponse);
}
catch (Exception e)
{
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestOperations.cs
similarity index 82%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeRestOperations.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestOperations.cs
index 746f7610a82a9..49333e91649ec 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeRestOperations.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestOperations.cs
@@ -16,7 +16,7 @@
namespace Azure.ResourceManager.MachineLearningServices
{
- internal partial class MachineLearningComputeRestOperations
+ internal partial class ComputeRestOperations
{
private string subscriptionId;
private Uri endpoint;
@@ -24,14 +24,14 @@ internal partial class MachineLearningComputeRestOperations
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
- /// Initializes a new instance of MachineLearningComputeRestOperations.
+ /// Initializes a new instance of ComputeRestOperations.
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
+ /// The ID of the target subscription.
/// server parameter.
/// Api Version.
/// or is null.
- public MachineLearningComputeRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
+ public ComputeRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01")
{
if (subscriptionId == null)
{
@@ -50,7 +50,7 @@ public MachineLearningComputeRestOperations(ClientDiagnostics clientDiagnostics,
_pipeline = pipeline;
}
- internal HttpMessage CreateListByWorkspaceRequest(string resourceGroupName, string workspaceName, string skiptoken)
+ internal HttpMessage CreateListRequest(string resourceGroupName, string workspaceName, string skip)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -65,9 +65,9 @@ internal HttpMessage CreateListByWorkspaceRequest(string resourceGroupName, stri
uri.AppendPath(workspaceName, true);
uri.AppendPath("/computes", false);
uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
+ if (skip != null)
{
- uri.AppendQuery("$skiptoken", skiptoken, true);
+ uri.AppendQuery("$skip", skip, true);
}
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -75,12 +75,12 @@ internal HttpMessage CreateListByWorkspaceRequest(string resourceGroupName, stri
}
/// Gets computes in specified workspace.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
+ /// Continuation token for pagination.
/// The cancellation token to use.
/// or is null.
- public async Task> ListByWorkspaceAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ public async Task> ListAsync(string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -91,7 +91,7 @@ public async Task> ListByWorkspaceAsync(
throw new ArgumentNullException(nameof(workspaceName));
}
- using var message = CreateListByWorkspaceRequest(resourceGroupName, workspaceName, skiptoken);
+ using var message = CreateListRequest(resourceGroupName, workspaceName, skip);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -108,12 +108,12 @@ public async Task> ListByWorkspaceAsync(
}
/// Gets computes in specified workspace.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
+ /// Continuation token for pagination.
/// The cancellation token to use.
/// or is null.
- public Response ListByWorkspace(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ public Response List(string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -124,7 +124,7 @@ public Response ListByWorkspace(string resourceGr
throw new ArgumentNullException(nameof(workspaceName));
}
- using var message = CreateListByWorkspaceRequest(resourceGroupName, workspaceName, skiptoken);
+ using var message = CreateListRequest(resourceGroupName, workspaceName, skip);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@@ -162,7 +162,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string workspace
}
/// Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -199,7 +199,7 @@ public async Task> GetAsync(string resourceGroupName,
}
/// Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -261,13 +261,13 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin
}
/// Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Payload with Machine Learning compute definition.
/// The cancellation token to use.
/// , , , or is null.
- public async Task> CreateOrUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
+ public async Task> CreateOrUpdateAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -288,7 +288,7 @@ public async Task Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Payload with Machine Learning compute definition.
/// The cancellation token to use.
/// , , , or is null.
- public ResponseWithHeaders CreateOrUpdate(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders CreateOrUpdate(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -327,7 +327,7 @@ public ResponseWithHeaders CreateOr
using var message = CreateCreateOrUpdateRequest(resourceGroupName, workspaceName, computeName, parameters);
_pipeline.Send(message, cancellationToken);
- var headers = new MachineLearningComputeCreateOrUpdateHeaders(message.Response);
+ var headers = new ComputeCreateOrUpdateHeaders(message.Response);
switch (message.Response.Status)
{
case 200:
@@ -364,7 +364,7 @@ internal HttpMessage CreateUpdateRequest(string resourceGroupName, string worksp
}
/// Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Additional parameters for cluster update.
@@ -401,7 +401,7 @@ public async Task UpdateAsync(string resourceGroupName, string workspa
}
/// Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Additional parameters for cluster update.
@@ -460,13 +460,13 @@ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string worksp
}
/// Deletes specified Machine Learning compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'.
/// The cancellation token to use.
/// , , or is null.
- public async Task> DeleteAsync(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
+ public async Task> DeleteAsync(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -483,7 +483,7 @@ public async Task> Dele
using var message = CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- var headers = new MachineLearningComputeDeleteHeaders(message.Response);
+ var headers = new ComputeDeleteHeaders(message.Response);
switch (message.Response.Status)
{
case 200:
@@ -495,13 +495,13 @@ public async Task> Dele
}
/// Deletes specified Machine Learning compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'.
/// The cancellation token to use.
/// , , or is null.
- public ResponseWithHeaders Delete(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
+ public ResponseWithHeaders Delete(string resourceGroupName, string workspaceName, string computeName, UnderlyingResourceAction underlyingResourceAction, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@@ -518,7 +518,7 @@ public ResponseWithHeaders Delete(string re
using var message = CreateDeleteRequest(resourceGroupName, workspaceName, computeName, underlyingResourceAction);
_pipeline.Send(message, cancellationToken);
- var headers = new MachineLearningComputeDeleteHeaders(message.Response);
+ var headers = new ComputeDeleteHeaders(message.Response);
switch (message.Response.Status)
{
case 200:
@@ -552,7 +552,7 @@ internal HttpMessage CreateListNodesRequest(string resourceGroupName, string wor
}
/// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -589,7 +589,7 @@ public async Task> ListNodesAsync(string re
}
/// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -648,7 +648,7 @@ internal HttpMessage CreateListKeysRequest(string resourceGroupName, string work
}
/// Gets secrets related to Machine Learning compute (storage keys, service credentials, etc).
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -685,7 +685,7 @@ public async Task> ListKeysAsync(string resourceGroupNa
}
/// Gets secrets related to Machine Learning compute (storage keys, service credentials, etc).
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -744,7 +744,7 @@ internal HttpMessage CreateStartRequest(string resourceGroupName, string workspa
}
/// Posts a start action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -768,7 +768,7 @@ public async Task StartAsync(string resourceGroupName, string workspac
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
@@ -776,7 +776,7 @@ public async Task StartAsync(string resourceGroupName, string workspac
}
/// Posts a start action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -800,7 +800,7 @@ public Response Start(string resourceGroupName, string workspaceName, string com
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
@@ -830,7 +830,7 @@ internal HttpMessage CreateStopRequest(string resourceGroupName, string workspac
}
/// Posts a stop action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -854,7 +854,7 @@ public async Task StopAsync(string resourceGroupName, string workspace
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
@@ -862,7 +862,7 @@ public async Task StopAsync(string resourceGroupName, string workspace
}
/// Posts a stop action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -886,7 +886,7 @@ public Response Stop(string resourceGroupName, string workspaceName, string comp
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
@@ -916,7 +916,7 @@ internal HttpMessage CreateRestartRequest(string resourceGroupName, string works
}
/// Posts a restart action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -940,7 +940,7 @@ public async Task RestartAsync(string resourceGroupName, string worksp
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
@@ -948,7 +948,7 @@ public async Task RestartAsync(string resourceGroupName, string worksp
}
/// Posts a restart action to a compute instance.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
/// Name of the Azure Machine Learning compute.
/// The cancellation token to use.
@@ -972,14 +972,14 @@ public Response Restart(string resourceGroupName, string workspaceName, string c
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
- case 200:
+ case 202:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
- internal HttpMessage CreateListByWorkspaceNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string skiptoken)
+ internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string skip)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -994,12 +994,12 @@ internal HttpMessage CreateListByWorkspaceNextPageRequest(string nextLink, strin
/// Gets computes in specified workspace.
/// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
+ /// Continuation token for pagination.
/// The cancellation token to use.
/// , , or is null.
- public async Task> ListByWorkspaceNextPageAsync(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ public async Task> ListNextPageAsync(string nextLink, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
if (nextLink == null)
{
@@ -1014,7 +1014,7 @@ public async Task> ListByWorkspaceNextPa
throw new ArgumentNullException(nameof(workspaceName));
}
- using var message = CreateListByWorkspaceNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
+ using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skip);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -1032,12 +1032,12 @@ public async Task> ListByWorkspaceNextPa
/// Gets computes in specified workspace.
/// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
+ /// The name of the resource group. The name is case insensitive.
/// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
+ /// Continuation token for pagination.
/// The cancellation token to use.
/// , , or is null.
- public Response ListByWorkspaceNextPage(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
+ public Response ListNextPage(string nextLink, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default)
{
if (nextLink == null)
{
@@ -1052,7 +1052,7 @@ public Response ListByWorkspaceNextPage(string ne
throw new ArgumentNullException(nameof(workspaceName));
}
- using var message = CreateListByWorkspaceNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
+ using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skip);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@@ -1067,5 +1067,102 @@ public Response ListByWorkspaceNextPage(string ne
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
+
+ internal HttpMessage CreateListNodesNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string computeName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
+ /// The URL to the next page of results.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task> ListNodesNextPageAsync(string nextLink, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var message = CreateListNodesNextPageRequest(nextLink, resourceGroupName, workspaceName, computeName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ AmlComputeNodesInformation value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = AmlComputeNodesInformation.DeserializeAmlComputeNodesInformation(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute.
+ /// The URL to the next page of results.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of Azure Machine Learning workspace.
+ /// Name of the Azure Machine Learning compute.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response ListNodesNextPage(string nextLink, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (workspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(workspaceName));
+ }
+ if (computeName == null)
+ {
+ throw new ArgumentNullException(nameof(computeName));
+ }
+
+ using var message = CreateListNodesNextPageRequest(nextLink, resourceGroupName, workspaceName, computeName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ AmlComputeNodesInformation value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = AmlComputeNodesInformation.DeserializeAmlComputeNodesInformation(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
}
}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestartOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestartOperation.cs
new file mode 100644
index 0000000000000..2e626cf05e542
--- /dev/null
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeRestartOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.MachineLearningServices
+{
+ /// Posts a restart action to a compute instance.
+ public partial class ComputeRestartOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of ComputeRestartOperation for mocking.
+ protected ComputeRestartOperation()
+ {
+ }
+
+ internal ComputeRestartOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeRestartOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStartOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStartOperation.cs
new file mode 100644
index 0000000000000..f51ffb5b039e0
--- /dev/null
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStartOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.MachineLearningServices
+{
+ /// Posts a start action to a compute instance.
+ public partial class ComputeStartOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of ComputeStartOperation for mocking.
+ protected ComputeStartOperation()
+ {
+ }
+
+ internal ComputeStartOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeStartOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStopOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStopOperation.cs
new file mode 100644
index 0000000000000..9ee4910e6cb33
--- /dev/null
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeStopOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.MachineLearningServices
+{
+ /// Posts a stop action to a compute instance.
+ public partial class ComputeStopOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of ComputeStopOperation for mocking.
+ protected ComputeStopOperation()
+ {
+ }
+
+ internal ComputeStopOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeStopOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeUpdateOperation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeUpdateOperation.cs
similarity index 84%
rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeUpdateOperation.cs
rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeUpdateOperation.cs
index 5244479fe8362..3bd1cf16a22c7 100644
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/MachineLearningComputeUpdateOperation.cs
+++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/ComputeUpdateOperation.cs
@@ -17,18 +17,18 @@
namespace Azure.ResourceManager.MachineLearningServices
{
/// Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation.
- public partial class MachineLearningComputeUpdateOperation : Operation, IOperationSource
+ public partial class ComputeUpdateOperation : Operation, IOperationSource
{
private readonly ArmOperationHelpers _operation;
- /// Initializes a new instance of MachineLearningComputeUpdateOperation for mocking.
- protected MachineLearningComputeUpdateOperation()
+ /// Initializes a new instance of ComputeUpdateOperation for mocking.
+ protected ComputeUpdateOperation()
{
}
- internal MachineLearningComputeUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ internal ComputeUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
- _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "MachineLearningComputeUpdateOperation");
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ComputeUpdateOperation");
}
///
public override string Id => _operation.Id;
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersOperations.cs
deleted file mode 100644
index 91a96752adcab..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersOperations.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- /// The DataContainers service client.
- public partial class DataContainersOperations
- {
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly HttpPipeline _pipeline;
- internal DataContainersRestOperations RestClient { get; }
-
- /// Initializes a new instance of DataContainersOperations for mocking.
- protected DataContainersOperations()
- {
- }
-
- /// Initializes a new instance of DataContainersOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- internal DataContainersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- RestClient = new DataContainersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- public virtual async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, DataContainerResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return await RestClient.CreateOrUpdateAsync(name, resourceGroupName, workspaceName, body, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- public virtual Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, DataContainerResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return RestClient.CreateOrUpdate(name, resourceGroupName, workspaceName, body, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.Get");
- scope.Start();
- try
- {
- return await RestClient.GetAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.Get");
- scope.Start();
- try
- {
- return RestClient.Get(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.Delete");
- scope.Start();
- try
- {
- return await RestClient.DeleteAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.Delete");
- scope.Start();
- try
- {
- return RestClient.Delete(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public virtual AsyncPageable ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- async Task> FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListAsync(resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public virtual Pageable List(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- Page FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.List(resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- Page NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataContainersOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.ListNextPage(nextLink, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersRestOperations.cs
deleted file mode 100644
index a11622e7ab52c..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataContainersRestOperations.cs
+++ /dev/null
@@ -1,520 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- internal partial class DataContainersRestOperations
- {
- private string subscriptionId;
- private Uri endpoint;
- private string apiVersion;
- private ClientDiagnostics _clientDiagnostics;
- private HttpPipeline _pipeline;
-
- /// Initializes a new instance of DataContainersRestOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- /// or is null.
- public DataContainersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- if (subscriptionId == null)
- {
- throw new ArgumentNullException(nameof(subscriptionId));
- }
- endpoint ??= new Uri("https://management.azure.com");
- if (apiVersion == null)
- {
- throw new ArgumentNullException(nameof(apiVersion));
- }
-
- this.subscriptionId = subscriptionId;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- internal HttpMessage CreateCreateOrUpdateRequest(string name, string resourceGroupName, string workspaceName, DataContainerResource body)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Put;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- if (body != null)
- {
- request.Headers.Add("Content-Type", "application/json");
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(body);
- request.Content = content;
- }
- return message;
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, DataContainerResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DataContainerResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataContainerResource.DeserializeDataContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Create or update container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Container entity to create or update.
- /// The cancellation token to use.
- /// , , or is null.
- public Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, DataContainerResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DataContainerResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataContainerResource.DeserializeDataContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateGetRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataContainerResource.DeserializeDataContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataContainerResource.DeserializeDataContainerResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateDeleteRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Delete;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Delete container.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListRequest(string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data", false);
- uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
- {
- uri.AppendQuery("$skiptoken", skiptoken, true);
- }
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public async Task> ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataContainerResourceArmPaginatedResult.DeserializeDataContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List containers.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// or is null.
- public Response List(string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataContainerResourceArmPaginatedResult.DeserializeDataContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendRawNextLink(nextLink, false);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List containers.
- /// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> ListNextPageAsync(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataContainerResourceArmPaginatedResult.DeserializeDataContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List containers.
- /// The URL to the next page of results.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public Response ListNextPage(string nextLink, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataContainerResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataContainerResourceArmPaginatedResult.DeserializeDataContainerResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsOperations.cs
deleted file mode 100644
index 3f91c728c16d1..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsOperations.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- /// The DataVersions service client.
- public partial class DataVersionsOperations
- {
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly HttpPipeline _pipeline;
- internal DataVersionsRestOperations RestClient { get; }
-
- /// Initializes a new instance of DataVersionsOperations for mocking.
- protected DataVersionsOperations()
- {
- }
-
- /// Initializes a new instance of DataVersionsOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- internal DataVersionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- RestClient = new DataVersionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- public virtual async Task> CreateOrUpdateAsync(string name, string version, string resourceGroupName, string workspaceName, DataVersionResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return await RestClient.CreateOrUpdateAsync(name, version, resourceGroupName, workspaceName, body, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- public virtual Response CreateOrUpdate(string name, string version, string resourceGroupName, string workspaceName, DataVersionResource body = null, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return RestClient.CreateOrUpdate(name, version, resourceGroupName, workspaceName, body, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> GetAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.Get");
- scope.Start();
- try
- {
- return await RestClient.GetAsync(name, version, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Get(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.Get");
- scope.Start();
- try
- {
- return RestClient.Get(name, version, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.Delete");
- scope.Start();
- try
- {
- return await RestClient.DeleteAsync(name, version, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Delete(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.Delete");
- scope.Start();
- try
- {
- return RestClient.Delete(name, version, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public virtual AsyncPageable ListAsync(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- async Task> FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListAsync(name, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListNextPageAsync(nextLink, name, resourceGroupName, workspaceName, skiptoken, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public virtual Pageable List(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- Page FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.List(name, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- Page NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DataVersionsOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.ListNextPage(nextLink, name, resourceGroupName, workspaceName, skiptoken, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsRestOperations.cs
deleted file mode 100644
index 9749162891ca1..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DataVersionsRestOperations.cs
+++ /dev/null
@@ -1,578 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- internal partial class DataVersionsRestOperations
- {
- private string subscriptionId;
- private Uri endpoint;
- private string apiVersion;
- private ClientDiagnostics _clientDiagnostics;
- private HttpPipeline _pipeline;
-
- /// Initializes a new instance of DataVersionsRestOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- /// or is null.
- public DataVersionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- if (subscriptionId == null)
- {
- throw new ArgumentNullException(nameof(subscriptionId));
- }
- endpoint ??= new Uri("https://management.azure.com");
- if (apiVersion == null)
- {
- throw new ArgumentNullException(nameof(apiVersion));
- }
-
- this.subscriptionId = subscriptionId;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- internal HttpMessage CreateCreateOrUpdateRequest(string name, string version, string resourceGroupName, string workspaceName, DataVersionResource body)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Put;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- if (body != null)
- {
- request.Headers.Add("Content-Type", "application/json");
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(body);
- request.Content = content;
- }
- return message;
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> CreateOrUpdateAsync(string name, string version, string resourceGroupName, string workspaceName, DataVersionResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, version, resourceGroupName, workspaceName, body);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DataVersionResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataVersionResource.DeserializeDataVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Create or update version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Version entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response CreateOrUpdate(string name, string version, string resourceGroupName, string workspaceName, DataVersionResource body = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, version, resourceGroupName, workspaceName, body);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DataVersionResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataVersionResource.DeserializeDataVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateGetRequest(string name, string version, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> GetAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, version, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataVersionResource.DeserializeDataVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response Get(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, version, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataVersionResource.DeserializeDataVersionResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateDeleteRequest(string name, string version, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Delete;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions/", false);
- uri.AppendPath(version, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task DeleteAsync(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, version, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Delete version.
- /// Container name.
- /// Version identifier.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response Delete(string name, string version, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (version == null)
- {
- throw new ArgumentNullException(nameof(version));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, version, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListRequest(string name, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/data/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/versions", false);
- uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
- {
- uri.AppendQuery("$skiptoken", skiptoken, true);
- }
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> ListAsync(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(name, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataVersionResourceArmPaginatedResult.DeserializeDataVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List versions.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , or is null.
- public Response List(string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(name, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataVersionResourceArmPaginatedResult.DeserializeDataVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListNextPageRequest(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendRawNextLink(nextLink, false);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List versions.
- /// The URL to the next page of results.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> ListNextPageAsync(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, name, resourceGroupName, workspaceName, skiptoken);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DataVersionResourceArmPaginatedResult.DeserializeDataVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List versions.
- /// The URL to the next page of results.
- /// Container name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response ListNextPage(string nextLink, string name, string resourceGroupName, string workspaceName, string skiptoken = null, CancellationToken cancellationToken = default)
- {
- if (nextLink == null)
- {
- throw new ArgumentNullException(nameof(nextLink));
- }
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListNextPageRequest(nextLink, name, resourceGroupName, workspaceName, skiptoken);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DataVersionResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DataVersionResourceArmPaginatedResult.DeserializeDataVersionResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresOperations.cs
deleted file mode 100644
index e5c393632c371..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresOperations.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- /// The Datastores service client.
- public partial class DatastoresOperations
- {
- private readonly ClientDiagnostics _clientDiagnostics;
- private readonly HttpPipeline _pipeline;
- internal DatastoresRestOperations RestClient { get; }
-
- /// Initializes a new instance of DatastoresOperations for mocking.
- protected DatastoresOperations()
- {
- }
-
- /// Initializes a new instance of DatastoresOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- internal DatastoresOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- RestClient = new DatastoresRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- /// Delete datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.Delete");
- scope.Start();
- try
- {
- return await RestClient.DeleteAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Delete datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.Delete");
- scope.Start();
- try
- {
- return RestClient.Delete(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.Get");
- scope.Start();
- try
- {
- return await RestClient.GetAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.Get");
- scope.Start();
- try
- {
- return RestClient.Get(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Datastore entity to create or update.
- /// The cancellation token to use.
- public virtual async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, DatastorePropertiesResource body, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return await RestClient.CreateOrUpdateAsync(name, resourceGroupName, workspaceName, body, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Create or update datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Datastore entity to create or update.
- /// The cancellation token to use.
- public virtual Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, DatastorePropertiesResource body, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.CreateOrUpdate");
- scope.Start();
- try
- {
- return RestClient.CreateOrUpdate(name, resourceGroupName, workspaceName, body, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get datastore secrets.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual async Task> ListSecretsAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.ListSecrets");
- scope.Start();
- try
- {
- return await RestClient.ListSecretsAsync(name, resourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Get datastore secrets.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- public virtual Response ListSecrets(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.ListSecrets");
- scope.Start();
- try
- {
- return RestClient.ListSecrets(name, resourceGroupName, workspaceName, cancellationToken);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// List datastores.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// Maximum number of results to return.
- /// Filter down to the workspace default datastore.
- /// Names of datastores to return.
- /// Text to search for in the datastore names.
- /// Order by property (createdtime | modifiedtime | name).
- /// Order by property in ascending order.
- /// The cancellation token to use.
- /// or is null.
- public virtual AsyncPageable ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, int? count = null, bool? isDefault = null, IEnumerable names = null, string searchText = null, string orderBy = null, bool? orderByAsc = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- async Task> FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListAsync(resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.List");
- scope.Start();
- try
- {
- var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc, cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
- }
-
- /// List datastores.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// Maximum number of results to return.
- /// Filter down to the workspace default datastore.
- /// Names of datastores to return.
- /// Text to search for in the datastore names.
- /// Order by property (createdtime | modifiedtime | name).
- /// Order by property in ascending order.
- /// The cancellation token to use.
- /// or is null.
- public virtual Pageable List(string resourceGroupName, string workspaceName, string skiptoken = null, int? count = null, bool? isDefault = null, IEnumerable names = null, string searchText = null, string orderBy = null, bool? orderByAsc = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- Page FirstPageFunc(int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.List(resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- Page NextPageFunc(string nextLink, int? pageSizeHint)
- {
- using var scope = _clientDiagnostics.CreateScope("DatastoresOperations.List");
- scope.Start();
- try
- {
- var response = RestClient.ListNextPage(nextLink, resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc, cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
- }
- }
-}
diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresRestOperations.cs
deleted file mode 100644
index 63c0d0c7f215b..0000000000000
--- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearningServices/src/Generated/DatastoresRestOperations.cs
+++ /dev/null
@@ -1,670 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.MachineLearningServices.Models;
-
-namespace Azure.ResourceManager.MachineLearningServices
-{
- internal partial class DatastoresRestOperations
- {
- private string subscriptionId;
- private Uri endpoint;
- private string apiVersion;
- private ClientDiagnostics _clientDiagnostics;
- private HttpPipeline _pipeline;
-
- /// Initializes a new instance of DatastoresRestOperations.
- /// The handler for diagnostic messaging in the client.
- /// The HTTP pipeline for sending and receiving REST requests and responses.
- /// Azure subscription identifier.
- /// server parameter.
- /// Api Version.
- /// or is null.
- public DatastoresRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-09-01-preview")
- {
- if (subscriptionId == null)
- {
- throw new ArgumentNullException(nameof(subscriptionId));
- }
- endpoint ??= new Uri("https://management.azure.com");
- if (apiVersion == null)
- {
- throw new ArgumentNullException(nameof(apiVersion));
- }
-
- this.subscriptionId = subscriptionId;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- _clientDiagnostics = clientDiagnostics;
- _pipeline = pipeline;
- }
-
- internal HttpMessage CreateListRequest(string resourceGroupName, string workspaceName, string skiptoken, int? count, bool? isDefault, IEnumerable names, string searchText, string orderBy, bool? orderByAsc)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/datastores", false);
- uri.AppendQuery("api-version", apiVersion, true);
- if (skiptoken != null)
- {
- uri.AppendQuery("$skiptoken", skiptoken, true);
- }
- if (count != null)
- {
- uri.AppendQuery("count", count.Value, true);
- }
- if (isDefault != null)
- {
- uri.AppendQuery("isDefault", isDefault.Value, true);
- }
- if (names != null)
- {
- uri.AppendQueryDelimited("names", names, ",", true);
- }
- if (searchText != null)
- {
- uri.AppendQuery("searchText", searchText, true);
- }
- if (orderBy != null)
- {
- uri.AppendQuery("orderBy", orderBy, true);
- }
- if (orderByAsc != null)
- {
- uri.AppendQuery("orderByAsc", orderByAsc.Value, true);
- }
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// List datastores.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// Maximum number of results to return.
- /// Filter down to the workspace default datastore.
- /// Names of datastores to return.
- /// Text to search for in the datastore names.
- /// Order by property (createdtime | modifiedtime | name).
- /// Order by property in ascending order.
- /// The cancellation token to use.
- /// or is null.
- public async Task> ListAsync(string resourceGroupName, string workspaceName, string skiptoken = null, int? count = null, bool? isDefault = null, IEnumerable names = null, string searchText = null, string orderBy = null, bool? orderByAsc = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastorePropertiesResourceArmPaginatedResult value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DatastorePropertiesResourceArmPaginatedResult.DeserializeDatastorePropertiesResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// List datastores.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Continuation token for pagination.
- /// Maximum number of results to return.
- /// Filter down to the workspace default datastore.
- /// Names of datastores to return.
- /// Text to search for in the datastore names.
- /// Order by property (createdtime | modifiedtime | name).
- /// Order by property in ascending order.
- /// The cancellation token to use.
- /// or is null.
- public Response List(string resourceGroupName, string workspaceName, string skiptoken = null, int? count = null, bool? isDefault = null, IEnumerable names = null, string searchText = null, string orderBy = null, bool? orderByAsc = null, CancellationToken cancellationToken = default)
- {
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListRequest(resourceGroupName, workspaceName, skiptoken, count, isDefault, names, searchText, orderBy, orderByAsc);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastorePropertiesResourceArmPaginatedResult value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DatastorePropertiesResourceArmPaginatedResult.DeserializeDatastorePropertiesResourceArmPaginatedResult(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateDeleteRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Delete;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/datastores/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Delete datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task DeleteAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Delete datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Delete(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateDeleteRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 204:
- return message.Response;
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateGetRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/datastores/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> GetAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastorePropertiesResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DatastorePropertiesResource.DeserializeDatastorePropertiesResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response Get(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateGetRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastorePropertiesResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DatastorePropertiesResource.DeserializeDatastorePropertiesResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateCreateOrUpdateRequest(string name, string resourceGroupName, string workspaceName, DatastorePropertiesResource body)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Put;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/datastores/", false);
- uri.AppendPath(name, true);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- request.Headers.Add("Content-Type", "application/json");
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(body);
- request.Content = content;
- return message;
- }
-
- /// Create or update datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Datastore entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public async Task> CreateOrUpdateAsync(string name, string resourceGroupName, string workspaceName, DatastorePropertiesResource body, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
- if (body == null)
- {
- throw new ArgumentNullException(nameof(body));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DatastorePropertiesResource value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DatastorePropertiesResource.DeserializeDatastorePropertiesResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Create or update datastore.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// Datastore entity to create or update.
- /// The cancellation token to use.
- /// , , , or is null.
- public Response CreateOrUpdate(string name, string resourceGroupName, string workspaceName, DatastorePropertiesResource body, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
- if (body == null)
- {
- throw new ArgumentNullException(nameof(body));
- }
-
- using var message = CreateCreateOrUpdateRequest(name, resourceGroupName, workspaceName, body);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- case 201:
- {
- DatastorePropertiesResource value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DatastorePropertiesResource.DeserializeDatastorePropertiesResource(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListSecretsRequest(string name, string resourceGroupName, string workspaceName)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Post;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendPath("/subscriptions/", false);
- uri.AppendPath(subscriptionId, true);
- uri.AppendPath("/resourceGroups/", false);
- uri.AppendPath(resourceGroupName, true);
- uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false);
- uri.AppendPath(workspaceName, true);
- uri.AppendPath("/datastores/", false);
- uri.AppendPath(name, true);
- uri.AppendPath("/listSecrets", false);
- uri.AppendQuery("api-version", apiVersion, true);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- /// Get datastore secrets.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public async Task> ListSecretsAsync(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListSecretsRequest(name, resourceGroupName, workspaceName);
- await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastoreCredentials value = default;
- using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
- value = DatastoreCredentials.DeserializeDatastoreCredentials(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
- }
- }
-
- /// Get datastore secrets.
- /// Datastore name.
- /// Name of the resource group in which workspace is located.
- /// Name of Azure Machine Learning workspace.
- /// The cancellation token to use.
- /// , , or is null.
- public Response ListSecrets(string name, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default)
- {
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
- if (resourceGroupName == null)
- {
- throw new ArgumentNullException(nameof(resourceGroupName));
- }
- if (workspaceName == null)
- {
- throw new ArgumentNullException(nameof(workspaceName));
- }
-
- using var message = CreateListSecretsRequest(name, resourceGroupName, workspaceName);
- _pipeline.Send(message, cancellationToken);
- switch (message.Response.Status)
- {
- case 200:
- {
- DatastoreCredentials value = default;
- using var document = JsonDocument.Parse(message.Response.ContentStream);
- value = DatastoreCredentials.DeserializeDatastoreCredentials(document.RootElement);
- return Response.FromValue(value, message.Response);
- }
- default:
- throw _clientDiagnostics.CreateRequestFailedException(message.Response);
- }
- }
-
- internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string workspaceName, string skiptoken, int? count, bool? isDefault, IEnumerable names, string searchText, string orderBy, bool? orderByAsc)
- {
- var message = _pipeline.CreateMessage();
- var request = message.Request;
- request.Method = RequestMethod.Get;
- var uri = new RawRequestUriBuilder();
- uri.Reset(endpoint);
- uri.AppendRawNextLink(nextLink, false);
- request.Uri = uri;
- request.Headers.Add("Accept", "application/json");
- return message;
- }
-
- ///