Files
certd/packages/libs/lib-jdcloud/test/services/nc.spec.js
2025-04-02 23:13:55 +08:00

34 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var NC = require('../../src/services/nativecontainer')
var config = require('config')
var global = config.get('global')
describe('JDCloud.NC', function () {
var nc = new NATIVECONTAINER({
credentials: {
accessKeyId: global.accessKeyId,
secretAccessKey: global.secretAccessKey
},
endpoint: {
host: 'nativecontainer.internal.cn-north-1.jdcloud-api.com', //指定非默认Endpoint
protocol: 'http' //设置使用HTTP而不是HTTPSvpc专用域名不支持HTTPS
},
'x-extra-header': { //指定额外header
"x-jdcloud-security-token" : "xxx", //要调用开启了MFA操作保护的接口需要传递
"x-jdcloud-content-sha256" : "xxx", //body过大希望用此value替代对body进行哈希的过程
"MyOwn" : "xxx"
},
version: {
nativecontainer: 'v1'
}
})
// var nc = new NC();
describe('describeContainers', function () {
it('should be able to get nc list', function () {
return nc.describeContainers({
filters: [
{name: 'containerId', values: ['c-rxjwzysxu', 'c-73woiy7iz']}
],
}, 'cn-north-1')
})
})
})