Ejemplo n.º 1
0
		public void NewStorageAccountProcess()
		{
			Action<string> action = null;
			CreateStorageServiceInput createStorageServiceInput = new CreateStorageServiceInput();
			createStorageServiceInput.ServiceName = this.StorageAccountName;
			createStorageServiceInput.Label = ServiceManagementHelper.EncodeToBase64String(this.Label);
			createStorageServiceInput.Description = this.Description;
			createStorageServiceInput.AffinityGroup = this.AffinityGroup;
			createStorageServiceInput.Location = this.Location;
			CreateStorageServiceInput createStorageServiceInput1 = createStorageServiceInput;
			using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel))
			{
				try
				{
					CmdletExtensions.WriteVerboseOutputForObject(this, createStorageServiceInput1);
					NewAzureStorageAccountCommand newAzureStorageAccountCommand = this;
					if (action == null)
					{
						action = (string s) => base.Channel.CreateStorageService(s, createStorageServiceInput1);
					}
					((CmdletBase<IServiceManagement>)newAzureStorageAccountCommand).RetryCall(action);
					Operation operation = base.WaitForOperation(base.CommandRuntime.ToString());
					ManagementOperationContext managementOperationContext = new ManagementOperationContext();
					managementOperationContext.set_OperationDescription(base.CommandRuntime.ToString());
					managementOperationContext.set_OperationId(operation.OperationTrackingId);
					managementOperationContext.set_OperationStatus(operation.Status);
					ManagementOperationContext managementOperationContext1 = managementOperationContext;
					base.WriteObject(managementOperationContext1, true);
				}
				catch (CommunicationException communicationException1)
				{
					CommunicationException communicationException = communicationException1;
					this.WriteErrorDetails(communicationException);
				}
			}
		}
 public IAsyncResult BeginCreateStorageService(string subscriptionId, CreateStorageServiceInput createStorageServiceInput, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionId"] = subscriptionId;
     result.Values["createStorageServiceInput"] = createStorageServiceInput;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
Ejemplo n.º 3
0
 public static void CreateStorageService(this IServiceManagement proxy, string subscriptionId, CreateStorageServiceInput input)
 {
     proxy.EndCreateStorageService(proxy.BeginCreateStorageService(subscriptionId, input, null, null));
 }
Ejemplo n.º 4
0
 public static void CreateStorageService(this IServiceManagement proxy, string subscriptionId, CreateStorageServiceInput input)
 {
     proxy.EndCreateStorageService(proxy.BeginCreateStorageService(subscriptionId, input, null, null));
 }