Class GslbPolicy
source code
object --+
|
base.AxObject --+
|
GslbPolicy
Implementation of the aXAPI gslb.policy.* method to
manage the GSLB policy configuration as getAll/create/delete/update
Usage:
# DNS proxy with parameters:
# name (required) GSLB DNS proxy name
# name GSLB policy name
# metric tag for the metric list
# session_capacity tag for session capacity
# enabled the status of session capacity
# threshold threshold of session capacity
# active_rrt
# enabled the status of active RRT
# samples the number of samples
# difference difference
# tolerance tolerance
# time_out time out
# skip skip
# single_shot single shot
# connection_load
# enabled the status of connection load
# limit connection limit
# samples_num sample number
# samples_interval sample interval
# num_session number session
# enabled status of number session
# tolerance tolerance
# geo_graphic tag of geographic
# enabled status of geographic option
# ordered_ip tag if ordered IP option
# enabled status of ordered IP option
# weighted_site tag of weighted site option
# enabled status of weighted site option
# active_servers tag of active servers
# enabled status of active servers
# weighted_ip tag of weighted IP option
# enabled status of weighted IP option
# bandwidth_cost tag of bandwidth option
# enabled status of bandwidth
# health_check tag of health check option
# enabled status of health check option
# admin_perference tag of administrator preference
# enabled status of administrator preference option
# least_response tag of least connection option
# enabled status of least response option
# round_robin tag of round robin option
# enabled status of round robin
# dns_options tag of DNS options
# action action
# active_only action only
# best_only best only
# dns_cache tag of DNS cache
# enabled status of DNS cache
# dns_cache_aging_time DNS cache aging time
# cname_detect CName detected
# external_ip external IP
# ip_replace IP replace
# geo_location_alias geographic location alias
# geo_location_action geographic location action
# geo_location_policy geographic location policy
# mx_additional MX additional
# server_mode tag of server mode
# enabled status of server mode
# authoritative_mode authoritative mode
# full_server_list full server list
# server_mx server MX record
# server_mx_additional server MX additional record
# server_ns server NS record
# server_auto_ns server auto NS
# server_ptr server PTR
# server_auto_ptr server auto PTR
# sticky tag of sticky
# enabled status of sticky
# sticky_dns_client_ip_mask_len sticky DNS client IP mask length
# ttl tag of TTL
# enabled status of TTL
# ttl_time_live TTL time live
# geo_location tag of geographic location
# geo_location_match_first geographic location match first
# geo_location_overlap geographic location overlap
# Example:
# create a GSLB policy configuration as:
!
gslb policy policy01
dns action
dns ttl 0
capacity threshold 80
num-session tolerance 0
active-rtt tolerance 20
active-rtt difference 5
active-rtt samples 8
active-rtt timeout 2
active-rtt skip 5
metric-order health-check geographic weighted-ip active-servers weighted-site capacity active-rtt num-session connection-load admin-preference bw-cost least-response ordered-ip
!
#
policy1 = GslbPolicy(name="policy01")
policy1.metric["session_capacity"] = {"enabled": 0, "threshold": 80}
policy1.metric["active_rrt"] = {"enabled": 0, "samples": 8, "difference": 5, "tolerance": 20, "timeout": 2, "skip": 5, "single_short": 1}
policy1.metric["connection_load"] = {"enabled": 0, "limit": 0, "samples_num": 5, "samples_interval": 5}
policy1.metric["num_sessions"] = {"enabled": 0, "tolerance": 0}
policy1.metric["geo_graphic"] = {"enabled": 1}
policy1.metric["orderid_ip"] = {"enabled": 0}
policy1.metric["weighted_site"] = {"enabled": 0}
policy1.dns_options["dns_cache"] = {"enabled": 1}
policy1.dns_options["action"] = 1
policy1.dns_options["active_only"] = 0
policy1.dns_options["best_only"] = 0
policy1.dns_options["dns_cache"] = {"enabled": 0, "dns_cache_aging_time": 0}
policy1.dns_options["cname_detect"] = 1
policy1.dns_options["external_ip"] = 1
policy1.dns_options["ip_replace"] = 0
policy1.dns_options["geo_location_alias"] = 0
policy1.dns_options["geo_location_action"] = 0
policy1.dns_options["geo_location_policy"] = 0
policy1.dns_options["mx_additional"] = 0
policy1.dns_options["server_mode"] = {"enabled":0, "authoritative_mode":0}
policy1.dns_options["ttl"] = {"enabled":1, "ttl_time_live":0}
policy1.create()
|
__init__(self,
**params)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
create(self)
method: gslb.policy.create Create the GSLB policy. |
source code
|
|
|
delete(self)
method: gslb.policy.delete Delete the GSLB policy. |
source code
|
|
|
update(self)
method: gslb.policy.update Update the GSLB policy. |
source code
|
|
Inherited from base.AxObject :
__getattr__ ,
__getitem__ ,
__repr__ ,
__setattr__ ,
__setitem__ ,
__str__ ,
dump ,
get ,
getInfo ,
getObjectDict ,
getRequestPostDataJson ,
getRequestPostDataXml
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__sizeof__ ,
__subclasshook__
|
|
getAll()
method : gslb.policy.getAll Returns a list of GSLB policy in
GslbPolicy instance. |
source code
|
|
|
searchByName(name)
method: gslb.policy.search Search the GSLB policy by given name. |
source code
|
|
Inherited from object :
__class__
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|