Advertisement
M1L3s

My First Application ---> Openstack

Apr 11th, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. [root@openstack ~]# more auth.js
  2. auth_username = 'admin';
  3. auth_password = 'ac1556ad87354740';
  4. auth_url = 'http://192.168.0.20:5000';
  5. project_name = 'admin';
  6. region_name = 'RegionOne';
  7.  
  8.  
  9. var conn = require('pkgcloud').compute.createClient({
  10. provider: 'openstack',
  11. username: auth_username,
  12. password: auth_password,
  13. authUrl: auth_url,
  14. region: region_name
  15. });
  16.  
  17.  
  18.  
  19. conn.on('log::*', function(message, object) {
  20. if (object) {
  21. console.log(this.event.split('::')[1] + ' ' + message);
  22. console.dir(object);
  23. }
  24. else {
  25. console.log(this.event.split('::')[1] + ' ' + message);
  26. }
  27. });
  28.  
  29.  
  30. conn.getImages(function(err, images) {
  31. for (i =0; i<images.length; i++) {
  32. console.log("..................................");
  33. console.log("id: " + images[i].id);
  34. console.log("name: " + images[i].name);
  35. console.log("created: " + images[i].created);
  36. console.log("updated: " + images[i].updated);
  37. console.log("status: " + images[i].status + "\n");
  38. }});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement