424983d7eb
- Addition of new tables: kube_rootca_update kube_rootca_host_update - relational mapping to it. - New migration file - Additition of an API to handle those tables and a test to it - Changes to fit REST API from controllers - Addition of custom exceptions for error in queries - Setup of tox unit tests Story: 2008675 Task: 42404 Change-Id: I4cbe851fe14f1356ee1f367cbfd8aecf1b165fed Signed-off-by: Joao Soubihe <JoaoPaulo.Soubihe@windriver.com>
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
#
|
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
# coding=utf-8
|
|
#
|
|
|
|
from sysinv.db import api as db_api
|
|
from sysinv.objects import base
|
|
from sysinv.objects import utils
|
|
|
|
|
|
class KubeRootCAUpdate(base.SysinvObject):
|
|
|
|
dbapi = db_api.get_instance()
|
|
|
|
fields = {
|
|
'id': int,
|
|
'uuid': utils.str_or_none,
|
|
|
|
'from_rootca_cert': utils.str_or_none,
|
|
'to_rootca_cert': utils.str_or_none,
|
|
'state': utils.str_or_none,
|
|
'capabilities': utils.dict_or_none,
|
|
'reserved_1': utils.str_or_none,
|
|
'reserved_2': utils.str_or_none,
|
|
'reserved_3': utils.str_or_none,
|
|
}
|
|
|
|
@base.remotable_classmethod
|
|
def get_by_uuid(cls, context, uuid):
|
|
return cls.dbapi.kube_rootca_update_get(uuid)
|
|
|
|
@base.remotable_classmethod
|
|
def get_one(cls, context):
|
|
return cls.dbapi.kube_rootca_update_get_one()
|
|
|
|
def save_changes(self, context, updates):
|
|
self.dbapi.kube_rootca_update_update(self.uuid, # pylint: disable=no-member
|
|
updates)
|