Advertisement
Guest User

Untitled

a guest
Aug 25th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. const path = require("path");
  2. const os = require("os");
  3. const o = require('odata');
  4.  
  5. function createApplication(applicationName) {
  6. o().config({
  7. endpoint: `https://devportalu34f5b50f-p2000082306trial.hanatrial.ondemand.com/odata/1.0/data.svc/`,
  8. username: '',
  9. password: ''
  10. });
  11. return o('APIMgmt.Applications')
  12. .filter(`title eq '${applicationName}'`).get()
  13. .then(function (ans) {
  14. if (ans.data.d.results.length > 0)
  15. throw new Error(`${applicationName} already exists!`)
  16. console.log(ans.data);
  17. }, function(msg) {
  18. winston.error(msg);
  19. })
  20. }
  21.  
  22.  
  23. createApplication('Tést')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement