public void SetHostedServiceProcess()
		{
			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
				{
					UpdateHostedServiceInput updateHostedServiceInput = new UpdateHostedServiceInput();
					if (this.Label != null)
					{
						updateHostedServiceInput.Label = ServiceManagementHelper.EncodeToBase64String(this.Label);
					}
					if (this.Description != null)
					{
						updateHostedServiceInput.Description = this.Description;
					}
					CmdletExtensions.WriteVerboseOutputForObject(this, updateHostedServiceInput);
					base.RetryCall((string s) => base.Channel.UpdateHostedService(s, this.ServiceName, updateHostedServiceInput));
					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 static void UpdateHostedService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateHostedServiceInput input)
 {
     proxy.EndUpdateHostedService(proxy.BeginUpdateHostedService(subscriptionId, serviceName, input, null, null));
 }
 public IAsyncResult BeginUpdateHostedService(string subscriptionId, string serviceName, UpdateHostedServiceInput input, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionId"] = subscriptionId;
     result.Values["serviceName"] = serviceName;
     result.Values["input"] = input;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
 public static void UpdateHostedService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateHostedServiceInput input)
 {
     proxy.EndUpdateHostedService(proxy.BeginUpdateHostedService(subscriptionId, serviceName, input, null, null));
 }
        protected override void PerformOperation(IServiceManagement channel)
        {
            if (!String.IsNullOrEmpty(Label))
            {
                Label = ServiceManagementHelper.EncodeToBase64String(Label);
            }

            UpdateHostedServiceInput input = new UpdateHostedServiceInput()
            {
                Label = CSManageCommand.Label,
                Description = CSManageCommand.Description
            };

            Console.WriteLine("Updating hosted service {0}", HostedServiceName);
            channel.UpdateHostedService(SubscriptionId, HostedServiceName, input);
        }
Beispiel #6
0
 public static void UpdateHostedService(this IServiceManagement proxy, string subscriptionId, string serviceName, UpdateHostedServiceInput input)
 {
     //TODO: Update HostedService is returning Bad Request. Need to recheck.
     proxy.EndUpdateHostedService(proxy.BeginUpdateHostedService(subscriptionId, serviceName, input, null, null));
 }