Registry / storage / oci-filestorage

oci-filestorage

JSON →
library2.132.0jsnpmunverified

Official Oracle Cloud Infrastructure SDK for managing File Storage service resources (file systems, mount targets, exports, snapshots) in Node.js. Current stable version 2.132.0. Released as part of the OCI TypeScript SDK monorepo with frequent updates aligning to OCI API changes. Key differentiator: full type safety with generated TypeScript definitions, supports both ESM and CJS, and requires OCI authentication via API keys or instance principals. Compared to REST API calls, this SDK handles signing, retries, and serialization automatically.

npm install oci-filestorage
INSTALL
IMPORT
SIG · OCI-FILESTORAGE
O
oci-filestorage
storagejavascriptv2.132.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FilestorageClient
import { FilestorageClient } from 'oci-filestorage'
const { FilestorageClient } = require('oci-filestorage')
SDK ships with TypeScript definitions; ESM-style import is recommended but CJS require also works.
models
import * as models from 'oci-filestorage'
import models from 'oci-filestorage'
The 'models' module is a namespace export, not a default export.
CreateFileSystemDetails
import { CreateFileSystemDetails } from 'oci-filestorage/lib/model'
import { CreateFileSystemDetails } from 'oci-filestorage'
Model types are exported from a subpath 'lib/model'. Direct top-level export may not include all model types.

Creates an OCI File Storage client using config file authentication and lists all file systems in a compartment.

import { FilestorageClient } from 'oci-filestorage'; import { common } from 'oci-common'; const provider = new common.ConfigFileAuthenticationDetailsProvider(); async function listFileSystems(compartmentId: string) { const client = new FilestorageClient({ authenticationDetailsProvider: provider }); const request = { compartmentId }; try { const response = await client.listFileSystems(request); console.log('File systems:', response.items); } catch (error) { console.error('Error listing file systems:', error); } } const compartmentId = process.env.COMPARTMENT_ID ?? ''; listFileSystems(compartmentId);
Debug
Known issues
breakingIn version 2.x, region is required in the client configuration if not set in the config file.
fix
Set region in the config file or pass it in the client constructor options.
affects: >=2.0.0
deprecatedThe 'oci-common' package previously included authentication providers from the SDK; these are now available via 'oci-common' as exported classes.
fix
Import ConfigFileAuthenticationDetailsProvider from 'oci-common' as shown in quickstart.
affects: >=2.0.0
gotchaFirewall rules: The SDK makes outbound HTTPS calls to OCI endpoints. Ensure network firewall allows traffic to *.oraclecloud.com.
fix
Configure firewall to allow outbound HTTPS to OCI API endpoints for your region.
affects: all
gotchaSensitive data exposure: Hard-coding API credentials in code can lead to compromise.
fix
Use environment variables, OCI Vault, or config files for credentials.
affects: all
deprecatedThe 'oci-common' package formerly included 'Region' and 'Realm' classes directly; they are now in a separate submodule.
fix
Import from 'oci-common/lib/region' if needed explicitly.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Missing region in request
Region not specified in client configuration or config file.
fix
Set region in the config file under DEFAULT profile, or pass region option to FilestorageClient constructor.
Error: Authentication failed. Check your credentials.
Invalid or missing API key or config file.
fix
Ensure ~/.oci/config exists with correct user, fingerprint, tenancy, key_file.
TypeError: Cannot read properties of undefined (reading 'someProperty')
Incorrect import path for model types; some types are not exported at top level.
fix
Import model types from 'oci-filestorage/lib/model' instead of top-level.
Error: connect ECONNREFUSED <OCI endpoint>
Network connectivity issue or firewall blocking outbound HTTPS to OCI.
fix
Check network/firewall settings; allow outbound to *.oraclecloud.com.
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredProvides authentication, HTTP signing, and common utilities for all OCI service SDKs
Agent activity
26 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources