CLI: support homedoc in client
Support to display the detailed resource doc of Zaqar server. Change-Id: If5281c1f9ffc1399f8a8a04124209282ee5049f0 Closes-Bug: #1683250
This commit is contained in:
parent
33a3681157
commit
5eea275769
@ -102,6 +102,7 @@ openstack.messaging.v2 =
|
||||
queue_signed_url = zaqarclient.queues.v2.cli:CreateSignedUrl
|
||||
messaging_ping = zaqarclient.queues.v2.cli:Ping
|
||||
messaging_health = zaqarclient.queues.v2.cli:Health
|
||||
messaging_homedoc = zaqarclient.queues.v2.cli:HomeDoc
|
||||
message_post = zaqarclient.queues.v2.cli:PostMessages
|
||||
message_list = zaqarclient.queues.v2.cli:ListMessages
|
||||
|
||||
|
@ -92,4 +92,9 @@ V2.schema.update({
|
||||
'ref': 'health',
|
||||
'method': 'GET',
|
||||
},
|
||||
|
||||
'homedoc': {
|
||||
'ref': '',
|
||||
'method': 'GET',
|
||||
},
|
||||
})
|
||||
|
@ -559,3 +559,15 @@ class Health(command.Command):
|
||||
client = _get_client(self, parsed_args)
|
||||
health = client.health()
|
||||
print(json.dumps(health, indent=4, sort_keys=True))
|
||||
|
||||
|
||||
class HomeDoc(command.Command):
|
||||
"""Display the resource doc of Zaqar server"""
|
||||
|
||||
_description = _("Display detailed resource doc of Zaqar server")
|
||||
log = logging.getLogger(__name__ + ".HomeDoc")
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
client = _get_client(self, parsed_args)
|
||||
homedoc = client.homedoc()
|
||||
print(json.dumps(homedoc, indent=4, sort_keys=True))
|
||||
|
@ -104,3 +104,9 @@ class Client(client.Client):
|
||||
"""Gets the detailed health status of Zaqar server."""
|
||||
req, trans = self._request_and_transport()
|
||||
return core.health(trans, req)
|
||||
|
||||
@decorators.version(min_version=1.1)
|
||||
def homedoc(self):
|
||||
"""Get the detailed resource doc of Zaqar server"""
|
||||
req, trans = self._request_and_transport()
|
||||
return core.homedoc(trans, req)
|
||||
|
@ -305,3 +305,21 @@ def health(transport, request, callback=None):
|
||||
request.operation = 'health'
|
||||
resp = transport.send(request)
|
||||
return resp.deserialized_content
|
||||
|
||||
|
||||
def homedoc(transport, request, callback=None):
|
||||
"""Get the detailed resource doc of Zaqar server
|
||||
|
||||
:param transport: Transport instance to use
|
||||
:type transport: `transport.base.Transport`
|
||||
:param request: Request instance ready to be sent.
|
||||
:type request: `transport.request.Request`
|
||||
:param callback: Optional callable to use as callback.
|
||||
If specified, this request will be sent asynchronously.
|
||||
(IGNORED UNTIL ASYNC SUPPORT IS COMPLETE)
|
||||
:type callback: Callable object.
|
||||
"""
|
||||
|
||||
request.operation = 'homedoc'
|
||||
resp = transport.send(request)
|
||||
return resp.deserialized_content
|
||||
|
Loading…
x
Reference in New Issue
Block a user