You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
endpoint: http://localhost/api/yang-search/v2/grep_search (replace localhost with yc-frontend if you want to get the information from one of the containers e.g yc-backend using requests.get())
query params search_string - the actual string a user wants to search for. For example, you can use these searches to test it locally: 'organization' - this gives the most results, typedef dscp {\n.*type uint8 {\n.*range "0..63";\n.*} - a more complicated search, this one gives me only two results locally.
The main idea of the search string is that if we have a module that contains such a part:
typedef dscp {
type uint8 {
range "0..63";
}
every line break is matched by these chars\n.*, this is actually how the pcregrep search works organizations - the list of organizations that modules should belong to, this param should be passed in such a way: ?organizations=ietf&organizations=mef, which means that organizations are ['ietf', 'mef'] inverted_search - true/false string which indicates if the result must contain all modules satisfying the search or all the modules not satisfying the search case_sensitive - true/false string which indicates if the search must be case-sensitive or not previous_cursor, cursor- cursors that are needed for the backend to understand which modules are already searched, will be provided by the backend itself, for the first search request they both should be set to 0
response previous_page, next_page - URLs to the previous and next pages of the same search, the frontend should rely on them, in some edge cases (when all the modules are searched, or the cursor == 0) they can be just empty strings results - the list of the modules that satisfy the search (can be an empty list as well), for example:
the request URL should always be quoted with the utf-8 encoding to prevent inconsistent results, the example of an actual request: http://localhost/api/yang-search/v2/grep_search?search%3Dtypedef%20dscp%20%7B%5Cn.%2Atype%20uint8%20%7B%5Cn.%2Arange%20%220..63%22%3B%5Cn.%2A%7D%26organizations%3Dietf%3D%26inverted_search%3Dfalse%26case_sensitive%3Dfalse%26previous_cursor%3D0%26cursor%3D0
The text was updated successfully, but these errors were encountered:
endpoint: http://localhost/api/yang-search/v2/grep_search (replace
localhost
withyc-frontend
if you want to get the information from one of the containers e.gyc-backend
usingrequests.get()
)query params
search_string
- the actual string a user wants to search for. For example, you can use these searches to test it locally: 'organization' - this gives the most results,typedef dscp {\n.*type uint8 {\n.*range "0..63";\n.*}
- a more complicated search, this one gives me only two results locally.The main idea of the search string is that if we have a module that contains such a part:
every line break is matched by these chars
\n.*
, this is actually how the pcregrep search worksorganizations
- the list of organizations that modules should belong to, this param should be passed in such a way:?organizations=ietf&organizations=mef
, which means that organizations are['ietf', 'mef']
inverted_search
- true/false string which indicates if the result must contain all modules satisfying the search or all the modules not satisfying the searchcase_sensitive
- true/false string which indicates if the search must be case-sensitive or notprevious_cursor
,cursor
- cursors that are needed for the backend to understand which modules are already searched, will be provided by the backend itself, for the first search request they both should be set to 0response
previous_page
,next_page
- URLs to the previous and next pages of the same search, the frontend should rely on them, in some edge cases (when all the modules are searched, or the cursor == 0) they can be just empty stringsresults
- the list of the modules that satisfy the search (can be an empty list as well), for example:the request URL should always be quoted with the
utf-8
encoding to prevent inconsistent results, the example of an actual request:http://localhost/api/yang-search/v2/grep_search?search%3Dtypedef%20dscp%20%7B%5Cn.%2Atype%20uint8%20%7B%5Cn.%2Arange%20%220..63%22%3B%5Cn.%2A%7D%26organizations%3Dietf%3D%26inverted_search%3Dfalse%26case_sensitive%3Dfalse%26previous_cursor%3D0%26cursor%3D0
The text was updated successfully, but these errors were encountered: