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
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
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
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 (CCI)
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
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
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
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Exporting Data

Updated on 2025-03-21 GMT+08:00

Function

This API is used to export specific data of a table. Internal data in instances created on Astro Zero can be exported. This API can be used to export data in the instances based on a specified frequency or filter criteria. A scheduled task can be automatically generated based on the specified execution time to export data once or periodically. After data is exported, you can call an API to download the file. After the export is complete, you can view the execution status of the scheduled task based on the obtained task ID.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/export/data?flag=template&file_type=csv

Table 1 URI parameters

Parameter

Mandatory

Type

Description

file_type

Yes

String

Explanation

Format of the export file.

Constraints

None

Value

  • csv: The data is exported to a .csv file.
  • txt: The data is exported to a .txt file.

Default value

None

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

cond

No

cond objects

Explanation

Filter criterion for export, which is a structure containing two fields: conditions and conjunction.

Constraints

None

encode-type

Yes

String

Explanation

Encoding format of the exported file.

Constraints

None

Value

The value can be UTF-8 or GBK.

Default value

None

firstScheduleDate

No

String

Explanation

Time when the file is exported for the first time, in the format of yyyy-MM-dd HH:mm:ss.

Constraints

  • This parameter is mandatory when scheduleMode is set to 2.
  • If scheduleMode is set to 1, this parameter is mutually exclusive with isImmediate.

Value

None

Default value

None

objects

No

Array of Strings

Explanation

Objects to be exported. The value is a string array. Each string in the array is an object name. Data of multiple objects can be exported at the same time. You can also use the templateName parameter to specify a template for exporting data.

Constraints

None

scheduleMode

Yes

Number

Explanation

Execution times of the export task.

Constraints

None

Value

  • 1: Data is exported only once.
  • 2: Data is exported for multiple times at the specified frequency.

Default value

None

scheduleInterval

No

Number

Explanation

Interval for executing an export task.

Constraints

This parameter is mandatory when scheduleMode is set to 2.

Value

None

Default value

None

intervalUnit

No

Number

Explanation

Interval unit for executing an export task.

Constraints

This parameter is mandatory when scheduleMode is set to 2.

Value

  • Hour
  • Day
  • Month

Default value

None

isImmediate

No

Boolean

Explanation

Whether to export data immediately.

Constraints

This parameter is optional if scheduleMode is set to 1. This parameter and firstScheduleDate are mutually exclusive when scheduleMode is set to 1.

Value

None

Default value

None

templateName

No

String

Explanation

Name of the template used for data export. You can also use the objects parameter to specify the objects to be exported.

Constraints

None

Value

None

Default value

None

Table 3 cond parameters

Parameter

Type

Description

conditions

Array of condition objects

Explanation

Condition array. Each item in the array is used as a condition.

Constraints

None

conjunction

String

Explanation

Combination mode of conditions in a condition array.

Constraints

None

Value

  • AND
  • OR

Default value

None

Table 4 conditions parameters

Parameter

Mandatory

Description

field

Yes

Explanation

Filtering condition field.

Constraints

None

Value

  • createDate: creation time.
  • createBy: creator ID.
  • lastModifiedDate: last modification time.
  • lastModifiedBy: ID of the last modifier.

Default value

None

operator

Yes

Explanation

Filtering operator.

Constraints

Only the filtering fields of the time type support all operations and the filtering fields of other types support only eq and ne.

Value

  • gt: greater than
  • ge: greater than or equal to
  • eq: equal to
  • ne: not equal to
  • lt: less than
  • le: less than or equal to
  • timeFunc: time function

Default value

None

value

Yes

Explanation

Value to be compared.

Constraints

None

Value

When operator is set to timeFunc, the following functions are supported:

  • today
  • yesterday
  • last week
  • last month
  • last year
  • this week
  • this month
  • this year

If the value to be compared is of the time type, the time character string must be in the yyyy-MM-dd HH:mm:ss format.

Default value

None

Response Parameters

Table 5 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, Success is returned. In other cases, an error message is returned.

result

String

Explanation

ID of the record that is successfully created.

Value

None

Example Request

  • Example 1
    To create a data export task for which scheduleMode is 1, firstScheduleDate is 2020-05-31 00:00:00, encodeType is utf-8, templateName is myTemplate, send the following request:
    POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/export/data?flag=template&file_type=csv
    {
        "scheduleMode": 1,
        "firstScheduleDate": "2020-05-31 00:00:00",
        "encodeType": "utf-8",
        "templateName": "myTemplate"
    }
  • Example 2
    To create a data export task for which scheduleMode is 2, firstScheduleDate is 2020-06-01 00:00:00, scheduleInterval is 1, intervalUnit is Month, encodeType is GBK, objects is Flow and Page, field is createdBy, operator is eq, and value is 1234567890xyz, send the following request:
    POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/export/data?flag=template&file_type=txt
    {
        "scheduleMode": 2,
        "firstScheduleDate": "2020-06-01 00:00:00",
        "scheduleInterval": 1,
        "intervalUnit": "Month",
        "templateName": "template01",
        "encodeType": "gbk",
        "objects": [
            "Flow",
            "Page"
        ],
        "cond": {
            "conjunction": "AND",
            "conditions": [
                {
                    "field": "createdBy",
                    "operator": "eq",
                    "value": "1234567890xyz"
                }
            ]
        }
    }

Example Response

  • Example 1
    {
        "resCode": "0",
        "resMsg": "Success",
        "result": "abcdefghijklmnopqrst"
    }
  • Example 2
    {
        "resCode": "0",
        "resMsg": "Success",
        "result": "1234567890abcdefg"
    }

Status Code

See Status Codes.

Error Code

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback