def deploy(self, power_on=None, force_customization=None): """Deploys the vApp. Deploying the vApp will allocate all resources assigned to the vApp. TODO: Add lease_deployment_seconds param after PR 2036925 is fixed. https://jira.eng.vmware.com/browse/VCDA-465 :param power_on: (bool): Specifies whether to power on/off vapp/VM on deployment. True by default, unless otherwise specified. :param lease_deployment_seconds: (str): Deployment lease in seconds. :param force_customization: (bool): Used to specify whether to force customization on deployment, if not set default value is false. :return: A :class:`lxml.objectify.StringElement` object describing the asynchronous Task deploying the vApp. """ if self.resource is None: self.resource = self.client.get_resource(self.href) deploy_vapp_params = E.DeployVAppParams() if power_on is not None: deploy_vapp_params.set('powerOn', str(power_on).lower()) if force_customization is not None: deploy_vapp_params.set('forceCustomization', str(force_customization).lower()) return self.client.post_linked_resource(self.resource, RelationType.DEPLOY, EntityType.DEPLOY.value, deploy_vapp_params)
def deploy(self, power_on=None, force_customization=None): """Deploys the vApp. Deploying the vApp will allocate all resources assigned to the vApp. TODO: Add lease_deployment_seconds param after PR 2036925 is fixed. https://jira.eng.vmware.com/browse/VCDA-465 :param bool power_on: specifies whether to power on/off vApp/vm on deployment. True by default, unless otherwise specified. :param str lease_deployment_seconds: deployment lease in seconds. :param bool force_customization: True, instructs vCD to force customization on deployment. False, no action is performed. :return: an object containing EntityType.TASK XML data which represents the asynchronous task that is deploying the vApp. :rtype: lxml.objectify.ObjectifiedElement :raises OperationNotSupportedException: if the vApp can't be deployed. """ deploy_vapp_params = E.DeployVAppParams() if power_on is not None: deploy_vapp_params.set('powerOn', str(power_on).lower()) if force_customization is not None: deploy_vapp_params.set('forceCustomization', str(force_customization).lower()) return self._perform_power_operation( rel=RelationType.DEPLOY, operation_name='deploy', media_type=EntityType.DEPLOY.value, contents=deploy_vapp_params)
def deploy(self, power_on=None, force_customization=None): """Deploys the vApp. Deploying the vApp will allocate all resources assigned to the vApp. TODO: Add lease_deployment_seconds param after PR 2036925 is fixed. https://jira.eng.vmware.com/browse/VCDA-465 :param bool power_on: specifies whether to power on/off vApp/vm on deployment. True by default, unless otherwise specified. :param str lease_deployment_seconds: deployment lease in seconds. :param bool force_customization: True, instructs vCD to force customization on deployment. False, no action is performed. :return: an object containing EntityType.TASK XML data which represents the asynchronous task that is deploying the vApp. :rtype: lxml.objectify.ObjectifiedElement """ if self.resource is None: self.resource = self.client.get_resource(self.href) deploy_vapp_params = E.DeployVAppParams() if power_on is not None: deploy_vapp_params.set('powerOn', str(power_on).lower()) if force_customization is not None: deploy_vapp_params.set('forceCustomization', str(force_customization).lower()) return self.client.post_linked_resource(self.resource, RelationType.DEPLOY, EntityType.DEPLOY.value, deploy_vapp_params)
def deploy(self, power_on=True, force_customization=False): """Deploys the VM. Deploying the VM will allocate all resources assigned to the VM. If an already deployed VM is attempted to deploy, an exception is raised. :return: A :class:`lxml.objectify.StringElement` object describing the asynchronous task that operates on the VM. """ if self.resource is None: self.resource = self.client.get_resource(self.href) deploy_vm_params = E.DeployVAppParams() deploy_vm_params.set('powerOn', str(power_on).lower()) deploy_vm_params.set('forceCustomization', str(force_customization).lower()) return self.client.post_linked_resource( self.resource, RelationType.DEPLOY, EntityType.DEPLOY.value, deploy_vm_params)
def deploy(self, power_on=True, force_customization=False): """Deploys the vm. Deploying the vm will allocate all resources assigned to the vm. If an attempt is made to deploy an already deployed vm, an exception will be raised. :return: an object containing EntityType.TASK XML data which represents the asynchronous task that is deploying the vm. :rtype: lxml.objectify.ObjectifiedElement """ deploy_vm_params = E.DeployVAppParams() deploy_vm_params.set('powerOn', str(power_on).lower()) deploy_vm_params.set('forceCustomization', str(force_customization).lower()) return self._perform_power_operation( rel=RelationType.DEPLOY, operation_name='deploy', media_type=EntityType.DEPLOY.value, contents=deploy_vm_params)
def deploy(self, power_on=True, force_customization=False): """Deploys the vm. Deploying the vm will allocate all resources assigned to the vm. If an attempt is made to deploy an already deployed vm, an exception will be raised. :return: an object containing EntityType.TASK XML data which represents the asynchronous task that is deploying the vm. :rtype: lxml.objectify.ObjectifiedElement """ if self.resource is None: self.resource = self.client.get_resource(self.href) deploy_vm_params = E.DeployVAppParams() deploy_vm_params.set('powerOn', str(power_on).lower()) deploy_vm_params.set('forceCustomization', str(force_customization).lower()) return self.client.post_linked_resource( self.resource, RelationType.DEPLOY, EntityType.DEPLOY.value, deploy_vm_params)