DownloadFile
Downloads the specified file from the specified project.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.datasphere.v1.project_data_service_pb2 import DownloadFileRequest
from yandex.cloud.datasphere.v1.project_data_service_pb2_grpc import ProjectDataServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ProjectDataServiceStub)
response = service.downloadFile()
print(response)
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
: FileMetadataMetadata of the downloaded file.
chunk
: bytesByte 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.