/*
  Usage: npm install -S @alicloud/pop-core
  powered by alinode (http://alinode.aliyun.com/)
*/

const Core = require('@alicloud/pop-core');

//初始化
var client = new Core({
  accessKeyId: '<accessKeyId>',
  secretAccessKey: '<accessSecret>',
  endpoint: 'https://sts.aliyuncs.com',
  apiVersion: '2015-04-01'
});

//设置参数
var params = {
  'RoleArn': '<role-arn>',
  'RoleSessionName': 'session-name'
};

//发起请求
client.request('AssumeRole', params).then((result) => {
  console.log(result);
}, (ex) => {
  console.log(ex);
})