示例#1
0
        public void SetStorageAccountProcess()
        {
            var upstorageinput = new UpdateStorageServiceInput
            {
                GeoReplicationEnabled = GeoReplicationEnabled,
                Description           = this.Description,
                Label = this.Label
            };

            ExecuteClientActionInOCS(upstorageinput, CommandRuntime.ToString(), s => this.Channel.UpdateStorageService(s, this.StorageAccountName, upstorageinput));
        }
 public void SetStorageAccountProcess()
 {
     if (this.Label == null && this.Description == null)
     {
         base.ThrowTerminatingError(new ErrorRecord(new Exception("You must specify a value for either Label or Description."), string.Empty, ErrorCategory.InvalidData, null));
     }
     using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel))
     {
         try
         {
             UpdateStorageServiceInput updateStorageServiceInput = new UpdateStorageServiceInput();
             bool?geoReplicationEnabled = this.GeoReplicationEnabled;
             if (geoReplicationEnabled.HasValue)
             {
                 bool?nullable = this.GeoReplicationEnabled;
                 updateStorageServiceInput.GeoReplicationEnabled = new bool?(nullable.Value);
             }
             if (this.Description != null)
             {
                 updateStorageServiceInput.Description = this.Description;
             }
             if (this.Label != null)
             {
                 updateStorageServiceInput.Label = ServiceManagementHelper.EncodeToBase64String(this.Label);
             }
             CmdletExtensions.WriteVerboseOutputForObject(this, updateStorageServiceInput);
             base.RetryCall((string s) => base.Channel.UpdateStorageService(s, this.StorageAccountName, updateStorageServiceInput));
             Operation operation = base.WaitForOperation(base.CommandRuntime.ToString());
             ManagementOperationContext managementOperationContext = new ManagementOperationContext();
             managementOperationContext.OperationDescription = base.CommandRuntime.ToString();
             managementOperationContext.OperationId          = operation.OperationTrackingId;
             managementOperationContext.OperationStatus      = operation.Status;
             ManagementOperationContext managementOperationContext1 = managementOperationContext;
             base.WriteObject(managementOperationContext1, true);
         }
         catch (CommunicationException communicationException1)
         {
             CommunicationException communicationException = communicationException1;
             this.WriteErrorDetails(communicationException);
         }
     }
 }
        public void SetStorageAccountProcess()
        {
            if (this.Label == null && this.Description == null)
            {
                ThrowTerminatingError(new ErrorRecord(
                                               new Exception(
                                               "You must specify a value for either Label or Description."),
                                               string.Empty,
                                               ErrorCategory.InvalidData,
                                               null));
            }

            var upstorageinput = new UpdateStorageServiceInput
            {
                GeoReplicationEnabled = this.GeoReplicationEnabled.HasValue,
                Description = this.Description,
                Label = this.Label != null ? this.Label : null
            };

            ExecuteClientActionInOCS(upstorageinput, CommandRuntime.ToString(), s => this.Channel.UpdateStorageService(s, this.StorageAccountName, upstorageinput));
        }
 public static void UpdateStorageService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateStorageServiceInput input)
 {
     proxy.EndUpdateStorageService(proxy.BeginUpdateStorageService(subscriptionId, serviceName, input, null, null));
 }
 public static void UpdateStorageService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateStorageServiceInput input)
 {
     proxy.EndUpdateStorageService(proxy.BeginUpdateStorageService(subscriptionId, serviceName, input, null, null));
 }
 public IAsyncResult BeginUpdateStorageService(string subscriptionId, string StorageServiceName, UpdateStorageServiceInput updateStorageServiceInput, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionId"] = subscriptionId;
     result.Values["StorageServiceName"] = StorageServiceName;
     result.Values["updateStorageServiceInput"] = updateStorageServiceInput;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
        public void SetStorageAccountProcess()
        {
            var upstorageinput = new UpdateStorageServiceInput
            {
                GeoReplicationEnabled = GeoReplicationEnabled,
                Description = this.Description,
                Label = this.Label
            };

            ExecuteClientActionInOCS(upstorageinput, CommandRuntime.ToString(), s => this.Channel.UpdateStorageService(s, this.StorageAccountName, upstorageinput));
        }