Updated on 2025-05-19 GMT+08:00

Exporting Metadata

Function

This API is used to export the metadata of a data table, that is, export the information about each field in the data table, excluding specific data records. 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/schema?flag={template}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

flag

No

String

Explanation

Currently, the supported flag is template, indicating whether to export data using a specified template.

Constraints

If flag=template is carried, you need to set templateName to specify the name of the template to be used.

Value

The supported flag is template.

Default value

None

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

encodeType

Yes

String

Explanation

Encoding format of the exported file.

Constraints

None

Value

  • utf-8: UTF-8 encoding
  • gbk: GBK encoding

Default value

None

firstScheduleDate

No

String

Explanation

Start time for data export, which must be 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

An array of strings, each of which is the name of an object whose metadata you want to export.

Constraints

None

scheduleMode

Yes

Number

Explanation

Export modes.

Constraints

None

Value

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

Default value

None

intervalUnit

No

String

Explanation

Execution interval unit.

Constraints

This parameter is mandatory when scheduleMode is set to 2.

Value

  • Hour
  • Day
  • Month

Default value

None

scheduleInterval

No

Number

Explanation

Execution interval.

Constraints

This parameter is mandatory when scheduleMode is set to 2.

Value

None

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

  • true: The data is exported immediately.
  • false: The data is not exported immediately.

Default value

None

templateName

No

String

Explanation

Name of the template to be used.

Constraints

This parameter is used together with flag in the URL parameter. It is mandatory when flag is template.

Value

None

Default value

None

Response Parameters

Table 3 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

To export metadata from the Lead and PortalUser tables, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/export/schema
 
{
    "scheduleMode":1,
    "firstScheduleDate":"2020-06-02 00:00:00",
    "encodeType":"gbk",
    "objects":["Lead","PortalUser"]
}

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": "1234567890abcdefg"
}

Status Code

See Status Codes.

Error Code

See Error Codes.