Updated on 2025-08-14 GMT+08:00

Importing Data

Function

This API is used to import the data in the local package to the Huawei Cloud Astro Zero environment in batches. The data to be imported should be compressed to a .zip package. Data files in the package must be in .txt or .csv format. In each file, the first row indicates the object to which the data belongs, the second row indicates the field names, and the other rows indicate data records. The import process may take a long time. The import result will not be returned immediately. After the import, 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/import/data?filename={filename}&flag={hasid}&comment=X

Table 1 URI parameters

Parameter

Mandatory

Type

Description

filename

Yes

String

Explanation

Name of the file to upload.

Constraints

Data in the file must be converted into binary streams before being uploaded.

Value

None

Default value

None

flag

Yes

String

Explanation

Supported flags.

Constraints

None

Value

  • hasid: The imported source data contains ID values.
  • noid: The imported source data does not contain any ID value.

Default value

None

comment

Yes

Boolean

Explanation

Whether to verify the integrity of the .zip file.

Constraints

None

Value

  • true: To verify the integrity of the file
  • false: Not to verify the integrity of the file

Default value

None

Request Parameters

None

Response Parameters

This API has no response parameter. If the HTTP status code is 200, data is imported. You can determine the request result based on the status code.

Example Request

To import the data of the local file abcdefg.zip to the Huawei Cloud Astro Zero (development or runtime) environment in batches, which does not contain any ID value, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/import/data?filename=abcdefg.zip&flag=noid&comment=true

Example Response

{
	"resCode": "0",
	"resMsg": "Success",
	"result": "002S000000sncZ4nOeS8"
}

Status Code

See Status Codes.

Error Code

See Error Codes.