예제 #1
0
파일: domains.py 프로젝트: abg/vaporize
    def get(cls, id, records=False, subdomains=False):
        """Retrieve a Domain using an ID.

        :param records: Include the Domain's Records in the result
        :type records: bool
        :param subdomains: Include the Domain's Subdomainsi n the result
        :type subdomains: bool
        :returns: A Domain with the specified ID.
        :rtype: :class:`Domain`

        .. versionadded:: 0.1
        """
        url = '/'.join([get_url('clouddns'), 'domains', str(id)])
        if records is True:
            url = query(url, showRecords='true')
        if subdomains is True:
            url = query(url, showSubdomains='true')
        return handle_request('get', url, wrapper=cls)
예제 #2
0
파일: domains.py 프로젝트: abg/vaporize
    def list(cls, limit=None, offset=None, filter=None):
        """List of Domains.

        :param limit: Limit the number of results returned
        :type limit: int
        :param offset: Offset the result set by a certain amount
        :type offset: int
        :param filter: Filter results by a domain name
        :type filter: str
        :returns: A list of Domains
        :rtype: A list of :class:`Domain`

        .. versionadded:: 0.1
        """
        url = [get_url('clouddns'), 'domains']
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        if filter is not None:
            url = query(url, name=filter)
        return handle_request('get', url, wrapper=cls, container='domains')
예제 #3
0
파일: domains.py 프로젝트: abg/vaporize
    def changes(self, since):
        """Returns a list of CloudDNS changes for this domain.

        :param since: A datetime as a starting point.
        :type since: str or datetime
        :returns: A list of Changes
        :rtype: A list of :class:`Change`

        .. versionadded:: 0.1
        """
        assert 'id' in self
        url = '/'.join([get_url('clouddns'), 'domains', str(self['id']),
                        'changes'])
        url = query(url, since=str(since))
        return handle_request('get', url, wrapper=Change, container='changes')
예제 #4
0
    def list(cls, limit=None, offset=None):
        """Lists information for all available flavors.

        This operation lists information for all available flavors.

        :param limit: Limit the result set by a number
        :type limit: int
        :param offset: Offset the result set by a number
        :type offset: int
        :returns: A list of CloudDatabases Flavors.
        :rtype: list of :class:`Flavor`

        .. versionadded:: 0.2
        """
        url = '/'.join([get_url('clouddatabases'), 'flavors'])
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=cls, container='flavors')
예제 #5
0
파일: domains.py 프로젝트: abg/vaporize
    def delete(self, subdomains=False):
        """Delete this Domain.

        .. warning::

            There is no confirmation step to this operation. Deleting this
            domain is permanent. If in doubt you can export a copy of the DNS
            zone (:func:`vaporize.domains.Domain.export_zone`) before deleting.

        :param subdomains: Delete this Domain's Subdomains (optional)
        :type subdomains: bool

        .. versionadded:: 0.1
        """
        assert 'id' in self
        url = '/'.join([get_url('clouddns'), 'domains', str(self['id'])])
        url = query(url, deleteSubdomains=subdomains)
        handle_request('delete', url)
예제 #6
0
    def list(cls, limit=None, offset=None, detail=False):
        """
        List of CloudNextGenServer NextGenServers

        :param limit: Limit the result set to a certain number
        :type limit: int
        :param offset: Offset the result set by a certain number
        :type offset: int
        :returns: A list of CloudNextGenServers NextGenServers.
        :rtype: List of :class:`NextGenServer`

        .. versionadded:: 0.3
        """
        url = [get_url('cloudserversopenstack'), 'servers']
        if detail:
            url.append(detail)
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=cls, container='servers')
예제 #7
0
    def list(cls, limit=None, offset=None, detail=False):
        """Returns a list of CloudNextGenServers NextGenImages.

        :param limit: Limit the result set by a cetain number
        :type limit: int
        :param offset: Offset the result set by a certain number
        :type offset: int
        :param detail: Return additional details about each NextGenImage
        :type detail: bool
        :returns: A list of CloudNextGenServers NextGenImages.
        :rtype: A list of :class:`NextGenImage`

        .. versionadded:: 0.3
        """
        url = [get_url('cloudserversopenstack'), 'images']
        if detail:
            url.append('detail')
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=NextGenImage, container='images')
예제 #8
0
파일: servers.py 프로젝트: mihait/vaporize
    def list(cls, limit=None, offset=None, detail=False):
        """Returns a list of Flavors.

        :param limit: Limit the result set by a number
        :type limit: int
        :param offset: Offset the result set by a number
        :type offset: int
        :param detail: Return additional details about each Flavor
        :type: bool
        :returns: A list of CloudServers Flavors.
        :rtype: :class:`Flavor`

        .. versionadded:: 0.1
        """
        url = [get_url('cloudservers'), 'flavors']
        if detail:
            url.append('detail')
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=cls, container='flavors')
예제 #9
0
파일: servers.py 프로젝트: mihait/vaporize
    def list(cls, limit=None, offset=None, detail=False):
        """Returns a list of Shared IP Groups.

        :param limit: Limit the result set by a certain number
        :type limit: int
        :param offset: Offset the result set by a certain number
        :type offset: int
        :param detail: Return additional details about each Shared IP Group
        :type detail: bool
        :returns: A list of Shared IP Groups.
        :rtype: A list of :class:`SharedIPGroup`

        .. versionadded:: 0.1
        """
        url = [get_url('cloudservers'), 'shared_ip_groups']
        if detail:
            url.append('detail')
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=cls,
                              container='sharedIpGroups')
예제 #10
0
파일: servers.py 프로젝트: mihait/vaporize
    def list(cls, limit=None, offset=None, detail=False):
        """
        List of CloudServer Servers

        :param limit: Limit the result set to a certain number
        :type limit: int
        :param offset: Offset the result set by a certain number
        :type offset: int
        :param detail: Return detailed information about each Server
        :type detail: bool
        :returns: A list of CloudServers Servers.
        :rtype: List of :class:`Server`

        .. versionadded:: 0.1
        """
        url = [get_url('cloudservers'), 'servers']
        if detail:
            url.append('detail')
        url = '/'.join(url)
        if limit is not None or offset is not None:
            url = query(url, limit=limit, offset=offset)
        return handle_request('get', url, wrapper=cls, container='servers')