Description

The editPolicyList operation handles configuration related to PolicyList model. 
This API call is not allowed on the standby unit in an HA pair.

HTTP request

PUT /api/fdm/v6/object/policylists/{objId}

Data Parameters

Parameter Required Type Description
version False string A unique string version assigned by the system when the object is created or modified. No assumption can be made on the format or content of this identifier. The identifier must be provided whenever attempting to modify/delete an existing object. As the version will change every time the object is modified, the value provided in this identifier must match exactly what is present in the system or the request will be rejected.
name True string A string containing the name of the policy list.
description False string An optional string describing the policy list.
Field level constraints: length must be between 0 and 200 (inclusive). (Note: Additional constraints might exist)
action True string A mandatory policy list object that defines the default action. Possible values are:
PERMIT
TRUST
DENY
Field level constraints: cannot be null. (Note: Additional constraints might exist)
interfaces False [object] A list of interface objects to be associated with the policy list.
Allowed types are: [BridgeGroupInterface, EtherChannelInterface, PhysicalInterface, SubInterface, VirtualTunnelInterface, VlanInterface]
standardAccessListAddresses False [object] A list of standard access list objects that specify addresses of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for addresses.
Allowed types are: [StandardAccessList]
ipv4PrefixListAddresses False [object] A list of IPv4 prefix list objects that specify addresses of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for addresses.
Allowed types are: [IPV4PrefixList]
standardAccessListNextHops False [object] A list of standard access list objects which specify next hops of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for next hops.
Allowed types are: [StandardAccessList]
ipv4PrefixListNextHops False [object] A list of IPv4 prefix list objects which specify next hops of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for next hops
Allowed types are: [IPV4PrefixList]
standardAccessListRouteSources False [object] A list of standard access list objects which specify route sources of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for route sources.
Allowed types are: [StandardAccessList]
ipv4PrefixListRouteSources False [object] A list of IPv4 prefix list objects which specify route sources of the policy list. Either standard access list objects or IPv4 prefix list objects can be specified for route sources.
Allowed types are: [IPV4PrefixList]
asPathLists False [object] A list of AS path list objects to be associated with the policy list.
Allowed types are: [ASPathList]
communityLists False [object] A list of community list objects to be associated with the policy list.
Allowed types are: [ExpandedCommunityList, StandardCommunityList]
matchCommunityExactly True boolean A boolean object which specifies if communities should be matched exactly.
Field level constraints: cannot be null. (Note: Additional constraints might exist)
metric False integer An integer number which specifies the metric value of the policy list.
Field level constraints: must be between 0 and 4294967295 (inclusive). (Note: Additional constraints might exist)
tag False integer An integer number which specifies the tag value of the policy list.
Field level constraints: must be between 0 and 4294967295 (inclusive). (Note: Additional constraints might exist)
id False string A unique string identifier assigned by the system when the object is created. No assumption can be made on the format or content of this identifier. The identifier must be provided whenever attempting to modify/delete (or reference) an existing object.
Field level constraints: must match pattern ^((?!;).)*$. (Note: Additional constraints might exist)
type True string A UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name.

Path Parameters

Parameter Required Type Description
objId True string

Example

curl -X PUT \
    --header "Accept: application/json" \
    --header "Authorization: Bearer ${ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    -d '{
        "action": "PERMIT",
        "asPathLists": [],
        "communityLists": [],
        "description": "string",
        "id": "string",
        "interfaces": [],
        "ipv4PrefixListAddresses": [],
        "ipv4PrefixListNextHops": [],
        "ipv4PrefixListRouteSources": [],
        "matchCommunityExactly": true,
        "metric": 0,
        "name": "string",
        "standardAccessListAddresses": [],
        "standardAccessListNextHops": [],
        "standardAccessListRouteSources": [],
        "tag": 0,
        "type": "policylist",
        "version": "string"
    }' \
    "https://${HOST}:${PORT}/api/fdm/v6/object/policylists/{objId}"
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient


def get_client(host, token):
    http_client = RequestsClient()
    http_client.ssl_verify = False
    http_client.set_api_key(
        host,
        "Bearer {}".format(token),
        param_name="Authorization",
        param_in="header"
    )
    return SwaggerClient.from_url(
        "https://{}/apispec/ngfw.json".format(host),
        http_client=http_client,
        config={
            "validate_responses": False,
            "validate_swagger_spec": False
        }
    )


def edit_policy_list(client, obj_id, body):
    return client.PolicyList.editPolicyList(
        objId=obj_id,
        body=body
    ).response().result


if __name__ == "__main__":
    host = "ftd.example.com"
    token = "access_token"
    client = get_client(host, token)

    obj_id = "string"
    body = {'action': 'PERMIT',
 'asPathLists': [],
 'communityLists': [],
 'description': 'string',
 'id': 'string',
 'interfaces': [],
 'ipv4PrefixListAddresses': [],
 'ipv4PrefixListNextHops': [],
 'ipv4PrefixListRouteSources': [],
 'matchCommunityExactly': True,
 'metric': 0,
 'name': 'string',
 'standardAccessListAddresses': [],
 'standardAccessListNextHops': [],
 'standardAccessListRouteSources': [],
 'tag': 0,
 'type': 'policylist',
 'version': 'string'}

    edit_policy_list(client, obj_id, body)