Path: blob/master/src/packages/next/pages/api/v2/compute/cloud-filesystem/get.ts
1452 views
/*1Get a list of cloud file systems:23- all cloud file systems that you own across all projects - no params4- all cloud file systems in a particular project (whether or not you own them) - specify project_id5- a specific cloud file system - specify id67Always returns an array of cloud file system objects.8*/910import getAccountId from "lib/account/get-account";11import { userGetCloudFilesystems } from "@cocalc/server/compute/cloud-filesystem/get";12import getParams from "lib/api/get-params";1314export default async function handle(req, res) {15try {16res.json(await get(req));17} catch (err) {18res.json({ error: `${err.message}` });19return;20}21}2223async function get(req) {24const account_id = await getAccountId(req);25if (!account_id) {26throw Error("must be signed in");27}28const { id, project_id } = getParams(req);2930return await userGetCloudFilesystems({31id,32account_id,33project_id,34});35}363738