コード例 #1
0
ファイル: zones.py プロジェクト: antonym/python-novaclient
    def update(self, zone, api_url=None, username=None, password=None,
               weight_offset=None, weight_scale=None):
        """
        Update the name or the api_url for a zone.

        :param zone: The :class:`Zone` (or its ID) to update.
        :param api_url: Update the API URL.
        :param username: Update the username.
        :param password: Update the password.
        :param weight_offset: Update the child zone's weight offset.
        :param weight_scale: Update the child zone's weight scale.
        """

        body = {"zone": {}}
        if api_url:
            body["zone"]["api_url"] = api_url
        if username:
            body["zone"]["username"] = username
        if password:
            body["zone"]["password"] = password
        if weight_offset:
            body["zone"]["weight_offset"] = weight_offset
        if weight_scale:
            body["zone"]["weight_scale"] = weight_scale
        if not len(body["zone"]):
            return
        self._update("/zones/%s" % base.getid(zone), body)
コード例 #2
0
ファイル: zones.py プロジェクト: antonym/python-novaclient
    def get(self, zone):
        """
        Get a child zone.

        :param server: ID of the :class:`Zone` to get.
        :rtype: :class:`Zone`
        """
        return self._get("/zones/%s" % base.getid(zone), "zone")
コード例 #3
0
ファイル: zones.py プロジェクト: antonym/python-novaclient
 def delete(self, zone):
     """
     Delete a child zone.
     """
     self._delete("/zones/%s" % base.getid(zone))