nfv/nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/patching.py
Bart Wensley e547b8c136 Add support for containerized keystone to VIM
Adding support to the VIM for containerized keystone. The
VIM will now support two keystone instances:
- platform: bare metal keystone used to authenticate with
  platform services (e.g. sysinv, patching)
- openstack: containerized keystone used to authenticate with
  openstack services (e.g. nova, neutron, cinder)

For now, the VIM will use the same baremetal keystone for both
the platform and openstack, because we still only deploy with
the baremetal keystone.

Story: 2002876
Task: 26872

Depends-On: If4bd46a4c14cc65978774001cb2887e5d3e3607b
Change-Id: Id1ec639aa347e0c4e4019576d3c36c8c72aefedf
2018-10-03 08:29:08 -05:00

54 lines
1.5 KiB
Python
Executable File

#
# Copyright (c) 2016-2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_plugins.nfvi_plugins.openstack.objects import PLATFORM_SERVICE
from nfv_plugins.nfvi_plugins.openstack.rest_api import rest_api_request
DLOG = debug.debug_get_logger('nfv_plugins.nfvi_plugins.openstack.patching')
def query_patches(token):
"""
Asks Patch Controller for information about the patches in the system
"""
url = token.get_service_url(PLATFORM_SERVICE.PATCHING, strip_version=True)
if url is None:
raise ValueError("OpenStack Patching URL is invalid")
api_cmd = url + "/v1/query"
response = rest_api_request(token, "GET", api_cmd)
return response
def query_hosts(token):
"""
Asks Patch Controller for information about the hosts in the system
"""
url = token.get_service_url(PLATFORM_SERVICE.PATCHING, strip_version=True)
if url is None:
raise ValueError("OpenStack Patching URL is invalid")
api_cmd = url + "/v1/query_hosts"
response = rest_api_request(token, "GET", api_cmd)
return response
def host_install_async(token, host_name):
"""
Asks Patch Controller to perform a software upgrade on a host
"""
url = token.get_service_url(PLATFORM_SERVICE.PATCHING, strip_version=True)
if url is None:
raise ValueError("OpenStack Patching URL is invalid")
api_cmd = url + "/v1/host_install_async/%s" % str(host_name)
response = rest_api_request(token, "POST", api_cmd)
return response