Creating a Ruleset using the API requires specific syntax depending on whether you are using REST or SOAP. Use this table to find the syntax for your command.
Understanding How The API Works »
NOTE: Total number of records in a single Response Pool may not be more than 255.
WARNING: Dyn recommends setting an explicit fallback record entry in all Traffic Director services to ensure a query is always answered with a record. See TD Best Practices – Fallback Entry for more information on setting up a fall back entry.
REST Syntax
Click to view all REST Resources |
/REST/DSFRuleset/ POST — Create a new Ruleset.
HTTP Action — POST
URIs — https://api.dynect.net/REST/DSFRuleset/<service_id>/ |
Arguments — Click for More Info
- string
label — Required. A label for the Ruleset.
Click for Ruleset fields.
- string
publish — Indicates whether or not the changes will be published immediately.
Y — Service will be published on creation
N — Service will be published when zone changes are published.
- string
notes — A custom note field. All content in the string is added to the Zone Notes for the zones attached to this service when the zone is published. Only used when publish = Y
- string
criteria_type — Required A set of rules describing what traffic is applied to the Ruleset.
Valid values:
always – Always serve. Use to create a catch-all ruleset, which resolves all queries regardless of requestor’s IP address.
geoip – Use the location of the requestor’s IP address to determine where to send the traffic.
- string
criteria — Required dependent upon criteria_type.
Valid values:
|
Response — Click for More Info
- string
service_id — Identifier for the Traffic Director (DSF) service.
- string
dsf_response_pool_id Identifier for the Response Pool.
- string
dsf_ruleset_id — Identifier for the Ruleset.
Click for Ruleset fields.
- string
label — A label for the Ruleset.
- string
criteria_type — A set of rules describing what traffic is applied to the Response Pool.
Valid values:
always – Always serve. Use to create a catch-all ruleset, which resolves all queries regardless of requestor’s IP address.
geoip – Use the location of the requestor’s IP address to determine where to send the traffic.
- string
criteria — Dependent on criteria_type.
Valid values:
- hash
geoip — A hash where each element contains a list of ISO-3166 two letter codes to represent the names of countries and their subdivisions, one of the predefined groups, or one of the legacy regions.
- array
country — A list of ISO-3166 two letter codes representing Countries
- array
region — A list of ISO-3166 two letter codes representing Regions
- array
province — A list of ISO-3166 two letter codes representing Provinces
- string
ordering — Index of the Ruleset.
- string
eligible — Indicates whether or not the Ruleset can be served.
- string
pending_change — Indicates whether or not the response has any changes pending.
- array
response_pools — A list of Response Pools that are contained within the Ruleset.
- string
dsf_response_pool_id — Identifier for the Response Pool.
- Click for Response Pool Records.
- string
label — A label for the Response Pool.
- string
automation — Defines how eligible can be changed in response to monitoring.
Valid values:
auto — Sets the serve_mode field to ‘Monitor & Obey’. Default.
auto_down — Sets the serve_mode field to ‘Monitor & Remove’.
manual — Couples with eligible value to determine other serve_mode field values.
- string
core_set_count — If fewer than this number of core record sets are eligible, status will be set to fail.
- string
eligible — Indicates whether or not the Response Pool can be served.
- string
pending_change — Indicates whether or not the response has any changes pending.
- array
rs_chains — A list of Record Set Failover Chains that are defined for this Response Pool.
|
SOAP Syntax
Click to view all SOAP Commands |
CreateDSFRuleset — Creates a new Ruleset. |
Arguments — Click for More Info
- string
service_id — Identifier for the Traffic Director (DSF) service where the Ruleset belongs.
- string
label — Required. A label for the Ruleset.
Click for Ruleset fields.
- string
publish — Indicates whether or not the changes will be published immediately.
Y — Service will be published on creation
N — Service will be published when zone changes are published.
- string
notes — A custom note field. All content in the string is added to the Zone Notes for the zones attached to this service when the zone is published. Only used when publish = Y
- string
criteria_type — Required A set of rules describing what traffic is applied to the Ruleset.
Valid values:
always – Always serve. Use to create a catch-all ruleset, which resolves all queries regardless of requestor’s IP address.
geoip – Use the location of the requestor’s IP address to determine where to send the traffic.
- string
criteria — Required dependent upon criteria_type.
Valid values:
- hash
geoip — A hash where each element contains a list of ISO-3166 two letter codes to represent the names of countries and their subdivisions, one of the predefined groups, or one of the legacy regions.
- array
region — A list of ISO-3166 two letter codes representing Regions. Regions contain a set of countries.
- array
country — A list of ISO-3166 two letter codes representing Countries
- array
province — A list of ISO-3166 two letter codes representing Provinces
- string
ordering — Index of the Ruleset.
- array
response_pools — A list of Response Pools for this Ruleset. Either the ID of a current pool or arguments to create a new Response Pool.
- Click for Response Pool fields.
- string
failover — IP address or hostname to failover to.
– OR –
- string
dsf_response_pool_id — ID of a currently existing Response Pool to use.
– OR –
- string
label — Required. A label for the Response Pool.
- string
core_set_count — If fewer than this number of core record sets are eligible, status will be set to fail. Defaults to 0.
- string
eligible — Indicates whether or not the Response Pool can be served.
Valid values:
false — When automation is set to manual, sets the serve_mode field to ‘Do Not Serve’.
true — Default. When automation is set to manual, the Response Pool can be served.
NOTE: When automation is set to manual, eligible must be set to false.
- string
automation — Defines how ‘eligible’ can be changed in response to monitoring.
Valid values:
auto — Sets the serve_mode field to ‘Monitor & Obey’. Default.
auto_down — Sets the serve_mode field to ‘Monitor & Remove’.
manual — Couples with eligible value to determine other serve_mode field values.
- string
dsf_ruleset_id — ID of the Ruleset to join.
- string
index — When specified with `ruleset`, indicates the position of the Response Pool.
- array
rs_chains — A list of Record Set Failover Chains that are defined for this Response Pool
-
- string
label — A label for the Record Set Failover Chain
- string
core — Indicates whether or not this Record Set Failover Chain is a core Record Chain.
Valid values:
true — The Record Set Failover Chain is part of the core set. If the first Record Set in each core Record Set Failover Chain is down, the entire Response Pool will failover.
false — Default. The Record Set Failover Chain is NOT part of the core set.
- array
record_sets — A list of hashes to create a new Record Set or specify/update an existing Record Set.
Click for Record Set fields.
- string
failover — IP address or hostname to failover to.
– OR –
- string
dsf_record_set_id — ID of a currently existing Record Set to use.
– OR –
- string
token — Required. The session identifier.
|
Response — Click for More Info
|
Example Request — Click for More Info
{
'service_id' => 'fv298...', # ID shortened...
'label' => 'Example Ruleset',
'criteria_type' => 'geoip',
'criteria' => {
'geoip' => {
'country' => ['US'],
}
},
'ordering' => '2',
'response_pools' => [{
'label' => 'Response Pool Example',
'core_set_count' => '1',
'index' => '2',
'rs_chains' => [{
'label' => 'Example Record Set Failover Chain',
'core' => 'true',
'record_sets' => [{
'label' => 'US East - AAAA',
'rdata_class' => 'AAAA',
'ttl' => '3600',
'records' => [{
'label' => 'USEast007',
'weight' => '5',
'automation' => 'auto',
'endpoints' => ['127.1.5.1','176.2.66.7'],
'endpoint_up_count' => '1',
'master_line' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334',
}],
},{
'dsf_record_set_id' => '0bi5k...', # ID shortened...,
},{
'failover' => 'failover.com',
}],}
],
}]
'token' => 'asdlj34ot879834cdzjklfK'
}
|
<< DNS API Knowledge Base