Registry / aws / oci-globallydistributeddatabase

oci-globallydistributeddatabase

JSON →
library2.124.0jsnpmunverified

This module, `oci-globallydistributeddatabase`, provides the NodeJS client for interacting with the Oracle Cloud Infrastructure (OCI) Globally Distributed Database Service. It is part of the larger `oci-typescript-sdk` and allows programmatic management of sharded databases, enabling operations like creating, updating, and listing globally distributed database resources within OCI. The current package version is 2.124.0, though the overall OCI SDK has seen rapid development with releases up to 2.130.0, indicating a highly active release cadence (often weekly or bi-weekly patches/minor versions). Key differentiators include deep integration with the OCI ecosystem, comprehensive TypeScript type definitions for robust development, and consistent API patterns across all OCI services supported by the SDK.

npm install oci-globallydistributeddatabase
INSTALL
IMPORT
SIG · OCI-GLOBALLYDISTRI
O
oci-globallydistributeddatabase
awsjavascriptv2.124.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

GloballyDistributedDatabaseClient
import { GloballyDistributedDatabaseClient } from 'oci-globallydistributeddatabase';
const GloballyDistributedDatabaseClient = require('oci-globallydistributeddatabase');
Primary client class for interacting with the Globally Distributed Database service. CommonJS `require` is not the idiomatic way for newer OCI SDK versions.
Auth
import * as common from 'oci-common'; const provider = new common.Auth.ConfigFileAuthenticationDetailsProvider();
import { Auth } from 'oci-globallydistributeddatabase';
Authentication details providers (like `ConfigFileAuthenticationDetailsProvider` or `InstancePrincipalsAuthenticationDetailsProvider`) are typically found in the `oci-common` package, not directly within service-specific modules. It's best practice to import `oci-common` as a whole or specifically the `Auth` namespace.
ListShardedDatabasesRequest
import { GloballyDistributedDatabaseRequests } from 'oci-globallydistributeddatabase'; const request: GloballyDistributedDatabaseRequests.ListShardedDatabasesRequest = {};
import { ListShardedDatabasesRequest } from 'oci-globallydistributeddatabase/lib/globallydistributeddatabase_request';
Request and response types are nested under their respective service namespaces (e.g., `GloballyDistributedDatabaseRequests`, `GloballyDistributedDatabaseResponses`) for better organization and to prevent naming conflicts.

This quickstart demonstrates how to instantiate the `GloballyDistributedDatabaseClient`, configure authentication using the OCI config file, and list sharded databases within a specified OCI compartment.

import { GloballyDistributedDatabaseClient } from 'oci-globallydistributeddatabase'; import * as common from 'oci-common'; import { GloballyDistributedDatabaseRequests } from 'oci-globallydistributeddatabase'; async function listGloballyDistributedDatabases() { try { // Configure authentication using a config file (typically ~/.oci/config) // Ensure your OCI config file is set up with a profile. const provider = new common.Auth.ConfigFileAuthenticationDetailsProvider(); // Initialize the client const client = new GloballyDistributedDatabaseClient({ authenticationDetailsProvider: provider }); // Construct a list request. A compartmentId is typically required for listing resources. // Replace 'ocid1.compartment.oc1..aaaa...' with your actual compartment OCID. const compartmentId = process.env.OCI_COMPARTMENT_ID ?? 'ocid1.compartment.oc1..examplecompartmentid'; const listRequest: GloballyDistributedDatabaseRequests.ListShardedDatabasesRequest = { compartmentId: compartmentId, limit: 10 // Optional: limit the number of results }; // Make the API call to list sharded databases console.log(`Listing sharded databases in compartment: ${compartmentId}...`); const response = await client.listShardedDatabases(listRequest); // Process the response if (response.shardedDatabaseCollection?.items && response.shardedDatabaseCollection.items.length > 0) { console.log('Found Sharded Databases:'); response.shardedDatabaseCollection.items.forEach(db => { console.log(`- Name: ${db.displayName}, ID: ${db.id}, Lifecycle State: ${db.lifecycleState}`); }); } else { console.log('No sharded databases found in the specified compartment.'); } } catch (error) { console.error('Error listing sharded databases:', error); // Log specific OCI errors for better debugging if (error instanceof common.Error.ServiceError) { console.error(`OCI Service Error: ${error.statusCode} - ${error.serviceCode} (${error.errorCode}): ${error.message}`); } process.exit(1); } } listGloballyDistributedDatabases();
Debug
Known issues
gotchaAuthentication details are critical. Incorrect OCI configuration (missing private key, wrong tenancy OCID, user OCID, or fingerprint) or misconfigured IAM policies will result in `NotAuthorizedOrNotFound` errors.
fix
Ensure your `~/.oci/config` file is correctly set up with the required profile. Verify the user has the necessary IAM permissions (policies) for the specific OCI service API calls being made. Use `Auth.ConfigFileAuthenticationDetailsProvider` for local development or `Auth.InstancePrincipalsAuthenticationDetailsProvider` for compute instances.
affects: >=1.0.0
gotchaOCI SDKs default to a specific region (typically `us-ashburn-1` if not specified). If your resources are in a different region, you must explicitly set the region for the client, otherwise, you may encounter `NotFound` errors or requests routed to the wrong data center.
fix
Initialize the client with the correct region, e.g., `new GloballyDistributedDatabaseClient({ authenticationDetailsProvider: provider, region: common.Region.PHOENIX_1 });` or ensure the region is set in your OCI config file.
affects: >=1.0.0
gotchaList operations in OCI SDKs are often paginated. If you expect more results than the default `limit` (typically 10-100), you must implement pagination logic to fetch all items by repeatedly calling the list method with the `opcNextPage` token.
fix
Implement a loop that checks `response.opcNextPage` after each list call. If present, set it as `page` in the next request object to retrieve the subsequent page of results until `opcNextPage` is null.
affects: >=1.0.0
Errors
Common errors & fixes
NotAuthorizedOrNotFound
The configured user or instance principal lacks the necessary IAM permissions to perform the requested operation, or the specified resource (e.g., compartment, sharded database) does not exist or is in a different region.
fix
Verify IAM policies grant 'manage' or 'read' permissions for `globally-distributed-database` resources in the target compartment. Double-check the OCID of the resource or compartment and ensure the client's configured region matches the resource's region.
Error: Cannot find module 'oci-globallydistributeddatabase'
The package is not installed or the import path is incorrect, especially in projects mixing ESM and CJS modules.
fix
Run `npm install oci-globallydistributeddatabase` to install the package. If using ESM, ensure your `package.json` has `"type": "module"` or use `.mjs` extension, and ensure your `tsconfig.json` (if applicable) is configured for ESM imports (`"module": "NodeNext"`, `"moduleResolution": "NodeNext"`).
TypeError: client.listShardedDatabases is not a function
The `listShardedDatabases` method or the `GloballyDistributedDatabaseClient` object might be incorrectly instantiated or imported.
fix
Ensure `GloballyDistributedDatabaseClient` is correctly imported and initialized with an `authenticationDetailsProvider`. Verify the method name `listShardedDatabases` is spelled correctly and matches the SDK's API.
Upgrade
Version history
2.124.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
oci-globallydistributeddatabase — npm install oci-globallydistributeddatabase · libregistry