From f63ed561037e7a8f76c2ddee749785168c75a203 Mon Sep 17 00:00:00 2001 From: jblu Date: Fri, 26 Jan 2024 10:59:12 -0600 Subject: [PATCH] testing --- .../REST-Basic-Connection-Template.ps1 | 0 .../REST API/REST-Get-Server-Information.ps1 | 0 powershell/REST API/REST-testing.ps1 | 0 python/REST API/REST-connection.py | 33 +++++++++++-------- python/REST API/REST-move-user.py | 0 python/eftcom-getusedspace.py | 0 6 files changed, 20 insertions(+), 13 deletions(-) mode change 100755 => 100644 powershell/REST API/REST-Basic-Connection-Template.ps1 mode change 100755 => 100644 powershell/REST API/REST-Get-Server-Information.ps1 mode change 100755 => 100644 powershell/REST API/REST-testing.ps1 mode change 100755 => 100644 python/REST API/REST-connection.py mode change 100755 => 100644 python/REST API/REST-move-user.py mode change 100755 => 100644 python/eftcom-getusedspace.py diff --git a/powershell/REST API/REST-Basic-Connection-Template.ps1 b/powershell/REST API/REST-Basic-Connection-Template.ps1 old mode 100755 new mode 100644 diff --git a/powershell/REST API/REST-Get-Server-Information.ps1 b/powershell/REST API/REST-Get-Server-Information.ps1 old mode 100755 new mode 100644 diff --git a/powershell/REST API/REST-testing.ps1 b/powershell/REST API/REST-testing.ps1 old mode 100755 new mode 100644 diff --git a/python/REST API/REST-connection.py b/python/REST API/REST-connection.py old mode 100755 new mode 100644 index f9632d1..034b23a --- a/python/REST API/REST-connection.py +++ b/python/REST API/REST-connection.py @@ -1,28 +1,35 @@ import requests +requests.packages.urllib3.disable_warnings() # Authentication -baseURL = "http://192.168.4.14:4450/admin" -user = "a" -password = "QjIlmT4H" +#baseURL = "https://20.122.98.106:4450/admin" +#baseURL = "https://20.122.98.106:8443/admin" +baseURL = "https://secops-api.arcusapp.globalscape.com:8443/admin" +# baseURL = "https://secops.arcusapp.globalscape.com/admin" +# baseURL = "http://192.168.4.13:8080/admin" +user = "jbranan_secops" +password = "o61KJBbN" authURL = f"{baseURL}/v1/authentication" body = {"userName": user, "password": password, "authType": "EFT"} -r1 = requests.post(authURL, json=body) +r1 = requests.post(authURL, json=body, verify=False) +# print(r1.text) eftresp1 = r1.json() -# print(r1.status_code) +print(r1.status_code) # print(eftresp1) authheader ={"Authorization": f"EFTAdminAuthToken {eftresp1['authToken']}"} # print(authheader) # Get Server Info -getserverURL = f"{baseURL}/v2/server" -r2 = requests.get(getserverURL, headers=authheader) +getserverURL = f"{baseURL}/v1/server" +# print(authheader) +r2 = requests.get(getserverURL, headers=authheader, verify=False) eftresp2 = r2.json() -# print(r2.status_code) +print(r2.status_code) print(eftresp2) -#Get Server Metrics -getservermetricsURL = f"{baseURL}/v2/server/metrics" -r3 = requests.get(getservermetricsURL, headers=authheader) -eftresp3 = r3.json() +# #Get Server Metrics +# getservermetricsURL = f"{baseURL}/v2/server/metrics" +# r3 = requests.get(getservermetricsURL, headers=authheader, verify=False) +# eftresp3 = r3.json() # print(r3.status_code) -print(eftresp3) \ No newline at end of file +# print(eftresp3) \ No newline at end of file diff --git a/python/REST API/REST-move-user.py b/python/REST API/REST-move-user.py old mode 100755 new mode 100644 diff --git a/python/eftcom-getusedspace.py b/python/eftcom-getusedspace.py old mode 100755 new mode 100644