0

我正在尝试使用 Node SDK 创建一个 ECS 实例,但失败了。我不确定我是否做对了。我可以使用 Portal 和 ROS 创建具有相同配置的 ECS。

//using the SDK for ECS
var ECSClient = require('@alicloud/ecs-2014-05-26');


// crearting the client
var client = new ECSClient({
    accessKeyId: 'myaccesskeyid',
    accessKeySecret: 'myaccesskeysecret',
    endpoint: 'https://ecs.aliyuncs.com'
});

// image id and instance type procured using the OpenApi explorer
var params = {
    ImageId: 'winsvr_64_dtcC_1809_en-us_40G_alibase_20190528.vhd',
    InstanceType: 'ecs.t1.xsmall',
    RegionId: 'ap-south-1'
}

// options
var opts = {
    'x-acs-region-id': "ap-south-1"
}

// calling the sdk method to create ecs instance
client.createInstance(params, opts).then((res) => {
    console.log(res)
}, (err) => {
    console.log('ERROR!!')
    console.log(JSON.stringify(err))
}); 
4

1 回答 1

0

不是解决方案,而是建议。在 Portal 中创建支持票证。他们回复得很快,解决了我的 ECS 问题。

于 2019-06-18T06:13:39.997 回答