Beispiel #1
0
class EventListRequest(base.SenlinObject):

    action_name_list = list(consts.CLUSTER_ACTION_NAMES)
    action_name_list.extend(list(consts.NODE_ACTION_NAMES))

    fields = {
        'oid':
        fields.ListOfStringsField(nullable=True),
        'oname':
        fields.ListOfStringsField(nullable=True),
        'otype':
        fields.ListOfStringsField(nullable=True),
        'action':
        fields.ListOfEnumField(valid_values=action_name_list, nullable=True),
        'cluster_id':
        fields.ListOfStringsField(nullable=True),
        'level':
        fields.ListOfEnumField(valid_values=list(consts.EVENT_LEVELS.keys()),
                               nullable=True),
        'limit':
        fields.NonNegativeIntegerField(nullable=True),
        'marker':
        fields.UUIDField(nullable=True),
        'sort':
        fields.SortField(valid_keys=list(consts.EVENT_SORT_KEYS),
                         nullable=True),
        'project_safe':
        fields.FlexibleBooleanField(default=True)
    }
Beispiel #2
0
class ClusterListRequest(base.SenlinObject):

    fields = {
        'name': fields.ListOfStringsField(nullable=True),
        'status': fields.ListOfEnumField(
            valid_values=list(consts.CLUSTER_STATUSES), nullable=True),
        'limit': fields.NonNegativeIntegerField(nullable=True),
        'marker': fields.UUIDField(nullable=True),
        'sort': fields.SortField(
            valid_keys=list(consts.CLUSTER_SORT_KEYS), nullable=True),
        'project_safe': fields.FlexibleBooleanField(default=True),
    }
Beispiel #3
0
class ReceiverListRequest(base.SenlinObject):

    # VERSION 1.0: Initial version
    # VERSION 1.1: Add field 'user'
    VERSION = '1.1'
    VERSION_MAP = {
        '1.4': '1.1',
    }

    fields = {
        'name':
        fields.ListOfStringsField(nullable=True),
        'type':
        fields.ListOfEnumField(valid_values=list(consts.RECEIVER_TYPES),
                               nullable=True),
        'action':
        fields.ListOfEnumField(valid_values=list(consts.CLUSTER_ACTION_NAMES),
                               nullable=True),
        'cluster_id':
        fields.ListOfStringsField(nullable=True),
        'limit':
        fields.NonNegativeIntegerField(nullable=True),
        'marker':
        fields.UUIDField(nullable=True),
        'sort':
        fields.SortField(valid_keys=list(consts.RECEIVER_SORT_KEYS),
                         nullable=True),
        'project_safe':
        fields.FlexibleBooleanField(default=True),
        'user':
        fields.ListOfStringsField(nullable=True),
    }

    def obj_make_compatible(self, primitive, target_version):
        super(ReceiverListRequest,
              self).obj_make_compatible(primitive, target_version)
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1):
            if 'user' in primitive['senlin_object.data']:
                del primitive['senlin_object.data']['user']
Beispiel #4
0
class ReceiverListRequest(base.SenlinObject):

    fields = {
        'name':
        fields.ListOfStringsField(nullable=True),
        'type':
        fields.ListOfEnumField(valid_values=list(consts.RECEIVER_TYPES),
                               nullable=True),
        'action':
        fields.ListOfEnumField(valid_values=list(consts.CLUSTER_ACTION_NAMES),
                               nullable=True),
        'cluster_id':
        fields.ListOfStringsField(nullable=True),
        'limit':
        fields.NonNegativeIntegerField(nullable=True),
        'marker':
        fields.UUIDField(nullable=True),
        'sort':
        fields.SortField(valid_keys=list(consts.RECEIVER_SORT_KEYS),
                         nullable=True),
        'project_safe':
        fields.FlexibleBooleanField(default=True)
    }
Beispiel #5
0
class ActionListRequest(base.SenlinObject):
    action_name_list = list(consts.CLUSTER_ACTION_NAMES)
    action_name_list.extend(list(consts.NODE_ACTION_NAMES))

    VERSION = '1.1'
    VERSION_MAP = {'1.14': '1.1'}

    fields = {
        'name':
        fields.ListOfStringsField(nullable=True),
        'cluster_id':
        fields.ListOfStringsField(nullable=True),
        'action':
        fields.ListOfEnumField(valid_values=action_name_list, nullable=True),
        'target':
        fields.ListOfStringsField(nullable=True),
        'status':
        fields.ListOfEnumField(valid_values=list(consts.ACTION_STATUSES),
                               nullable=True),
        'limit':
        fields.NonNegativeIntegerField(nullable=True),
        'marker':
        fields.UUIDField(nullable=True),
        'sort':
        fields.SortField(valid_keys=list(consts.ACTION_SORT_KEYS),
                         nullable=True),
        'project_safe':
        fields.FlexibleBooleanField(default=True)
    }

    def obj_make_compatible(self, primitive, target_version):
        super(ActionListRequest,
              self).obj_make_compatible(primitive, target_version)
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 14):
            if 'cluster_id' in primitive['senlin_object.data']:
                del primitive['senlin_object.data']['cluster_id']
Beispiel #6
0
class ActionListRequest(base.SenlinObject):
    action_name_list = list(consts.CLUSTER_ACTION_NAMES)
    action_name_list.extend(list(consts.NODE_ACTION_NAMES))

    fields = {
        'name':
        fields.ListOfStringsField(nullable=True),
        'action':
        fields.ListOfEnumField(valid_values=action_name_list, nullable=True),
        'target':
        fields.ListOfStringsField(nullable=True),
        'status':
        fields.ListOfEnumField(valid_values=list(consts.ACTION_STATUSES),
                               nullable=True),
        'limit':
        fields.NonNegativeIntegerField(nullable=True),
        'marker':
        fields.UUIDField(nullable=True),
        'sort':
        fields.SortField(valid_keys=list(consts.ACTION_SORT_KEYS),
                         nullable=True),
        'project_safe':
        fields.FlexibleBooleanField(default=True)
    }