def __init__(self, *args, **kwargs):
    super(VnodLocalSystem, self).__init__(*args, **kwargs)


def getAdminstrativeState(self):
    return self.administrativeState


def setAdminstrativeState(self, value):
    self.administrativeState = value


def getRestUrl(self):
    return self.restUrl

