Exemplo n.º 1
0
 prompt.get(schema, function (err, result) {
     pbclient.setauth(result.username, result.password   )
     pbclient.listDatacenters(function (error, response, body) {
         if (response && response.statusCode && response.statusCode == 200) {
             helpers.toBase64(result.username, result.password)
         } else {
             console.error('Invalid user name or password. Please try again!')
             process.exit(code = 5)
         }
     })
     helpers.toBase64(result.username, result.password)
 })
#!/usr/bin/env node

// list datacenters

var libpb=require('libprofitbricks')

libpb.setauth('username','password')
	
libpb.listDatacenters()