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 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;
 }
예제 #3
0
 public static void UpdateStorageService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateStorageServiceInput input)
 {
     proxy.EndUpdateStorageService(proxy.BeginUpdateStorageService(subscriptionId, serviceName, input, null, null));
 }
예제 #4
0
 public static void UpdateStorageService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateStorageServiceInput input)
 {
     //TODO: Update HostedService is returning Bad Request. Need to recheck.
     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));
 }