Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DescriptionGetting the schema of a table
Resource Path

/analytics/tables/{tableName}/schema

HTTP MethodGET
Request/Response Formatapplication/json
AuthenticationBasic
Parameter description
ParameterDescription
{tableName}Name The name of the table of which , the schema is required.

Sample cURL command

Code Block
curl -H "Content-Type: application/json" -H "Authorization: Basic YWRtaW46YWRtaW4=" -v https://localhost:9443/analytics/tables/ORG_WSO2_DAS_SAMPLE_SMART_HOME_DATA/schema -k

 

Example

Code Block
languagepowershell
GET https://localhost:9443/analytics/tables/testtable/schema

Sample output

Code Block
languagetext
{
       
"columns":
{"house_id": {
                "logFile" : {
                        "type" : "STRING",
                        "isIndex" : true,
                        "isScoreParam" : false
                },
                "weight" : {
                        "type" : "DOUBLE",
                        "isIndex" : true,
                        "isScoreParam" : false
                }
        },
        "primaryKeys" : ["logFile", "logLine"{"type":"INTEGER","isScoreParam":false,"isIndex":false},"metro_area":{"type":"STRING","isScoreParam":false,"isIndex":false},"state":{"type":"STRING","isScoreParam":false,"isIndex":false},"device_id":{"type":"INTEGER","isScoreParam":false,"isIndex":false},"power_reading":{"type":"FLOAT","isScoreParam":false,"isIndex":false},"is_peak":{"type":"BOOLEAN","isScoreParam":false,"isIndex":false}},
"primaryKeys":[]
}

REST API response

 

HTTP status code

200, 404

For descriptions of the HTTP status codes, see HTTP Status Codes.