Set breakpoints with Pdb.set_trace () and follow the Nova/api/openstack/compute/servers.py-detail () process

Source: Internet
Author: User

By

Curl-s-H "X-auth-token: $OS _token" Http://192.168.153.128:8774/v2.1/servers/detail | Python-m json.tool command;

Get results:

{
"Servers": [] Note: Because servers is a core resource, all returns are empty.
}

1/opt/stack/nova/nova/api/openstack/compute/servers.py (detail) () Pdb.set_trace ()

11/opt/stack/nova/nova/api/openstack/wsgi.py (867) __getattribute__ ():
12/opt/stack/nova/nova/api/openstack/compute/servers.py (215) _get_servers (): "" "Returns servers, based on search Options specified. "" "
# # #search_opts. Update (req. GET)
121/usr/local/lib/python2.7/dist-packages/webob/request.py (813) GET (): "" "Return a multidict containing all the Variables from the query_string. "" "
122/usr/local/lib/python2.7/dist-packages/webob/multidict.py (255) keys ():
13/opt/stack/nova/nova/api/openstack/compute/servers.py (1106) _get_server_search_options (): "" "Return server Search options allowed by non-admin. "" "
14/opt/stack/nova/nova/api/openstack/api_version_request.py (126) is_supported (): "" "Check if API request version Satisfies version restrictions. "" "
# # #search_options: (' reservation_id ', ' name ', ' status ', ' image ', ' Flavor ', ' IP ', ...)
15/opt/stack/nova/nova/api/openstack/compute/servers.py (1187) remove_invalid_options (): "" "Remove search options That is not valid for non-admin api/context. "" "
16/opt/stack/nova/nova/api/openstack/common.py (521) is_all_tenants (): "" "Checks to see if the all_tenants flag are in Search_opts "" "
17>/opt/stack/nova/nova/api/openstack/compute/servers.py (332) _get_servers ()
Limit, marker = Common.get_limit_and_marker (req):
171/opt/stack/nova/nova/api/openstack/common.py (236) Get_limit_and_marker (): "" "get limited parameter from request." "
18>/opt/stack/nova/nova/api/openstack/compute/servers.py (333) _get_servers ()
-Sort_keys, Sort_dirs = Common.get_sort_params (req.params):
181>/usr/local/lib/python2.7/dist-packages/webob/request.py (846) params ()
182>/opt/stack/nova/nova/api/openstack/common.py (145) Get_sort_params ()
def get_sort_params (Input_params, default_key= ' created_at ', default_dir= ' desc '): "" Processes the parameters to Create a list of sort keys and sort directions that correspond to the ' Sort_key ' and ' sort_dir ' parameter values. ""
# # # return Sort_keys, Sort_dirs-([' Created_at '], [' DESC '])

19>/opt/stack/nova/nova/api/openstack/compute/servers.py (337) _get_servers ()
, expected_ Attrs.append (' services ')
20>/opt/stack/nova/nova/api/openstack/compute/servers.py (343) _get_servers ()
-Expected_attrs = Self._view_builder.get_show_expected_attrs (expected_attrs)
201>/opt/stack/nova/nova/ api/openstack/compute/views/servers.py (Get_show_expected_attrs) ()
Def get_show_expected_attrs (self, Expected_attrs=none):
# # #return sorted (list (set (Self._show_expected_attrs + expected_attrs))
21>/opt/ stack/nova/nova/api/openstack/compute/servers.py (347) _get_servers ()
, instance_list = Self.compute_api.get _all (elevated or context,search_opts=search_opts, Limit=limit, Marker=marker,expected_attrs=expected_attrs,
Sort_keys=sort_keys, Sort_dirs=sort_dirs)

211--call--
>/opt/stack/nova/nova/compute/api.py (2226) Get_all ()
def get_all (self, context, Search_opts=none, Limit=none, Marker=none,expected_attrs=none, Sort_keys=none, Sort_ Dirs=none): "" "Get all instances filtered by one of the given parameters." "

22>/opt/stack/nova/nova/api/openstack/compute/servers.py (213) Detail ()
--Return servers
221>/opt/stack/nova/nova/api/openstack/extensions.py (338) wrapped ()->{' servers ': []}
--return F (*args, **kwargs)
222>/opt/stack/nova/nova/api/openstack/wsgi.py (749) dispatch ()->{' servers ': []}
--Return method (Req=request, **action_args)
223>/opt/stack/nova/nova/api/openstack/wsgi.py (417) __exit__ ()
def __exit__ (self, ex_type, Ex_value, Ex_traceback):
224>/opt/stack/nova/nova/api/openstack/wsgi.py (669) _process_stack ()
If not response:
225>/opt/stack/nova/nova/api/openstack/wsgi.py (705) _process_stack ()-><respons...c OK>
--Return response
226>/opt/stack/nova/nova/api/openstack/wsgi.py (607) __call__ ()-><respons...c OK>
Content_Type, body, accept)
227>/usr/local/lib/python2.7/dist-packages/webob/dec.py (195) call_func ()-><respons...c OK>
--Return Self.func (req, *args, **kwargs)
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (133) __call__ ()
If RESP is None:
(PDB) n
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (136) __call__ ()
If Isinstance (resp, text_type):
(PDB) n
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (138) __call__ ()
If Isinstance (resp, bytes):
(PDB) n
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (142) __call__ ()
If RESP is not req.response:
(PDB) n
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (143) __call__ ()
-resp = req.response.merge_cookies (resp)
(PDB) n
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (144) __call__ ()
--Return resp (environ, start_response)
(PDB) n
--return--
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (144) __call__ ()->[' {"Servers": []} ']
--Return resp (environ, start_response)
(PDB) n
--return--
>/usr/local/lib/python2.7/dist-packages/webob/dec.py (144) __call__ ()->[' {"Servers": []} ']
--Return resp (environ, start_response)
(PDB) n
>/usr/local/lib/python2.7/dist-packages/routes/middleware.py (144) __call__ ()
Try:

Set breakpoints with Pdb.set_trace () and follow the Nova/api/openstack/compute/servers.py-detail () process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.