適用於 Node.js 的 Azure Site Recovery 模組Azure Site Recovery modules for Node.js

Site Recovery 可讓您自動執行區域、內部部署虛擬機器和實體伺服器之間至 Azure 的 Azure VM 複寫,以及自動執行內部部署機器至次要資料中心的複寫。Site Recovery allows you to automate replication of Azure VMs between regions, on-premises virtual machines and physical servers to Azure, and on-premises machines to a secondary datacenter.

深入了解 Azure Site RecoveryLearn more about Azure Site Recovery.

管理封裝Management package

安裝 npm 模組Install the npm module

安裝 Azure Site Recovery 服務 npm 模組Install the Azure Site Recovery service npm module

npm install azure-arm-recoveryservices

範例Example

此範例會列出資源群組的 Site Recovery 服務。This example lists the Site Recovery service for a resource group.

const msRestAzure = require('ms-rest-azure');
const RecoveryServicesManagement = require('azure-arm-recoveryservices');

const subscriptionId = 'your-subscription-id';
const resourceGroupName = 'your-resource-group-name';

msRestAzure
  .interactiveLogin()
  .then(credentials => {
    const client = new RecoveryServicesManagement(credentials, subscriptionId);
    return client.vaults.listByResourceGroup(resourceGroupName);
  })
  .then(vaults => {
    console.log('List of vaults:');
    console.dir(vaults, { depth: null, colors: true });
  });

範例Samples

深入探索可在應用程式中使用的 Node.js 程式碼範例Explore more sample Node.js code you can use in your apps.