Ejemplo n.º 1
0
    def list_changes(self, max_results=None, page_token=None, client=None):
        """List change sets for this zone.

        See
        https://cloud.google.com/dns/api/v1/resourceRecordSets/list

        :type max_results: int
        :param max_results: maximum number of zones to return, If not
                            passed, defaults to a value set by the API.

        :type page_token: str
        :param page_token: opaque marker for the next "page" of zones. If
                           not passed, the API will return the first page of
                           zones.

        :type client: :class:`google.cloud.dns.client.Client`
        :param client:
            (Optional) the client to use.  If not passed, falls back to the
            ``client`` stored on the current zone.

        :rtype: :class:`~google.cloud.iterator.Iterator`
        :returns: Iterator of :class:`~.changes.Changes`
                  belonging to this zone.
        """
        client = self._require_client(client)
        path = '/projects/%s/managedZones/%s/changes' % (self.project,
                                                         self.name)
        iterator = HTTPIterator(client=client,
                                path=path,
                                item_to_value=_item_to_changes,
                                items_key='changes',
                                page_token=page_token,
                                max_results=max_results)
        iterator.zone = self
        return iterator
Ejemplo n.º 2
0
    def list_changes(self, max_results=None, page_token=None, client=None):
        """List change sets for this zone.

        See:
        https://cloud.google.com/dns/api/v1/resourceRecordSets/list

        :type max_results: int
        :param max_results: maximum number of zones to return, If not
                            passed, defaults to a value set by the API.

        :type page_token: str
        :param page_token: opaque marker for the next "page" of zones. If
                           not passed, the API will return the first page of
                           zones.

        :type client: :class:`google.cloud.dns.client.Client`
        :param client:
            (Optional) the client to use.  If not passed, falls back to the
            ``client`` stored on the current zone.

        :rtype: :class:`~google.cloud.iterator.Iterator`
        :returns: Iterator of :class:`~.changes.Changes`
                  belonging to this zone.
        """
        client = self._require_client(client)
        path = '/projects/%s/managedZones/%s/changes' % (
            self.project, self.name)
        iterator = HTTPIterator(
            client=client, path=path, item_to_value=_item_to_changes,
            items_key='changes', page_token=page_token,
            max_results=max_results)
        iterator.zone = self
        return iterator