- getStorageStoresById - Get a store
- createStorageStoresBlob - Create a Blob store
- deleteStorageStoresBlobById - Delete a Blob store
Get a store
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel();
async function run() {
const result = await vercel.storage.getStorageStoresById({
id: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { storageGetStorageStoresById } from "@vercel/sdk/funcs/storageGetStorageStoresById.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();
async function run() {
const res = await storageGetStorageStoresById(vercel, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("storageGetStorageStoresById failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GetStorageStoresByIdRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetStorageStoresByIdResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
Create a Blob store
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel();
async function run() {
const result = await vercel.storage.createStorageStoresBlob();
console.log(result);
}
run();The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { storageCreateStorageStoresBlob } from "@vercel/sdk/funcs/storageCreateStorageStoresBlob.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();
async function run() {
const res = await storageCreateStorageStoresBlob(vercel);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("storageCreateStorageStoresBlob failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.CreateStorageStoresBlobRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CreateStorageStoresBlobResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
Delete a Blob store
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel();
async function run() {
const result = await vercel.storage.deleteStorageStoresBlobById({
id: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { storageDeleteStorageStoresBlobById } from "@vercel/sdk/funcs/storageDeleteStorageStoresBlobById.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();
async function run() {
const res = await storageDeleteStorageStoresBlobById(vercel, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("storageDeleteStorageStoresBlobById failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.DeleteStorageStoresBlobByIdRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.DeleteStorageStoresBlobByIdResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |