skip to main content
Hybrid Data Pipeline API reference : Management API : Schema API : Get column information for a specified table
  

Try Now
Get column information for a specified table

Purpose

Retrieve column information for a specified table.
Important: When a schema has been specified for the Metadata Exposed Schemas option in the Web UI (or the 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. For details on Metadata Exposed Schemas, see the parameters topic for your data source type.
Note: An administrator can execute this operation on behalf of a user by appending the user query parameter to the request and specifying a user name. See also Managing resources on behalf of users.

Method

GET

URL

For data stores that support schemas
https://<myserver>:<port>/api/mgmt/datasources/<datasourceid>/
schemas/<schemaName>/tables/<tableName>/columns?user=<userName>
For data stores that do not support schemas
GET https://<myserver>:<port>/api/mgmt/datasources/<datasourceid>/
schemas/-/tables/<tableName>/columns?user=<userName>

URL Parameters

<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a standalone installation, or the machine hosting the load balancer for a load balancer installation. For a standalone installation, <port> is the port number specified as the Server Access Port during installation. For a load balancer installation, <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 (-) is returned.
Required
For data stores that support schemas, a valid schema name.
For data stores that do not support schemas, a dash (-) is returned.
"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.

Method

GET

Response definition

The response takes the following format. The properties of the response are described in the table that follows.
{
"columns": [
{
"name": "colname1",
"isPrimaryKey": boolean
},
{
"name": "colname2"
}
]
}
Property
Description
Valid Values
"name"
The name of the column for which information is being retrieved
A column name can contain only alphanumeric characters and the underscore character.
"isPrimaryKey"
Indicates whether the column is a primary key or comprises the primary key
true | false
If true, the column is a primary key or comprises the primary key.
If false, the column is not a primary key and the property is not returned.
Note that the schema might specify more than one column to define the primary key.

Sample server success response

{
"columns": [
{
"name": "ROWID"
},
{
"name": "SYS_ISDELETED"
},
{
"name": "MasterRecordId"
},
{
"name": "SYS_NAME"
}
]
}

Sample server failure response

Error 404 is returned if the schema does not exist.

Authentication

The user must have the MgmtAPI (11) and ViewDataSource (2) permissions.