libcloud/loadbalancer/drivers/dimensiondata.py [473:564]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object
        return node

    def ex_set_node_state(self, node, enabled):
        """
        Change the state of a node (enable/disable)

        :param pool: The instance of ``DimensionDataNode`` to update
        :type  pool: ``DimensionDataNode``

        :param enabled: The target state of the node
        :type  enabled: ``bool``

        :return: The instance of ``DimensionDataNode``
        :rtype: ``DimensionDataNode``
        """
        create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN})
        ET.SubElement(create_node_elm, "status").text = "ENABLED" if enabled is True else "DISABLED"

        self.connection.request_with_orgId_api_2(
            action="networkDomainVip/editNode",
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object
        return node

    def ex_create_pool(
        self,
        network_domain_id,
        name,
        balancer_method,
        ex_description,
        health_monitors=None,
        service_down_action="NONE",
        slow_ramp_time=30,
    ):
        """
        Create a new pool

        :param network_domain_id: Network Domain ID (required)
        :type  name: ``str``

        :param name: name of the node (required)
        :type  name: ``str``

        :param balancer_method: The load balancer algorithm (required)
        :type  balancer_method: ``str``

        :param ex_description: Description of the node (required)
        :type  ex_description: ``str``

        :param health_monitors: A list of health monitors to use for the pool.
        :type  health_monitors: ``list`` of
            :class:`DimensionDataDefaultHealthMonitor`

        :param service_down_action: What to do when node
                                    is unavailable NONE, DROP or RESELECT
        :type  service_down_action: ``str``

        :param slow_ramp_time: Number of seconds to stagger ramp up of nodes
        :type  slow_ramp_time: ``int``

        :return: Instance of ``DimensionDataPool``
        :rtype: ``DimensionDataPool``
        """
        # Names cannot contain spaces.
        name.replace(" ", "_")
        create_node_elm = ET.Element("createPool", {"xmlns": TYPES_URN})
        ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id
        ET.SubElement(create_node_elm, "name").text = name
        ET.SubElement(create_node_elm, "description").text = str(ex_description)
        ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(balancer_method)

        if health_monitors is not None:
            for monitor in health_monitors:
                ET.SubElement(create_node_elm, "healthMonitorId").text = str(monitor.id)

        ET.SubElement(create_node_elm, "serviceDownAction").text = service_down_action
        ET.SubElement(create_node_elm, "slowRampTime").text = str(slow_ramp_time)

        response = self.connection.request_with_orgId_api_2(
            action="networkDomainVip/createPool",
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object

        pool_id = None
        for info in findall(response, "info", TYPES_URN):
            if info.get("name") == "poolId":
                pool_id = info.get("value")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



libcloud/loadbalancer/drivers/nttcis.py [529:620]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object
        return node

    def ex_set_node_state(self, node, enabled):
        """
        Change the state of a node (enable/disable)

        :param pool: The instance of ``NttCisNode`` to update
        :type  pool: ``NttCisNode``

        :param enabled: The target state of the node
        :type  enabled: ``bool``

        :return: The instance of ``NttCisNode``
        :rtype: ``NttCisNode``
        """
        create_node_elm = ET.Element("editNode", {"xmlns": TYPES_URN})
        ET.SubElement(create_node_elm, "status").text = "ENABLED" if enabled is True else "DISABLED"

        self.connection.request_with_orgId_api_2(
            action="networkDomainVip/editNode",
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object
        return node

    def ex_create_pool(
        self,
        network_domain_id,
        name,
        balancer_method,
        ex_description,
        health_monitors=None,
        service_down_action="NONE",
        slow_ramp_time=30,
    ):
        """
        Create a new pool

        :param network_domain_id: Network Domain ID (required)
        :type  name: ``str``

        :param name: name of the node (required)
        :type  name: ``str``

        :param balancer_method: The load balancer algorithm (required)
        :type  balancer_method: ``str``

        :param ex_description: Description of the node (required)
        :type  ex_description: ``str``

        :param health_monitors: A list of health monitors to use for the pool.
        :type  health_monitors: ``list`` of
            :class:`NttCisDefaultHealthMonitor`

        :param service_down_action: What to do when node
                                    is unavailable NONE, DROP or RESELECT
        :type  service_down_action: ``str``

        :param slow_ramp_time: Number of seconds to stagger ramp up of nodes
        :type  slow_ramp_time: ``int``

        :return: Instance of ``NttCisPool``
        :rtype: ``NttCisPool``
        """
        # Names cannot contain spaces.
        name.replace(" ", "_")
        create_node_elm = ET.Element("createPool", {"xmlns": TYPES_URN})
        ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id
        ET.SubElement(create_node_elm, "name").text = name
        ET.SubElement(create_node_elm, "description").text = str(ex_description)
        ET.SubElement(create_node_elm, "loadBalanceMethod").text = str(balancer_method)

        if health_monitors is not None:
            for monitor in health_monitors:
                ET.SubElement(create_node_elm, "healthMonitorId").text = str(monitor.id)

        ET.SubElement(create_node_elm, "serviceDownAction").text = service_down_action
        ET.SubElement(create_node_elm, "slowRampTime").text = str(slow_ramp_time)

        response = self.connection.request_with_orgId_api_2(
            action="networkDomainVip/createPool",
            method="POST",
            data=ET.tostring(create_node_elm),
        ).object

        pool_id = None
        for info in findall(response, "info", TYPES_URN):
            if info.get("name") == "poolId":
                pool_id = info.get("value")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



