Trying to use the automation API example to add a global rule to DSaaS. I have no idea how to populate the hash,description pairs in the globalrules = deepsecurity.ApplicationControlGlobalRules().
Tried using JSON but don't know how to do that.
from __future__ import print_function
import sys, warnings
import deepsecurity
from deepsecurity.rest import ApiException
from pprint import pprint
# Setup
if not sys.warnoptions:
warnings.simplefilter("ignore")
configuration = deepsecurity.Configuration()
configuration.host = 'YOUR_HOST'
# Authentication
configuration.api_key['api-secret-key'] = 'YOUR_API_KEY'
# Initialization
# Set Any Required Values
api_instance = deepsecurity.GlobalRulesApi(deepsecurity.ApiClient(configuration))
globalrules = deepsecurity.ApplicationControlGlobalRules()
api_version = 'YOUR VERSION'
try:
api_response = api_instance.add_global_rules(globalrules, api_version)
pprint(api_response)
except ApiException as e:
print("An exception occurred when calling GlobalRulesApi.add_global_rules: %s\n" % e)
I'd like to know how to populate the hash,description pair in the object that is passed to the add_global_rules method.