Beispiel #1
0
    def delete_topic_distribution(self, topic_distribution):
        """Deletes a topic distribution.

        """
        check_resource_type(topic_distribution, TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            return self._delete("%s%s" % (self.url, topic_distribution_id))
Beispiel #2
0
    def get_topic_distribution(self, topic_distribution, query_string=''):
        """Retrieves a topic distribution.

        """
        check_resource_type(topic_distribution, TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            return self._get("%s%s" % (self.url, topic_distribution_id),
                             query_string=query_string)
    def delete_topic_distribution(self, topic_distribution):
        """Deletes a topic distribution.

        """
        check_resource_type(topic_distribution,
                            TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            return self._delete("%s%s" % (self.url, topic_distribution_id))
Beispiel #4
0
    def update_topic_distribution(self, topic_distribution, changes):
        """Updates a topic distribution.

        """
        check_resource_type(topic_distribution, TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            body = json.dumps(changes)
            return self._update("%s%s" % \
                (self.url, topic_distribution_id), body)
    def get_topic_distribution(self, topic_distribution, query_string=''):
        """Retrieves a topic distribution.

        """
        check_resource_type(topic_distribution,
                            TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            return self._get("%s%s" % (self.url, topic_distribution_id),
                             query_string=query_string)
    def update_topic_distribution(self, topic_distribution, changes):
        """Updates a topic distribution.

        """
        check_resource_type(topic_distribution,
                            TOPIC_DISTRIBUTION_PATH,
                            message="A topic distribution id is needed.")
        topic_distribution_id = get_topic_distribution_id(topic_distribution)
        if topic_distribution_id:
            body = json.dumps(changes)
            return self._update("%s%s" % \
                (self.url, topic_distribution_id), body)