예제 #1
0
    def get_one(self, host_id):
        """Retrieve information about the given host.

        :param host_ident: UUID or name of a host.
        """
        context = pecan.request.context
        policy.enforce(context, "host:get", action="host:get")
        host = _get_host(host_id)
        return view.format_host(pecan.request.host_url, host)
예제 #2
0
    def get_one(self, host_ident):
        """Retrieve information about the given host.

        :param host_ident: UUID or name of a host.
        """
        context = pecan.request.context
        policy.enforce(context, "host:get", action="host:get")
        host = api_utils.get_resource('ComputeNode', host_ident)
        return view.format_host(pecan.request.host_url, host)
예제 #3
0
파일: hosts.py 프로젝트: openstack/higgins
    def get_one(self, host_ident):
        """Retrieve information about the given host.

        :param host_ident: UUID or name of a host.
        """
        context = pecan.request.context
        policy.enforce(context, "host:get", action="host:get")
        host = _get_host(host_ident)
        return view.format_host(pecan.request.host_url, host)
예제 #4
0
 def convert_with_links(nodes, limit, url=None,
                        expand=False, **kwargs):
     collection = HostCollection()
     collection.hosts = [view.format_host(url, p) for p in nodes]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
예제 #5
0
파일: hosts.py 프로젝트: openstack/higgins
 def convert_with_links(nodes, limit, url=None,
                        expand=False, **kwargs):
     collection = HostCollection()
     collection.hosts = [view.format_host(url, p) for p in nodes]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection