尝试使用自动化 API 示例向 DSaaS 添加全局规则。我不知道如何在 globalrules = deepsecurity.ApplicationControlGlobalRules() 中填充哈希、描述对。
尝试使用 JSON,但不知道该怎么做。
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)
我想知道如何在传递给 add_global_rules 方法的对象中填充散列、描述对。