Beispiel #1
0
        public PSClusterPatch(ClusterPatch patch)
        {
            if (patch.KeyVaultProperties != null)
            {
                this.KeyVaultProperties = new PSKeyVaultProperties(patch.KeyVaultProperties);
            }

            if (patch.Sku != null)
            {
                this.Sku = new PSClusterSku(patch.Sku);
            }

            if (patch.Tags != null)
            {
                this.Tags = new Hashtable((IDictionary)patch.Tags);
            }

            if (patch.Identity != null)
            {
                this.Identity = new PSIdentity(patch.Identity);
            }

            if (patch.BillingType != null)
            {
                this.BillingType = patch.BillingType;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Update an HCI cluster.
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='resourceGroupName'>
        /// The name of the resource group. The name is case insensitive.
        /// </param>
        /// <param name='clusterName'>
        /// The name of the cluster.
        /// </param>
        /// <param name='tags'>
        /// Resource tags.
        /// </param>
        public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, IDictionary <string, string> tags = default(IDictionary <string, string>))
        {
            var clusterPatch = new ClusterPatch();

            if (tags != null)
            {
                clusterPatch.Tags = tags;
            }

            return(operations.Update(resourceGroupName, clusterName, clusterPatch));
        }
        /// <summary>
        /// Update an HCI cluster.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// The name of the resource group. The name is case insensitive.
        /// </param>
        /// <param name='clusterName'>
        /// The name of the cluster.
        /// </param>
        /// <param name='tags'>
        /// Resource tags.
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorResponseException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task <AzureOperationResponse <Cluster> > UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, IDictionary <string, string> tags = default(IDictionary <string, string>), Dictionary <string, List <string> > customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var clusterPatch = new ClusterPatch();

            if (tags != null)
            {
                clusterPatch.Tags = tags;
            }

            return(await UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, clusterPatch, customHeaders, cancellationToken));
        }
        public PSClusterPatch(ClusterPatch patch)
        {
            if (patch.KeyVaultProperties != null)
            {
                this.KeyVaultProperties = new PSKeyVaultProperties(patch.KeyVaultProperties);
            }

            if (patch.Sku != null)
            {
                this.Sku = new PSClusterSku(patch.Sku);
            }

            if (patch.Tags != null)
            {
                this.Tags = new Hashtable((IDictionary)patch.Tags);
            }
        }
        public virtual Response <HciCluster> Update(ClusterPatch cluster, CancellationToken cancellationToken = default)
        {
            if (cluster == null)
            {
                throw new ArgumentNullException(nameof(cluster));
            }

            using var scope = _hciClusterClustersClientDiagnostics.CreateScope("HciCluster.Update");
            scope.Start();
            try
            {
                var response = _hciClusterClustersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cluster, cancellationToken);
                return(Response.FromValue(new HciCluster(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
 /// <summary>
 /// Update an HCI cluster.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='clusterName'>
 /// The name of the cluster.
 /// </param>
 /// <param name='cluster'>
 /// Details of the HCI cluster.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Cluster> UpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch cluster, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, cluster, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update an HCI cluster.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='clusterName'>
 /// The name of the cluster.
 /// </param>
 /// <param name='cluster'>
 /// Details of the HCI cluster.
 /// </param>
 public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch cluster)
 {
     return(operations.UpdateAsync(resourceGroupName, clusterName, cluster).GetAwaiter().GetResult());
 }