View Data in a Data Source (REST API: GET)

This operation returns the data that is stored in the data source in Data Cube.

Note

You can view sample requests and responses for individual data sources on the REST API page for the data source in Data Cube. For information about how to view the example request and responses for your data sources, see Viewing REST APIs for Data Sources.

Request

Syntax

GET webservice/dcube/search/datasourceID/export?q=q&sort=SortField SortStyle&fl=CommaSeparatedFields
Host: Hostname
Accept: application/xml | application/json
Authtoken: authentication token

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Parameters

Name

Description

Required

dataSourceId

The data source ID for the data source.

If the data source ID is unknown, use the View Data Sources and Properties (REST API: GET) API to retrieve it.

Yes

q

The query used to return the data. To return all of the data, use *:*.

Only items that match the query are returned in the response.

Yes

sort

The field to sort by and the sort order. For example, sort=Size desc sorts by descending size.

Valid values are:

  • desc

  • asc

Yes

fl

A comma separated list of fields to return in the response. For example, fl=FileName,Size returns the file name and the file size.

Only the values of the defined fields are included in the response.

Sample values:

  • AccessTime

  • ClientId

  • CreatedTime

  • DenyAccessSID

  • DenyAccessUserName

  • DocumentType

  • FileContentHash

  • FileExtension

  • FileName

  • FileNameModifiedTimeHash

  • Size

Yes

Request Headers

Name

Description

Host

The host name of the Web Server or the Command Center used in the API request.

Accept

The format of the response data. Valid values are: application/xml or application/json.

Authtoken

The authentication token received after successfully logging on. For details about receiving an authentication token, see Request an Authentication Token.

Response

Response Parameters

Parameter

Description

Element

numFound

The number of files found in the data source.

response

fields from the fl parameter

The fields defined in the fl parameter appear in the response. For example, FileName is the name of the file.

docs

Examples

The following examples are for a file system data source.

Example Request

GET webservice/dcube/search/3446/export?q=*:*&sort=Size desc&fl=FileName,Size HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Content-type: text/plain
 Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc60f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef768fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f3233d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8

Example Response

{ "responseHeader": { "status": 0 }, "response": { "numFound": 279, "docs": [{ "FileName": "sqlline.log.2", "Size": 105791708 }, { "FileName": "sqlline.log.9", "Size": 105501844 }, { "FileName": "sqlline.log.3", "Size": 105500099 }, { "FileName": "sqlline.log.4", "Size": 105500093 }, { "FileName": "sqlline.log.7", "Size": 105500087 }, { "FileName": "sqlline.log.8", "Size": 105500087 }, { "FileName": "sqlline.log.10", "Size": 105500086 }, { "FileName": "sqlline.log.5", "Size": 105500086 }, { "FileName": "sqlline.log.6", "Size": 105500086 }, { "FileName": "sqlline.log.1", "Size": 104866743 }, { "FileName": "log", "Size": 0 }, { "FileName": "bin", "Size": 0 }] }
}
×

Loading...