Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = require('request');
- function get_trustyou(trust_you_id, callback){
- var options = {
- url: 'https://xxxxxx/api/json/v2/types/consistency-groups',
- rejectUnauthorized: false,
- method: 'GET',
- type: 'application/json',
- auth:{
- user: 'xxxxx',
- pass: 'xxx'
- }
- };
- var res = '';
- request(options, function ( error, resp, body ) {
- if ( !error && resp.statusCode == 200){
- res = body;
- }
- if (error) {
- console.log("this is error" + error);
- }
- callback(res);
- });
- }
- get_trustyou("674fa44c-1fbd-4275-aa72-a20f262372cd", function(resp){
- console.log("Here is the result" + resp);
- });
- var request = require('request');
- function get_trustyou(trust_you_id, callback){
- var options = {
- body: postData,
- url: 'https://xxxx/api/json/v2/types/consistency-groups',
- rejectUnauthorized: false,
- method: 'POST',
- type: 'application/json',
- auth:{
- user: 'xxxx',
- pass: 'xxxxx'
- },
- form: {
- 'consistency-group-name': 'TEST-CG'
- }
- };
- request(options, function ( error, resp, body ) {
- if ( !error && resp.statusCode == 200){
- res = body;
- }
- if (error) {
- console.log("this is error" + error);
- }
- callback(res);
- });
- }
- get_trustyou("674fa44c-1fbd-4275-aa72-a20f262372cd", function(resp){
- console.log("this is the responce" + resp);
- });
Add Comment
Please, Sign In to add comment