forked from aquasecurity/cloudsploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
39 lines (33 loc) · 867 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Use this script to test your API Credentials befrore you run your scans
var fs = require("fs");
var path = require("path");
var oci = require( './oci' );
var util = require('util');
//
// default callback function
//
var callback = function(data) {
console.log(util.inspect(data, {showHidden: false, depth: null}));
};
//
// Set up the auth object
//
var auth={
RESTversion : '/20160918',
tenancyId : 'ocid1.tenancy.oc1..',
userId : 'ocid1.user.oc1..',
keyFingerprint : 'YOURKEYFINGERPRINT',
region: 'us-ashburn-1'
};
console.log(__dirname);
auth.privateKey = fs.readFileSync(__dirname + '/config/_oracle/keys/YOURKEYNAME.pem', 'ascii');
//
// set up parameters object
//
var parameters = {
compartmentId : 'ocid1.compartment.oc1..'
};
//
// List VCNs
//
oci.core.vcn.list( auth, parameters, callback );