Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying All Tables (Recommended)

Updated on 2022-12-07 GMT+08:00

Function

This API is used to query information about tables that meet the filtering criteria or all the tables in the specified database.

URI

  • URI format

    GET /v1.0/{project_id}/databases/{database_name}/tables

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.

    database_name

    Yes

    String

    Name of the database where the table resides.

    Table 2 query parameter description

    Parameter

    Mandatory

    Type

    Description

    keyword

    No

    String

    Keywords used to filter table names.

    with-detail

    No

    Boolean

    Whether to obtain detailed information about tables (such as owner and size). The default value is false.

    page-size

    No

    Integer

    Paging size. The minimum value is 1 and the maximum value is 100.

    current-page

    No

    Integer

    Current page number. The minimum value is 1.

    with-priv

    No

    Boolean

    Whether to return permission information.

    table-type

    No

    String

    Database table type. The options are as follows:

    • MANAGED_TABLE: DLI table
    • EXTERNAL_TABLE: OBS table
    • VIRTUAL_VIEW: view

    datasource-type

    No

    String

    Data source type. The options are as follows:

    • CloudTable
    • CSS
    • DLI
    • DWS
    • Geomesa
    • HBase
    • JDBC
    • Mongo
    • OBS
    • ODPS
    • OpenTSDB
    • Redis
    • RDS

    without-tablemeta

    No

    Boolean

    Whether to obtain the metadata of a table. The default value is false. If this parameter is set to true, the response speed can be greatly improved.

    NOTE:

    The following is an example of the URL containing the query parameter:

    GET /v1.0/{project_id}/databases/{database_name}/tables?keyword=tb&with-detail=true

Request

None

Response

Table 3 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Whether the request is successfully executed. Value true indicates that the request is successfully executed.

message

Yes

String

System prompt. If execution succeeds, the parameter setting may be left blank.

table_count

Yes

Integer

Total number of tables.

tables

Yes

Array of Objects

Table information. For details, see Table 4.

Table 4 tables parameters

Parameter

Mandatory

Type

Description

create_time

Yes

Long

Time when a table is created. The timestamp is expressed in milliseconds.

data_type

No

String

Type of the data to be added to the OBS table. The options are as follows: Parquet, ORC, CSV, JSON, and Avro.

NOTE:

This parameter is available only for OBS tables.

data_location

Yes

String

Data storage location, which can be DLI or OBS.

last_access_time

Yes

Long

Time when the table was last updated. The timestamp is expressed in milliseconds.

location

No

String

Storage path on the OBS table.

NOTE:

This parameter is available only for OBS tables.

owner

Yes

String

Table owner.

table_name

Yes

String

Name of a table.

table_size

Yes

Long

Size of a DLI table. Set parameter to 0 for non-DLI tables. The unit is byte.

table_type

Yes

String

Type of a table.

  • EXTERNAL: Indicates an OBS table.
  • MANAGED: Indicates a DLI table.
  • VIEW: Indicates a view.

partition_columns

No

String

Partition field. This parameter is valid only for OBS partition tables.

page-size

No

Integer

Paging size. The minimum value is 1 and the maximum value is 100.

current-page

No

Integer

Current page number. The minimum value is 1.

NOTE:

If with-detail is set to false in the URI, only values of tables-related parameters data_location, table_name, and table_type are returned.

Example Request

None

Example Response

{
  "is_success": true,
  "message": "",
  "table_count": 1,
  "tables": [
    { "create_time":1517364268000,
      "data_location":"OBS",
      "data_type":"csv",
      "last_access_time":1517364268000,
      "location":"obs://DLI/sqldata/data.txt",
      "owner":"test",     
      "partition_columns": ["a0"],
      "table_name":"obs_t",
      "table_size":0,
      "table_type":"EXTERNAL"
    }
  ]
}

Status Codes

Table 5 describes the status code.

Table 5 Status codes

Status Code

Description

200

The query is successful.

400

Request error.

500

Internal service error.

Error Codes

If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Code.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback