Compare commits
	
		
			2 Commits
		
	
	
		
			406424e1ab
			...
			90a9a4b3a8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 90a9a4b3a8 | |||
| 4c1380f9e7 | 
							
								
								
									
										38
									
								
								index.js
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										38
									
								
								index.js
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @ -1,30 +1,22 @@ | ||||
| /*const apiKey = { | ||||
| 	tokenID: 'ajones@pam!fixparsec', | ||||
| 	secret: '887ec723-b31a-43ca-be50-82ace6697536' | ||||
| 	secret: 'a25f93b4-6160-4513-9b5e-9dda06ebc787' | ||||
| } | ||||
| HTTP: POST /api2/json/nodes/{node}/qemu/{vmid}/status/reboot | ||||
| curl -H "Authorization: ajones@pam!fixparsec=887ec723-b31a-43ca-be50-82ace6697536" https://192.168.1.32:8006/api2/json/nodes/pve1/qemu/109/status/reboot*/ | ||||
| curl -H "Authorization: ajones@pam!dev=229fe029-caa5-4a35-9c5d-d74a5d0f4233" https://stor.asura.vm42.us/api2/json/nodes/pve1/qemu/109/status/reboot*/ | ||||
|  | ||||
| var request = require('request'); | ||||
| //const https = require('https') | ||||
| //const httpsAgent = new https.Agent({ rejectUnauthorized: false }); | ||||
| const axios = require('axios'); | ||||
|  | ||||
| var headers = { | ||||
|     'Authorization': 'ajones@pam!fixparsec=887ec723-b31a-43ca-be50-82ace6697536' | ||||
| }; | ||||
|  | ||||
| var options = { | ||||
|     url: 'https://192.168.1.32:8006/api2/json/nodes/pve1/qemu/109/status/reboot', | ||||
|     headers: headers | ||||
| }; | ||||
|  | ||||
| function callback(error, response, body) { | ||||
|     if (!error && response.statusCode == 200) { | ||||
|         console.log(body); | ||||
|     } | ||||
|     console.log(body); | ||||
|     console.log(response) | ||||
|     console.log(error); | ||||
|  | ||||
| } | ||||
|  | ||||
| process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; | ||||
| request(options, callback); | ||||
| axios.post('https://stor.asura.vm42.us/api2/json/nodes/stor/qemu/110/status/reboot',{}, { | ||||
|     headers:{ | ||||
|     "Authorization": 'PVEAPIToken=ajones@pam!dev=229fe029-caa5-4a35-9c5d-d74a5d0f4233' | ||||
|     }}) | ||||
|     .then(function (response) { | ||||
|         console.log(response); | ||||
|     }) | ||||
|     .catch(function (error) { | ||||
|         console.log(error); | ||||
|     }); | ||||
							
								
								
									
										1691
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1691
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										11
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								package.json
									
									
									
									
									
								
							| @ -1,19 +1,14 @@ | ||||
| { | ||||
|   "name": "fixparsec", | ||||
|   "version": "1.0.0", | ||||
|   "description": "small apt to resst parsec virtual machines", | ||||
|   "description": "small app to reset vms used by parsec", | ||||
|   "main": "index.js", | ||||
|   "scripts": { | ||||
|     "test": "echo \"Error: no test specified\" && exit 1" | ||||
|   }, | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://git.theta42.com/ajones/fixparsec.git" | ||||
|   }, | ||||
|   "author": "amos jones", | ||||
|   "author": "", | ||||
|   "license": "ISC", | ||||
|   "dependencies": { | ||||
|     "express": "^4.18.2", | ||||
|     "request": "^2.88.2" | ||||
|     "axios": "^1.5.1" | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user