File: search.py

package info (click to toggle)
python-softlayer 6.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,100 kB
  • sloc: python: 53,771; makefile: 289; sh: 57
file content (36 lines) | stat: -rw-r--r-- 955 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
    SoftLayer.search
    ~~~~~~~~~~~~~~~~~~
    Search Manager

    :license: MIT, see LICENSE for more details.
"""


class SearchManager(object):
    """Manager to help searcha via the SoftLayer API.

    :param SoftLayer.API.BaseClient client: the client instance
    """

    def __init__(self, client):
        self.client = client
        self.search_manager = client['SoftLayer_Search']

    def get_object_types(self):
        """returns a collection of SoftLayer_Container_Search_ObjectType containers.

        """
        return self.search_manager.getObjectTypes()

    def search(self, search_string):
        """allows for searching for SoftLayer resources by simple phrase.

        """
        return self.search_manager.search(search_string)

    def advanced(self, search_string):
        """allows for searching for SoftLayer resources by simple phrase.

        """
        return self.search_manager.advancedSearch(search_string)