mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	[API] Add API to vms (#2021)
* add API to debian-vm.sh * [API] Add API calls to VMs * [API] Add API calls to VMs * [API] Add API calls to VMs * [API] Add API calls to VMs * [API] Add API calls to VMs * debian-vm.sh Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com> * updates --------- Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com> Co-authored-by: Rögl-Brunner Michel <Michel.Roegl-brunner@htl-braunau.int>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							b9094e306e
						
					
				
				
					commit
					a481e89cad
				
			@@ -46,6 +46,9 @@ EOF
 | 
			
		||||
 | 
			
		||||
post_to_api_vm() {
 | 
			
		||||
 | 
			
		||||
  if [[ ! -f /usr/local/community-scripts/diagnostics ]]; then
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
  DIAGNOSTICS=$(grep -i "^DIAGNOSTICS=" /usr/local/community-scripts/diagnostics | awk -F'=' '{print $2}')
 | 
			
		||||
  if ! command -v curl &> /dev/null; then
 | 
			
		||||
    return
 | 
			
		||||
@@ -55,7 +58,6 @@ post_to_api_vm() {
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  if [ -z "$RANDOM_UUID" ]; then
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
@@ -114,8 +116,8 @@ EOF
 | 
			
		||||
)
 | 
			
		||||
   
 | 
			
		||||
  RESPONSE=$(curl -s -o response.txt -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
 | 
			
		||||
      -H "Content-Type: application/json" \
 | 
			
		||||
      -d "$JSON_PAYLOAD") || true
 | 
			
		||||
    -H "Content-Type: application/json" \
 | 
			
		||||
    -d "$JSON_PAYLOAD") || true
 | 
			
		||||
 | 
			
		||||
  POST_UPDATE_DONE=true
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user