コード例 #1
0
        public virtual async Task <ArmOperation <ManagedEnvironmentStorageResource> > UpdateAsync(WaitUntil waitUntil, ManagedEnvironmentStorageData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

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

                var operation = new ContainersArmOperation <ManagedEnvironmentStorageResource>(Response.FromValue(new ManagedEnvironmentStorageResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #2
0
        public virtual async Task <ArmOperation <SourceControlResource> > UpdateAsync(WaitUntil waitUntil, SourceControlData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

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

                var operation = new ContainersArmOperation <SourceControlResource>(new SourceControlOperationSource(Client), _sourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _sourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #3
0
        public virtual async Task <ArmOperation <ContainerAppCertificateResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string certificateName, ContainerAppCertificateData data = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName));

            using var scope = _containerAppCertificateCertificatesClientDiagnostics.CreateScope("ContainerAppCertificateCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _containerAppCertificateCertificatesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken).ConfigureAwait(false);

                var operation = new ContainersArmOperation <ContainerAppCertificateResource>(Response.FromValue(new ContainerAppCertificateResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #4
0
        public virtual async Task <ArmOperation <ManagedEnvironmentResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string name, ManagedEnvironmentData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(name, nameof(name));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _managedEnvironmentClientDiagnostics.CreateScope("ManagedEnvironmentCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _managedEnvironmentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken).ConfigureAwait(false);

                var operation = new ContainersArmOperation <ManagedEnvironmentResource>(new ManagedEnvironmentOperationSource(Client), _managedEnvironmentClientDiagnostics, Pipeline, _managedEnvironmentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }