Пример #1
0
class ClusterDelNodesRequest(base.SenlinObject):

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

    fields = {
        'identity': fields.StringField(),
        'nodes': fields.IdentityListField(min_items=1),
        'destroy_after_deletion': fields.BooleanField(nullable=True,
                                                      default=False)
    }

    def obj_make_compatible(self, primitive, target_version):
        super(ClusterDelNodesRequest, self).obj_make_compatible(
            primitive, target_version)
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1):
            if 'destroy_after_deletion' in primitive['senlin_object.data']:
                del primitive['senlin_object.data']['destroy_after_deletion']
Пример #2
0
class ClusterAddNodesRequest(base.SenlinObject):

    fields = {
        'identity': fields.StringField(),
        'nodes': fields.IdentityListField(min_items=1)
    }