2d17e9849f
The NTP/PTP selection will now be done per host. NTP will the default selection. This commit; -Removes the enabled flag NTP and PTP API. Updates the CLI commands and the database. -Adds the parameter clock_synchronization to the host API. Valid values are ‘ntp’ and ‘ptp’. Updates the host CLI commands and the database. -Updates puppet to set NTP/PTP per host . -Updates the RestAPI documentation. Story: 2006499 Task: 36464 Change-Id: I37bbb30a014301f8786cb02e35f0a1bd39d2f4aa Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
########################################################################
|
|
#
|
|
# Copyright (c) 2018-2019 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
########################################################################
|
|
|
|
from sysinv.db import api as db_api
|
|
from sysinv.objects import base
|
|
from sysinv.objects import utils
|
|
|
|
|
|
class PTP(base.SysinvObject):
|
|
|
|
dbapi = db_api.get_instance()
|
|
|
|
fields = {
|
|
'id': int,
|
|
'uuid': utils.str_or_none,
|
|
|
|
'mode': utils.str_or_none,
|
|
'transport': utils.str_or_none,
|
|
'mechanism': utils.str_or_none,
|
|
|
|
'isystem_uuid': utils.str_or_none,
|
|
'system_id': utils.int_or_none
|
|
}
|
|
|
|
_foreign_fields = {
|
|
'isystem_uuid': 'system:uuid'
|
|
}
|
|
|
|
@base.remotable_classmethod
|
|
def get_by_uuid(cls, context, uuid):
|
|
return cls.dbapi.ptp_get(uuid)
|
|
|
|
def save_changes(self, context, updates):
|
|
self.dbapi.ptp_update(self.uuid, # pylint: disable=no-member
|
|
updates)
|