@@ -1593,6 +1593,106 @@ def create_org_vdc(self,
15931593 resource_admin , RelationType .ADD , EntityType .VDCS_PARAMS .value ,
15941594 params )
15951595
1596+ def update_org_vdc (self ,
1597+ vdc_name ,
1598+ description = None ,
1599+ allocation_model = None ,
1600+ cpu_units = None ,
1601+ cpu_allocated = None ,
1602+ cpu_limit = None ,
1603+ mem_units = None ,
1604+ mem_allocated = None ,
1605+ mem_limit = None ,
1606+ nic_quota = None ,
1607+ network_quota = None ,
1608+ vm_quota = None ,
1609+ resource_guaranteed_memory = None ,
1610+ resource_guaranteed_cpu = None ,
1611+ vcpu_in_mhz = None ,
1612+ is_thin_provision = None ,
1613+ is_enabled = None ):
1614+ """Update an Organization VDC in the current organization.
1615+
1616+ :param str vdc_name: name of the org vdc.
1617+ :param str description: new description of the org vdc.
1618+ :param str allocation_model: updated allocation model used
1619+ by the vdc. Accepted values are 'AllocationVApp',
1620+ 'AllocationPool' or 'ReservationPool'.
1621+ :param str cpu_units: updated unit for compute capacity allocated
1622+ to the vdc. Accepted values are 'MHz' or 'GHz'.
1623+ :param int cpu_allocated: updated capacity that is committed to be
1624+ available.
1625+ :param int cpu_limit: updated capacity limit relative to the value
1626+ specified for allocation.
1627+ :param str mem_units: updated unit for memory capacity allocated to
1628+ the vdc. Acceptable values are 'MB' or 'GB'.
1629+ :param int mem_allocated: updated memory capacity that is committed
1630+ to be available.
1631+ :param int mem_limit: updated memory capacity limit relative to the
1632+ value specified for allocation.
1633+ :param int nic_quota: updated maximum number of virtual NICs allowed
1634+ in the vdc.
1635+ :param int network_quota: updated maximum number of network objects
1636+ that can be deployed in the vdc.
1637+ :param int vm_quota: updated maximum number of VMs that can be created
1638+ in the vdc.
1639+ :param float resource_guaranteed_memory: updated percentage of
1640+ allocated CPU resources guaranteed to vApps deployed in
1641+ the vdc.
1642+ :param float resource_guaranteed_cpu: updated percentage of allocated
1643+ memory resources guaranteed to vApps deployed in the vdc.
1644+ :param int vcpu_in_mhz: updated clock frequency, in MegaHertz,
1645+ for any virtual CPU that is allocated to a VM.
1646+ :param bool is_thin_provision: True to request thin provisioning.
1647+ :param bool is_enabled: True / False if the vdc is enabled for use
1648+ by the organization users.
1649+
1650+ :return: a task to update the vdc.
1651+
1652+ :rtype: lxml.objectify.ObjectifiedElement
1653+ """
1654+ vdc = self .get_vdc (vdc_name , is_admin_operation = True )
1655+ if vdc is None :
1656+ raise EntityNotFoundException ("{0} is not found" .format (vdc_name ))
1657+
1658+ if description :
1659+ vdc ['Description' ] = E .Description (description )
1660+ if allocation_model :
1661+ vdc ['AllocationModel' ] = E .AllocationModel (allocation_model )
1662+ if cpu_units :
1663+ vdc .ComputeCapacity .Cpu .Units = E .Units (cpu_units )
1664+ if cpu_allocated :
1665+ vdc .ComputeCapacity .Cpu .Allocated = E .Allocated (cpu_allocated )
1666+ if cpu_limit :
1667+ vdc .ComputeCapacity .Cpu .Limit = E .Limit (cpu_limit )
1668+ if mem_units :
1669+ vdc .ComputeCapacity .Memory .Units = E .Units (mem_units )
1670+ if mem_allocated :
1671+ vdc .ComputeCapacity .Memory .Allocated = E .Allocated (mem_allocated )
1672+ if mem_limit :
1673+ vdc .ComputeCapacity .Memory .Limit = E .Limit (mem_limit )
1674+ if nic_quota :
1675+ vdc ['NicQuota' ] = E .NicQuota (nic_quota )
1676+ if network_quota :
1677+ vdc ['NetworkQuota' ] = E .NetworkQuota (network_quota )
1678+ if vm_quota :
1679+ vdc ['VmQuota' ] = E .VmQuota (vm_quota )
1680+ if resource_guaranteed_memory :
1681+ vdc ['ResourceGuaranteedCpu' ] = E .ResourceGuaranteedCpu (
1682+ resource_guaranteed_cpu )
1683+ if resource_guaranteed_cpu :
1684+ vdc ['ResourceGuaranteedMemory' ] = E .ResourceGuaranteedMemory (
1685+ resource_guaranteed_memory )
1686+ if vcpu_in_mhz :
1687+ vdc ['VCpuInMhz' ] = E .VCpuInMhz (vcpu_in_mhz )
1688+ if is_thin_provision :
1689+ vdc ['IsThinProvision' ] = E .IsThinProvision (is_thin_provision )
1690+ if is_enabled is not None :
1691+ vdc ['IsEnabled' ] = E .IsEnabled (is_enabled )
1692+
1693+ return self .client .put_resource (
1694+ vdc .get ("href" ), vdc , EntityType .VDC_ADMIN .value )
1695+
15961696 def get_vdc (self , name , is_admin_operation = False ):
15971697 """Retrieves resource of an org vdc identified by its name.
15981698
0 commit comments