certd/packages/libs/lib-jdcloud/test/services/nc.spec.js

34 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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')
})
})
})