Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

What is the Navigator RESTful API query to get back all entities with tags?

What is the Navigator RESTful API query to get back all entities with tags?

Explorer

If I'm in Navigator, this gives me all entities that have been tagged with "tag2":

http://localhost:7187/?view=resultsView&facets=%7B%22tags%22%3A%5B%22tag2%22%5D%7D

 

If I use the RESTful API, this query gets me all the tags that were used - but 0 count (see below) because no entities were returned:

http://localhost:7187/api/v1/interactive/entities?facetFields=tags

 

How do I query the RESTful API to get back all entities with tags?  Also I would like to restrict the query by last modified but that filter doesn't seem to be working.

 

I see the API doc page here, but examples are limited:

http://cloudera.github.io/navigator/apidocs/v1/

 

{
    "offset": 0,
    "totalMatched": 0,
    "limit": 100,
    "results": [],
    "highlighting": null,
    "facets": {
        "tags": {
            "sample": 0,
            "sometag": 0,
            "tag1": 0,
            "tag2": 0,
            "tag3": 0
        }
    },
    "facetQueries": null,
    "facetRanges": [],
    "qtime": 1
}

 

 

2 REPLIES 2

Re: What is the Navigator RESTful API query to get back all entities with tags?

Cloudera Employee

Hi dr3x,

 

The api docs are embedded in the product, so you can accsss them from the Navigator UI. You can also try out apis there.

 

Here is the api to get the entities with tags:

 

 

http://localhost:7187/api/v8/entities/?query=tags%3A*&limit=100&offset=0

Re: What is the Navigator RESTful API query to get back all entities with tags?

Cloudera Employee

Hi, to query for all entities that have tags, you can do the following query:

 

query=tags:*

 

As Vikas pointed out, to do a full extraction, you can do the following. Note that you'll need to do this in batches, using the limit and offset parameters.

query=*

 

Also note that in the C5.5 release, we're introducing the Navigator SDK, which will make it easier to work with Navigator's metadata in Java. You may want to check out our Incremental Extraction example.

 

Regards,

Mark.