StarlingX System Configuration Management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
config/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/kube_config_kubelet.py

36 lines
1015 B

########################################################################
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
########################################################################
import pecan
from pecan import expose
from pecan import rest
from sysinv.common import utils as cutils
from sysinv.openstack.common.rpc.common import RemoteError
LOCK_NAME = 'KubeConfigKubeletController'
class KubeConfigKubeletController(rest.RestController):
"""REST controller for kube_config_kubelet."""
_custom_actions = {
'apply': ['POST'],
}
@expose('json')
@cutils.synchronized(LOCK_NAME)
def apply(self):
try:
pecan.request.rpcapi.kube_config_kubelet(pecan.request.context)
except RemoteError as e:
return dict(success="", error=e.value)
except Exception as ex:
return dict(success="", error=str(ex))
return dict(success="kube-config-kubelet applied.", error="")