Updated exposed services and webservises api/cmd.

Change-Id: I934e916155cff935e70fbe880d7fddfd664e29f5
This commit is contained in:
Nicola Peditto 2021-11-04 13:12:25 +01:00
parent 3e8ed1db87
commit a102f16b9e
6 changed files with 46 additions and 4 deletions

View File

@ -104,3 +104,10 @@ class ExposedServiceManager(base.Manager):
path = "%(board)s/services/restore" % {
'board': board_ident}
return self._list(self._path(path), "exposed")
def status_services(self, board_ident):
path = "%(board)s/services/status" % {
'board': board_ident}
return self._list(self._path(path), "exposed")

View File

@ -130,3 +130,13 @@ def do_restore_services(cc, args):
json_flag=args.json)
else:
print(_('%s') % 'no services could be found')
@cliutils.arg('board',
metavar='<board>',
help="Name or UUID of the board.")
def do_status_services(cc, args):
"""Get status of sevices of the board."""
result = cc.exposed_service.status_services(args.board)
print(_('%s') % result)

View File

@ -187,6 +187,10 @@ class WebServiceOnBoardManager(base.CreateManager):
return self.api.raw_request('DELETE', self._path(path))
def renew_webservice(self, board_ident):
path = "%s/webservices/renew" % board_ident
return self.api.raw_request('GET', self._path(path))
class EnabledWebservice(base.Resource):
def __repr__(self):

View File

@ -311,6 +311,13 @@ def do_enable_webservices(cc, args):
def do_disable_webservices(cc, args):
cc.webserviceonboard.disable_webservice(args.board)
@cliutils.arg(
'board',
metavar='<board_uuid>',
help="UUID of the board ")
def do_renew_webservice(cc, args):
cc.webserviceonboard.renew_webservice(args.board)
@cliutils.arg(
'--limit',

15
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 2.3.1
envlist = py27,pep8
envlist = py36,py37,py38,pep8
skipsdist = True
[testenv]
@ -19,12 +19,19 @@ commands =
find . -type f -name "*.pyc" -delete
[testenv:pep8]
basepython = python2.7
basepython = python3.8
#commands = /usr/local/bin/flake8 {posargs}
commands = flake8 {posargs}
[testenv:py27]
basepython = python2.7
[testenv:py36]
basepython = python3.6
[testenv:py37]
basepython = python3.7
[testenv:py38]
basepython = python3.8
[flake8]
# TODO(dmllr): Analyze or fix the warnings blacklisted below

7
zuul.d/projects.yaml Normal file
View File

@ -0,0 +1,7 @@
- project:
templates:
- openstack-python38-jobs-no-constraints
- openstack-python37-jobs-no-constraints
- openstack-python36-jobs-no-constraints
- check-requirements
- publish-to-pypi