Exemplo n.º 1
0
 private static string CreateVappUnDeployParamBody(UndeployPowerActionType undeployPowerAction)
 {
     return(SerializationUtil.SerializeObject <UndeployVAppParamsType>(new UndeployVAppParamsType()
     {
         UndeployPowerAction = undeployPowerAction.Value()
     }, "com.vmware.vcloud.api.rest.schema"));
 }
Exemplo n.º 2
0
 public Task Undeploy(UndeployPowerActionType undeployPowerAction)
 {
     try
     {
         return(AbstractVapp <T> .ExecuteAbstractVappAction(this.VcloudClient, this.Reference.href + "/action/undeploy", AbstractVapp <T> .CreateVappUnDeployParamBody(undeployPowerAction), "application/vnd.vmware.vcloud.undeployVAppParams+xml", 202));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemplo n.º 3
0
        public static Task Undeploy(
            vCloudClient client,
            ReferenceType _ref,
            UndeployPowerActionType undeployPowerAction)
        {
            try
            {
                string actionUrl         = _ref.href + "/action/undeploy";
                string unDeployParamBody = AbstractVapp <T> .CreateVappUnDeployParamBody(undeployPowerAction);

                return(AbstractVapp <T> .ExecuteAbstractVappAction(client, actionUrl, unDeployParamBody, "application/vnd.vmware.vcloud.undeployVAppParams+xml", 202));
            }
            catch (Exception ex)
            {
                throw new VCloudException(ex.Message);
            }
        }