Search code examples
sdkdeepsecurity

Can the Deep security API (through the new DSaaS SDK) be used to send the "upgrade Agent" instruction to a computer?


I'm Using the Python SDK.

I would like to use the DeepSecurity API to send to a computer the instruction to upgrade an agent. The same that you would do on the console by "right-click computer -> upgrade agent" I could not find on https://automation.deepsecurity.trendmicro.com/ information about this though.

I checked on https://automation.deepsecurity.trendmicro.com/ only The documentation does not mention all the methods for computer objects in a structured way, hence I cannot really understand if I could call something like computer.upgrade("DSA_Version") or similar

Testing something like computer.upgrade() produces only an error, e.g.


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)

The above returns only this, so is invalid:

Traceback (most recent call last):
  File ".\computer_upgrade.py", line 29, in <module>
    thisComputer.upgrade()
AttributeError: 'Computer' object has no attribute 'upgrade'

If anybody knows about a way to initiate an Agent upgrade through API please let me know, thanks :)

Warm regards, Mattia Rambelli


Solution

  • thanks for the great question. Unfortunately at the moment, Deep Security /api & SDKs does not support an "Agent Upgrade" action for computers. It is a high priority use case that we are working to address. There will be an update in the Changelog when the functionality is available (https://automation.deepsecurity.trendmicro.com/article/12_1/changelog?platform=dsaas), as well as guides/reference content.

    P.S. I work in R&D for Deep Security