本文介绍用Python运行SEPM REST API脚本获取SEP客户端状态信息
SEPM REST API的Python脚本源代码如下:
import requests, json, pprint
pagesize = 1000
api_url_base = "https://localhost:8446/sepm/api/v1/"
authentication_url = "https://localhost:8446/sepm/api/v1/identity/authenticate"
# if output is required in JSON format
json_format = True
# Provide Username and Password details of SEPM console
payload = {
"username" : "admin",
"password" : "symantec",
"domain" : ""}
headers = {"Content-Type":"application/json"}
#requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL' # necessary
#r = requests.Session() # Start session in order to store the SessionID Cookie
r = requests.post(authentication_url, verify=False, headers=headers, data=json.dumps(payload))
api_token = (r.json()["token&