summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinran <xin-ran.wang@intel.com>2017-10-30 11:02:02 +0800
committerXinran WANG <xin-ran.wang@intel.com>2017-10-30 03:24:20 +0000
commite81187d703bc961be075dda4ad9c8d9673e64e06 (patch)
treebbfcf20188e8f20c2a9a01d2d69df51c1ee68384
parent8d2d165755d2563cac44b788f33a5de4efd2a210 (diff)
Complete the comments for pagination support.
Notes
Notes (review): Code-Review+2: Zhenguo Niu <Niu.ZGlinux@gmail.com> Code-Review+2: liusheng <liusheng2048@gmail.com> Workflow+1: liusheng <liusheng2048@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 31 Oct 2017 04:13:43 +0000 Reviewed-on: https://review.openstack.org/516171 Project: openstack/mogan Branch: refs/heads/master
-rw-r--r--mogan/api/controllers/v1/servers.py42
1 files changed, 41 insertions, 1 deletions
diff --git a/mogan/api/controllers/v1/servers.py b/mogan/api/controllers/v1/servers.py
index 4ff10e5..7cdfc7f 100644
--- a/mogan/api/controllers/v1/servers.py
+++ b/mogan/api/controllers/v1/servers.py
@@ -635,8 +635,25 @@ class ServerController(ServerControllerBase):
635 sort_dir='asc', all_tenants=None): 635 sort_dir='asc', all_tenants=None):
636 """Retrieve a list of server. 636 """Retrieve a list of server.
637 637
638 :param name: Optional, to get the servers with this name
639 :param status: Optional, to get the servers in this status
640 :param flavor_uuid: Optional, to get the servers built with this
641 flavor.
642 :param flavor_name: Optional, to get the servers built with this
643 flavor.
644 :param image_uuid: Optional, to get the servers built with this
645 image.
646 :param ip: Optional, to get the servers with this ip address.
647 :param limit: Optional, to determinate the maximum number of servers to
648 return.
649 :param marker: Optional, to display a list of servers after this
650 marker.
638 :param fields: Optional, a list with a specified set of fields 651 :param fields: Optional, a list with a specified set of fields
639 of the resource to be returned. 652 of the resource to be returned.
653 :param sort_key: Optional, to sort the returned server list by this
654 specified key value.
655 :param sort_dir: Optional, to return a list of servers with this
656 sort direction.
640 :param all_tenants: Optional, allows administrators to see the 657 :param all_tenants: Optional, allows administrators to see the
641 servers owned by all tenants, otherwise only the 658 servers owned by all tenants, otherwise only the
642 servers associated with the calling tenant are 659 servers associated with the calling tenant are
@@ -674,8 +691,31 @@ class ServerController(ServerControllerBase):
674 flavor_uuid=None, flavor_name=None, image_uuid=None, ip=None, 691 flavor_uuid=None, flavor_name=None, image_uuid=None, ip=None,
675 limit=None, marker=None, sort_key='id', sort_dir='asc', 692 limit=None, marker=None, sort_key='id', sort_dir='asc',
676 all_tenants=None): 693 all_tenants=None):
677 """Retrieve detail of a list of servers.""" 694 """Retrieve detail of a list of servers.
678 # /detail should only work against collections 695 # /detail should only work against collections
696
697 :param name: Optional, to get the servers with this name
698 :param status: Optional, to get the servers in this status
699 :param flavor_uuid: Optional, to get the servers built with this
700 flavor.
701 :param flavor_name: Optional, to get the servers built with this
702 flavor.
703 :param image_uuid: Optional, to get the servers built with this
704 image.
705 :param ip: Optional, to get the servers with this ip address.
706 :param limit: Optional, to determinate the maximum number of servers to
707 return.
708 :param marker: Optional, to display a list of servers after this
709 marker.
710 :param sort_key: Optional, to sort the returned server list by this
711 specified key value.
712 :param sort_dir: Optional, to return a list of servers with this
713 sort direction.
714 :param all_tenants: Optional, allows administrators to see the
715 servers owned by all tenants, otherwise only the
716 servers associated with the calling tenant are
717 included in the response.
718 """
679 cdict = pecan.request.context.to_policy_values() 719 cdict = pecan.request.context.to_policy_values()
680 policy.authorize('mogan:server:get', cdict, cdict) 720 policy.authorize('mogan:server:get', cdict, cdict)
681 parent = pecan.request.path.split('/')[:-1][-1] 721 parent = pecan.request.path.split('/')[:-1][-1]