ResponsePolicy class - Platform - BlueCat Gateway - 20.1.1

Gateway Administration Guide

Locale
English (United States)
Product name
BlueCat Gateway
Version
20.1.1

This class wraps the ResponsePolicy object from BAM. This object inherits from APIObject and not from Entity.

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

Bases: bluecat.entity.Entity

Base class for response policy.

add_response_policy_item(item_name, properties='')

Adds a response policy item.

Parameters Description
item_name (string, required) 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
ip4_id = 10234                          # ip4 block/ip4 network id
ip4_object = api.get_entity_by_id(ip4_id)
new_ip4_address = '10.0.0.1'            # new IP address to be allocated

ip4_object.move_ip_object(new_ip4_address)

delete_response_policy_item(item_name, properties='')

Deletes response policy item.

Parameters Description
item_name (string, required) 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.

get_type

Get the BAM type of the response policy.

upload_response_policy_item(file)

Upload response policy item based on the file and overwrites all other policy items in the response policy.
Parameters Description
file (string, required)

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') # returns true or false