Purpose

Retrieves the names of the tables associated with a data source through the specified schema. For data stores that do not support schemas, retrieves the names of all tables associated with the data source.

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.
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.

URL

For data stores that support schemas

https://<myserver>:<port>/api/mgmt/datasources/
   <datasourceid>/schemas/<schemaName>/tables

For data stores that do not support schemas

For data stores that do not support schemas, use a dash (-) as the identifier in the URL when retrieving information about tables. For example:

https://<myserver>:<port>/api/mgmt/datasources/
   <datasourceid>/-/tables

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 (-) 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.

Method

GET

Response definition

The response takes the following format. The properties of the response are described in the table that follows.


{
  "tables": [
    {
    "name": "tableName1"
    },
    {
    "name": "tableName2"
    }     
  ]
}
Property Description Usage Valid Values
"name" The names of the tables associated with the data source Required A table name can contain only alphanumeric characters and the underscore character.

Sample server success response


{
  "tables": [
    {
      "name": "Account"
    },
    {
      "name": "Address"
    }     
  ]
}
			

Sample server failure response

{
   "error":{
      "code": 222207062,
      "message":{
         "lang":"en-US",
         "value":"The schema mySchemaName does not exist."
      }
   }
}

Authentication

Basic Authentication using Login ID and Password.

Authorization

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