Example #1
0
 def uninstall(self, id):
     """
     Uninstall content (units) on a consumer.
     Expected body: {units:[], options:<dict>}
     where unit is: {type_id:<str>, unit_key={}} and the
     options is a dict of uninstall options.
     @param id: A consumer ID.
     @type id: str
     @return: TBD
     @rtype: dict
     """
     body = self.params()
     units = body.get('units')
     options = body.get('options')
     call_request = consumer_content_uninstall_itinerary(id, units, options)[0]
     result = execution.execute_async(self, call_request)
     return result
Example #2
0
 def uninstall(self, id):
     """
     Uninstall content (units) on a consumer.
     Expected body: {units:[], options:<dict>}
     where unit is: {type_id:<str>, unit_key={}} and the
     options is a dict of uninstall options.
     @param id: A consumer ID.
     @type id: str
     @return: TBD
     @rtype: dict
     """
     body = self.params()
     units = body.get('units')
     options = body.get('options')
     call_request = consumer_content_uninstall_itinerary(id, units, options)[0]
     result = execution.execute_async(self, call_request)
     return result
Example #3
0
def consumer_group_content_uninstall_itinerary(consumer_group_id, units, options):
    """
    Create an itinerary for consumer group content uninstallation.
    :param consumer_group_id: unique id of the consumer group
    :type consumer_group_id: str
    :param units: units to uninstall
    :type units: list or tuple
    :param options: options to pass to the uninstall manager
    :type options: dict or None
    :return: list of call requests
    :rtype: list
    """
    consumer_group = managers.consumer_group_query_manager().get_group(consumer_group_id)
    consumer_group_call_requests_list = []
    for consumer_id in consumer_group['consumer_ids']:
        consumer_call_requests = consumer_content_uninstall_itinerary(consumer_id, units, options)
        consumer_group_call_requests_list.extend(consumer_call_requests)
 
    return consumer_group_call_requests_list
Example #4
0
def consumer_group_content_uninstall_itinerary(consumer_group_id, units,
                                               options):
    """
    Create an itinerary for consumer group content uninstallation.
    :param consumer_group_id: unique id of the consumer group
    :type consumer_group_id: str
    :param units: units to uninstall
    :type units: list or tuple
    :param options: options to pass to the uninstall manager
    :type options: dict or None
    :return: list of call requests
    :rtype: list
    """
    consumer_group = managers.consumer_group_query_manager().get_group(
        consumer_group_id)
    consumer_group_call_requests_list = []
    for consumer_id in consumer_group['consumer_ids']:
        consumer_call_requests = consumer_content_uninstall_itinerary(
            consumer_id, units, options)
        consumer_group_call_requests_list.extend(consumer_call_requests)

    return consumer_group_call_requests_list