Skip to main content

DownloadFile

Downloads the specified file from the specified project.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const DownloadFileRequest =
cloudApi.datasphere.project_data_service.DownloadFileRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ProjectDataServiceClient);

const result = await client.downloadFile(
DownloadFileRequest.fromPartial({
projectId: "projectId",
filePath: "filePath",
})
);
console.log(result);
})();

DownloadFileRequest​

projectId : string​

ID of the Project resource to download the file from.

filePath : string​

Path of the file to download.

DownloadFileResponse​

One of message​

  • metadata : FileMetadata​

    Metadata of the downloaded file.

  • chunk : bytes​

    Byte chunk of the downloaded file.

FileMetadata​

projectId : string​

ID of the Project resource associated with the file.

path : string​

File path.

sizeBytes : int64​

File size in bytes.