我正在使用 Python SDK。
我想使用 DeepSecurity API 向计算机发送升级代理的指令。与您在控制台上通过“右键单击计算机 - > 升级代理”执行的操作相同,但我在https://automation.deepsecurity.trendmicro.com/上找不到有关此信息的信息。
我只检查了https://automation.deepsecurity.trendmicro.com/文档没有以结构化的方式提及计算机对象的所有方法,因此我无法真正理解是否可以调用类似 computer.upgrade("DSA_Version" ) 或类似的
测试诸如 computer.upgrade() 之类的东西只会产生错误,例如
from __future__ import print_function
import sys, warnings
import deepsecurity
import json
import demjson
from deepsecurity.rest import ApiException
from pprint import pprint
import re
import jsbeautifier
# Setup
if not sys.warnoptions:
warnings.simplefilter("ignore")
configuration = deepsecurity.Configuration()
configuration.host = 'https://app.deepsecurity.trendmicro.com/api'
# Authentication
configuration.api_key['api-secret-key'] = "SECRET!"
# Initialization
# Set Any Required Values
api_instance = deepsecurity.ComputersApi(deepsecurity.ApiClient(configuration))
computer_id = 7401
api_version = 'v1'
overrides = False
try:
thisComputer = api_instance.describe_computer(computer_id, api_version, overrides=overrides)
thisComputer.upgrade()
except ApiException as e:
print("An exception occurred when calling ComputersApi.describe_computer: %s\n" % e)
上面只返回这个,所以是无效的:
Traceback (most recent call last):
File ".\computer_upgrade.py", line 29, in <module>
thisComputer.upgrade()
AttributeError: 'Computer' object has no attribute 'upgrade'
如果有人知道通过 API 启动代理升级的方法,请告诉我,谢谢 :)
热烈的问候,马蒂亚兰贝利