Exemple #1
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _codeVersionClientDiagnostics.CreateScope("CodeVersionResource.Delete");
     scope.Start();
     try
     {
         var response  = _codeVersionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new MachineLearningArmOperation(response);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemple #2
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _onlineDeploymentClientDiagnostics.CreateScope("OnlineDeploymentResource.Delete");
     scope.Start();
     try
     {
         var response  = _onlineDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new MachineLearningArmOperation(_onlineDeploymentClientDiagnostics, Pipeline, _onlineDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemple #3
0
        public virtual async Task <ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
        {
            using var scope = _environmentContainerClientDiagnostics.CreateScope("EnvironmentContainerResource.Delete");
            scope.Start();
            try
            {
                var response = await _environmentContainerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation(response);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #4
0
        public virtual async Task <ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
        {
            using var scope = _batchEndpointClientDiagnostics.CreateScope("BatchEndpointResource.Delete");
            scope.Start();
            try
            {
                var response = await _batchEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation(_batchEndpointClientDiagnostics, Pipeline, _batchEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #5
0
        public virtual ArmOperation <OnlineDeploymentResource> Update(WaitUntil waitUntil, OnlineDeploymentPatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _onlineDeploymentClientDiagnostics.CreateScope("OnlineDeploymentResource.Update");
            scope.Start();
            try
            {
                var response  = _onlineDeploymentRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken);
                var operation = new MachineLearningArmOperation <OnlineDeploymentResource>(new OnlineDeploymentOperationSource(Client), _onlineDeploymentClientDiagnostics, Pipeline, _onlineDeploymentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #6
0
        public virtual ArmOperation <CodeVersionResource> Update(WaitUntil waitUntil, CodeVersionData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _codeVersionClientDiagnostics.CreateScope("CodeVersionResource.Update");
            scope.Start();
            try
            {
                var response  = _codeVersionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
                var operation = new MachineLearningArmOperation <CodeVersionResource>(Response.FromValue(new CodeVersionResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #7
0
        public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, RegenerateEndpointKeysContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            using var scope = _onlineEndpointClientDiagnostics.CreateScope("OnlineEndpointResource.RegenerateKeys");
            scope.Start();
            try
            {
                var response  = _onlineEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken);
                var operation = new MachineLearningArmOperation(_onlineEndpointClientDiagnostics, Pipeline, _onlineEndpointRestClient.CreateRegenerateKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #8
0
        public virtual async Task <ArmOperation <BatchEndpointResource> > UpdateAsync(WaitUntil waitUntil, BatchEndpointPatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _batchEndpointClientDiagnostics.CreateScope("BatchEndpointResource.Update");
            scope.Start();
            try
            {
                var response = await _batchEndpointRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <BatchEndpointResource>(new BatchEndpointOperationSource(Client), _batchEndpointClientDiagnostics, Pipeline, _batchEndpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #9
0
        public virtual ArmOperation <DatastoreResource> CreateOrUpdate(WaitUntil waitUntil, string name, DatastoreData data, bool?skipValidation = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(name, nameof(name));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _datastoreClientDiagnostics.CreateScope("DatastoreCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _datastoreRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, skipValidation, cancellationToken);
                var operation = new MachineLearningArmOperation <DatastoreResource>(Response.FromValue(new DatastoreResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #10
0
        public virtual async Task <ArmOperation <EnvironmentContainerResource> > UpdateAsync(WaitUntil waitUntil, EnvironmentContainerData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _environmentContainerClientDiagnostics.CreateScope("EnvironmentContainerResource.Update");
            scope.Start();
            try
            {
                var response = await _environmentContainerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <EnvironmentContainerResource>(Response.FromValue(new EnvironmentContainerResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #11
0
        public virtual ArmOperation <OnlineEndpointResource> CreateOrUpdate(WaitUntil waitUntil, string endpointName, OnlineEndpointData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _onlineEndpointClientDiagnostics.CreateScope("OnlineEndpointCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _onlineEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken);
                var operation = new MachineLearningArmOperation <OnlineEndpointResource>(new OnlineEndpointOperationSource(Client), _onlineEndpointClientDiagnostics, Pipeline, _onlineEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #12
0
        public virtual ArmOperation <MachineLearningPrivateEndpointConnectionResource> CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, MachineLearningPrivateEndpointConnectionData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _machineLearningPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("MachineLearningPrivateEndpointConnectionCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _machineLearningPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken);
                var operation = new MachineLearningArmOperation <MachineLearningPrivateEndpointConnectionResource>(Response.FromValue(new MachineLearningPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #13
0
        public virtual async Task <ArmOperation <MachineLearningJobResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string id, MachineLearningJobData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(id, nameof(id));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _machineLearningJobJobsClientDiagnostics.CreateScope("MachineLearningJobCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _machineLearningJobJobsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <MachineLearningJobResource>(Response.FromValue(new MachineLearningJobResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #14
0
        public virtual async Task <ArmOperation <MachineLearningComputeResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string computeName, MachineLearningComputeData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(computeName, nameof(computeName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _machineLearningComputeComputeRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, computeName, data, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <MachineLearningComputeResource>(new MachineLearningComputeOperationSource(Client), _machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, computeName, data).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }