{"library":"oci-globallydistributeddatabase","title":"Oracle Cloud Infrastructure (OCI) Globally Distributed Database Client","description":"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.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install oci-globallydistributeddatabase"],"cli":null},"imports":["import { GloballyDistributedDatabaseClient } from 'oci-globallydistributeddatabase';","import * as common from 'oci-common';\nconst provider = new common.Auth.ConfigFileAuthenticationDetailsProvider();","import { GloballyDistributedDatabaseRequests } from 'oci-globallydistributeddatabase';\nconst request: GloballyDistributedDatabaseRequests.ListShardedDatabasesRequest = {};"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { GloballyDistributedDatabaseClient } from 'oci-globallydistributeddatabase';\nimport * as common from 'oci-common';\nimport { GloballyDistributedDatabaseRequests } from 'oci-globallydistributeddatabase';\n\nasync function listGloballyDistributedDatabases() {\n  try {\n    // Configure authentication using a config file (typically ~/.oci/config)\n    // Ensure your OCI config file is set up with a profile.\n    const provider = new common.Auth.ConfigFileAuthenticationDetailsProvider();\n\n    // Initialize the client\n    const client = new GloballyDistributedDatabaseClient({ authenticationDetailsProvider: provider });\n\n    // Construct a list request. A compartmentId is typically required for listing resources.\n    // Replace 'ocid1.compartment.oc1..aaaa...' with your actual compartment OCID.\n    const compartmentId = process.env.OCI_COMPARTMENT_ID ?? 'ocid1.compartment.oc1..examplecompartmentid'; \n    \n    const listRequest: GloballyDistributedDatabaseRequests.ListShardedDatabasesRequest = {\n      compartmentId: compartmentId,\n      limit: 10 // Optional: limit the number of results\n    };\n\n    // Make the API call to list sharded databases\n    console.log(`Listing sharded databases in compartment: ${compartmentId}...`);\n    const response = await client.listShardedDatabases(listRequest);\n\n    // Process the response\n    if (response.shardedDatabaseCollection?.items && response.shardedDatabaseCollection.items.length > 0) {\n      console.log('Found Sharded Databases:');\n      response.shardedDatabaseCollection.items.forEach(db => {\n        console.log(`- Name: ${db.displayName}, ID: ${db.id}, Lifecycle State: ${db.lifecycleState}`);\n      });\n    } else {\n      console.log('No sharded databases found in the specified compartment.');\n    }\n  } catch (error) {\n    console.error('Error listing sharded databases:', error);\n    // Log specific OCI errors for better debugging\n    if (error instanceof common.Error.ServiceError) {\n      console.error(`OCI Service Error: ${error.statusCode} - ${error.serviceCode} (${error.errorCode}): ${error.message}`);\n    }\n    process.exit(1);\n  }\n}\n\nlistGloballyDistributedDatabases();\n","lang":"typescript","description":"This quickstart demonstrates how to instantiate the `GloballyDistributedDatabaseClient`, configure authentication using the OCI config file, and list sharded databases within a specified OCI compartment.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}