AWS工具
机器列表工具书
((selecterStr) => {
let outStr1 = '';
let outStr2 = '';
let outStr3 = '';
let clients = document.querySelectorAll(selecterStr);
for (let i = 1; i < clients.length; i++) {
let client = clients[i];
let rows = client.querySelectorAll('td');
// console.log('%20s | %20s', rows[1].innerText, rows[9].innerText);
try {
outStr1 = outStr1 + `\n${rows[1].innerText} | ${rows[9].innerText.padEnd(15, ' ')} | ${rows[2].innerText.padEnd(15, ' ')} `;
outStr2 = outStr2 + `\nexpect change-clientcode-on-linux.exp ${`"${rows[9].innerText}"`.padEnd(17, ' ')} 22 "ubuntu" "1qaz2wsxCTRIP8888" "${rows[1].innerText}" "f8d48477a58ade334a54fa0b901f1ac1" ; sleep 1; `;
outStr3 = outStr3 + `\naws ec2 create-tags --resources ${rows[2].innerText.padEnd(15, ' ')} --tags Key=Name,Value=${rows[1].innerText} `;
} catch (e){
console.log(e);
}
}
console.log(outStr1);
console.log(outStr2);
console.log(outStr3);
})('tr.awsui_row_wih1l_dgxar_301')