ResponsePolicy class - Platform - BlueCat Gateway - 24.1

Gateway Administration Guide

Locale
English
Product name
BlueCat Gateway
Version
24.1

class bluecat.response_policy.ResponsePolicy(api, api_entity, ver='')

Bases: bluecat.entity.Entity

Base class for Response Policy. Wraps the ResponsePolicy object from BAM.

add_response_policy_item(item_name, properties='')

Adds a response policy item.

Parameters Description
item_name

The Fully Qualified Domain Name (FQDN) of the response policy item.

properties

Reserved for future use.

Returns: Returns true if the response policy item is successfully added and returns false if the response policy item already exists under the specified local response policy.

Example:

api = g.user.get_api()                                  # get api object
response_policy_id = 100001                             # response policy id
policy = api.get_entity_by_id(response_policy_id)

result = policy.add_response_policy_item('zone.zone')   # returns true or false

delete_response_policy_item(item_name, properties='')

Delete Response Policy item

Parameters Description
item_name

The Fully Qualified Domain Name (FQDN) of the response policy item.

properties

Reserved for future use.

Returns: Returns true if the response policy item is successfully deleted and returns false if not properly deleted.

Example:

api = g.user.get_api()                                   # get api object
response_policy_id = 100001                              # response policy id
policy = api.get_entity_by_id(response_policy_id)

result = policy.delete_response_policy_item('zone.zone') # returns true or false

get_entity()

Get the BAM Entity of a Response Policy.

upload_response_policy_item(file)

Upload response policy item based on a file, this will overwrite all other policy items in this response policy before hand

Parameters Description
file

The path of the file to be uploaded under the response policy. This file is passed to Address Manager as a byte array.

Example:

api = g.user.get_api()                                  # get api object
response_policy_id = 100001                             # response policy id
policy = api.get_entity_by_id(response_policy_id)

policy.upload_response_policy_item('/path_tofile/file')