Write Chunk File

Write file chunks to data source through a specified channel.

Prerequisites

Write channels are created and started in the organization.

Request Format

POST https://{apigw-address}/data-federation/v2.0/channels/write/{channelId}/chunk-file

Request Parameters (Header)

Name

Mandatory/Optional

Data Type

Description

Content-Type

Mandatory

String

Content or file type. The default value is application/json.

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID. How to get the orgId>>

channelId

Path

Mandatory

String

The channel ID.

dataSourceName

Query

Mandatory

String

The data source alias. Only HDFS data source is supported.

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

fileName

Mandatory

String

The name of the file to be written to the storage.

totalSize

Mandatory

Integer

The file size.

chunkOffset

Mandatory

Integer

The offset of the current chunk in the file.

chunkSize

Mandatory

Integer

The size of the current chunk (before Base64 encoding).

chunkData

Mandatory

String

The chunk data, with Base64 encoding.

Samples

Request Sample

url: https://{apigw-address}/data-federation/v2.0/channels/write/{channelId}/chunk-file?orgId={}&dataSourceName={}

method: POST

requestBody:
{
  "fileName": "ttt",
  "totalSize": "13",
  "chunkData": "dGVzdHRlc3R0dGVzdA==",
  "chunkSize": "13",
  "chunkOffset": "0"
}

Return Sample

{
  "msg": "OK",
  "code": 0,
  "submsg": ""
}

SDK Samples


You can access the SDK samples for data federation service on GitHub: