Notes about Resource Property Values
There are a few things that you should be aware of when setting values for resource properties or Deep Security Manager settings.
How to express a null value
To express a null
value using the API, use 0
(zero). For example, when you use 0
as the policyID for a computer it is interpreted as null
, and that the computer has no assigned policy.
Note that this applies when using the API directly. The client libraries support the use of null values.
Valid values for Boolean properties
When you use the API, you must use either true
or false
for the values of Boolean properties. Any other value returns an error.
If you do not provide a value (i.e. null), false
is the default value.
Include only changed values when modifying resources
When you use an operation to modify a resource, you provide only the properties that you need to change. For example, to change the name of a policy, you provide a policy object with a name property, and all other properties are null or not specified. This pattern is typical for REST API's.
When using programming languages such as Python, JavaScript, or Java, you might be accustomed to obtaining an object that represents the resource, changing a property, and then returning the object in the update call. However, when using the Deep Security client libraries you create an object, set only the values that you want to change, and then use that object in the update call. In this example, only the policy name is changed:
policy = api.Policy() policy.name = policy_name policy_api = api.PoliciesApi() policy_api.modifyPolicy(policyID, policy, false, "v1")
const policy = new api.Policy(); policy.name = policyName; const policiesApi = new api.PoliciesApi(); policiesApi.modifyPolicy(policyID, policy, "v1", { overrides: false})
Policy policy = new Policy(); policy.setName(policyName); PoliciesApi policiesApi = new PoliciesApi(); policiesApi.modifyPolicy(policyID, policy, false, "v1");