Get table information
- Last Updated: February 2, 2024
- 2 minute read
- Hybrid Data Pipeline
- Version 5.0
- Documentation
Purpose
Retrieves the details of the specified table.
HDPMetadataExposedSchemas property via the Data Sources API), the
Schema API can only be used to query the specified schema. If the schema specifed
for Metadata Exposed Schemas does not match
the schema in the Schema API URL, then an empty result set will be returned.Method
GET
URL
For data stores that support schemas
https://<myserver>:<port>/api/mgmt/datasources/<datasourceid>/
schemas/<schemaName>/tables/<tableName>?user=<userName>
For data stores that do not support schemas
https://<myserver>:<port>/api/mgmt/datasources/<datasourceid>/
schemas/-/tables/<tableName>?user=<userName>
URL Parameters
<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a non-load balancer deployment, or the machine hosting the load balancer for a load balancer deployment. For a non-load balancer deployment, <port> is the port number specified as the Server Access Port during deployment. For a load balancer deployment, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.
| Parameter | Description | Usage | Valid Values |
|---|---|---|---|
| "datasourceId" | The ID of the data source | Required | The ID is auto-generated when the data source is created and cannot be changed. |
| "schemaName" | For data stores that support schemas, the name
of a schema associated with the data source. For data stores that
do not support schemas, a dash ( |
Required | For data stores that support schemas, a valid
schema name. For data stores that do not support schemas, a dash
( |
| "tableName" | The name of the table for which information is being retrieved | Required | A table name can contain only alphanumeric characters and the underscore character. |
Response Definition
The response takes the following format. The properties of the response are described in the table that follows.
{
"table": {
"name": "tableName",
"hasPrimaryKey": boolean,
"columns": [
{
"name": "colName1",
"isPrimaryKey": boolean
},
{
"name": "colName2"
},
...
]
}
}
| Property | Description | Valid Values |
|---|---|---|
| "name" | The name of the table for which information is being retrieved | A table name can contain only alphanumeric characters and the underscore character. |
| "hasPrimaryKey" | Specifies whether the table contains a primary key | true | falseIf If |
| "columns" | Provides a list of columns in the table. If the table has a primary key, this parameter identifies the column or columns that comprise the primary key. | A comma separated list of column objects The
The |
Sample Server Success Response
{
"tables": {
"name": "Account",
"hasPrimaryKey": true,
"columns": [
{{
"name": "ROWID",
"isPrimaryKey": true
},
{
"name": "SYS_ISDELETED"
},
{
"name": "MasterRecordId"
},
{
"name": "SYS_NAME"
}
]
}
}
Sample Server Failure Response
Error 404 is returned if the schema does not exist.
Authentication
Basic Authentication using Login ID and Password.
Authorization
The user must have the MgmtAPI (11) and ViewDataSource (2) permissions.