public static void CaptureRole(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentName, string roleInstanceName, string targetImageName, string targetImageLabel, PostCaptureAction postCaptureAction, ProvisioningConfigurationSet provisioningConfiguration)
		{
			CaptureRoleOperation captureRoleOperation = new CaptureRoleOperation();
			captureRoleOperation.PostCaptureAction = postCaptureAction.ToString();
			captureRoleOperation.ProvisioningConfiguration = provisioningConfiguration;
			captureRoleOperation.TargetImageName = targetImageName;
			captureRoleOperation.TargetImageLabel = targetImageLabel;
			proxy.EndExecuteRoleOperation(proxy.BeginExecuteRoleOperation(subscriptionId, serviceName, deploymentName, roleInstanceName, captureRoleOperation, null, null));
		}
Example #2
0
        internal override void ExecuteCommand()
        {
            base.ExecuteCommand();
            if (CurrentDeployment == null)
            {
                return;
            }

            string            roleName = this.Name;
            PostCaptureAction p        = (PostCaptureAction)Enum.Parse(typeof(PostCaptureAction), "Delete");

            ExecuteClientActionInOCS(null, CommandRuntime.ToString(), s => this.Channel.CaptureRole(s, this.ServiceName, CurrentDeployment.Name, roleName, this.NewImageName, string.IsNullOrEmpty(this.NewImageLabel) ? this.NewImageName : this.NewImageLabel, p, null));
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the
 /// VirtualMachineCaptureOSImageParameters class with required
 /// arguments.
 /// </summary>
 public VirtualMachineCaptureOSImageParameters(PostCaptureAction postCaptureAction, string targetImageLabel, string targetImageName)
     : this()
 {
     if (targetImageLabel == null)
     {
         throw new ArgumentNullException("targetImageLabel");
     }
     if (targetImageName == null)
     {
         throw new ArgumentNullException("targetImageName");
     }
     this.PostCaptureAction = postCaptureAction;
     this.TargetImageLabel  = targetImageLabel;
     this.TargetImageName   = targetImageName;
 }
 public static void CaptureRole(this IServiceManagement proxy,
                                string subscriptionId,
                                string serviceName,
                                string deploymentName,
                                string roleInstanceName,
                                string targetImageName,
                                string targetImageLabel,
                                PostCaptureAction postCaptureAction,
                                ProvisioningConfigurationSet provisioningConfiguration)
 {
     proxy.EndExecuteRoleOperation(
         proxy.BeginExecuteRoleOperation(
             subscriptionId,
             serviceName,
             deploymentName,
             roleInstanceName,
             new CaptureRoleOperation
     {
         PostCaptureAction         = postCaptureAction.ToString(),
         ProvisioningConfiguration = provisioningConfiguration,
         TargetImageName           = targetImageName,
         TargetImageLabel          = targetImageLabel
     }, null, null));
 }
 /// <summary>
 /// Initializes a new instance of the
 /// VirtualMachineCaptureOSImageParameters class with required
 /// arguments.
 /// </summary>
 public VirtualMachineCaptureOSImageParameters(PostCaptureAction postCaptureAction, string targetImageLabel, string targetImageName)
     : this()
 {
     if (targetImageLabel == null)
     {
         throw new ArgumentNullException("targetImageLabel");
     }
     if (targetImageName == null)
     {
         throw new ArgumentNullException("targetImageName");
     }
     this.PostCaptureAction = postCaptureAction;
     this.TargetImageLabel = targetImageLabel;
     this.TargetImageName = targetImageName;
 }