Added a Vitrage client

Story: 2002684
Task: 23116
Change-Id: If05f0907d8f43f64327c7774170e5b559286fc06
This commit is contained in:
Ifat Afek 2019-02-20 17:48:36 +00:00 committed by Eyal
parent 21aed54e5c
commit ab584e500e
8 changed files with 63 additions and 1 deletions

View File

@ -75,3 +75,4 @@ We have integration with
* https://opendev.org/openstack/python-blazarclient (reservation service)
* https://opendev.org/openstack/python-octaviaclient.git (Load-balancer service)
* https://opendev.org/openstack/python-senlinclient (Clustering service)
* https://opendev.org/openstack/python-vitrageclient.git (RCA service)

View File

@ -448,7 +448,7 @@ def list_opts():
for client in ('aodh', 'barbican', 'cinder', 'designate',
'glance', 'heat', 'keystone', 'magnum', 'manila', 'mistral',
'monasca', 'neutron', 'nova', 'octavia', 'sahara', 'senlin',
'swift', 'trove', 'zaqar'
'swift', 'trove', 'vitrage', 'zaqar'
):
client_specific_group = 'clients_' + client
yield client_specific_group, clients_opts

View File

@ -0,0 +1,30 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine.clients import client_plugin
from oslo_log import log as logging
from vitrageclient import client as vitrage_client
LOG = logging.getLogger(__name__)
CLIENT_NAME = 'vitrage'
class VitrageClientPlugin(client_plugin.ClientPlugin):
exceptions_module = None
service_types = [RCA] = ['rca']
def _create(self):
return vitrage_client.Client('1', self.context.keystone_session)

View File

@ -0,0 +1,24 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from heat.tests import common
from heat.tests import utils
class VitrageClientPluginTest(common.HeatTestCase):
def test_create(self):
context = utils.dummy_context()
plugin = context.clients.client_plugin('vitrage')
client = plugin.client()
self.assertIsNotNone(client.template.list)

View File

@ -124,6 +124,7 @@ python-saharaclient==1.4.0
python-subunit==1.2.0
python-swiftclient==3.2.0
python-troveclient==2.2.0
python-vitrageclient==2.7.0
python-zaqarclient==1.3.0
python-zunclient==3.4.0
pytz==2013.6

View File

@ -0,0 +1,4 @@
---
features:
- Introduce a Vitrage client plugin module that will be used by the
Vitrage resources.

View File

@ -50,6 +50,7 @@ python-openstackclient>=3.12.0 # Apache-2.0
python-saharaclient>=1.4.0 # Apache-2.0
python-swiftclient>=3.2.0 # Apache-2.0
python-troveclient>=2.2.0 # Apache-2.0
python-vitrageclient>=2.7.0 # Apache-2.0
python-zaqarclient>=1.3.0 # Apache-2.0
python-zunclient>=3.4.0 # Apache-2.0
pytz>=2013.6 # MIT

View File

@ -86,6 +86,7 @@ heat.clients =
senlin = heat.engine.clients.os.senlin:SenlinClientPlugin
swift = heat.engine.clients.os.swift:SwiftClientPlugin
trove = heat.engine.clients.os.trove:TroveClientPlugin
vitrage = heat.engine.clients.os.vitrage:VitrageClientPlugin
zaqar = heat.engine.clients.os.zaqar:ZaqarClientPlugin
zun = heat.engine.clients.os.zun:ZunClientPlugin