1 Reply Latest reply on Mar 6, 2019 9:30 PM by Michael.R.Taylor-Oracle

    update ruleset api question

    Michael.R.Taylor-Oracle

      Originally posted by leom on dyncommunity.com on 29 January 2019

       

      Hi,

      I have a question with this api
      https://help.dyn.com/update-dsf-ruleset-api/

      Is there a sample criteria for geoip that can be shared, how to call it for the REST api. I am getting confused with the description for ruleset criteria field in that page (also listed below) as to how that is constructed.

      Thanks, Leo

      string criteria — 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

        • 1. Re: update ruleset api question
          Michael.R.Taylor-Oracle

          Originally posted by thedavecarroll on dyncommunity.com on 6 February 2019

           

          My developer account does not have the Traffic Director add-on. However, after looking at the documentation, perhaps this JSON might be helpful.

          1. {
          2.      "label":  "RulesetName",
          3.      "ordering":  1,
          4.      "publish":  "N",
          5.      "criteria_type":  "geoip",
          6.      "criteria":  {
          7.                       "country":  [
          8.                                       "US",
          9.                                       "CA",
          10.                                       "MX"
          11.                                   ]
          12.                   },
          13.      "response_pools":  [
          14.                             "dsf_response_pool_id"
          15.                         ],
          16.      "remove_orphans": "N" 
          17. }

          If you are creating a new response pool at the same time, the JSON would be considerably larger.

          I'm not sure what you are using to test your API calls; personally, I use Insomnia (Windows). It has helped me numerous times.

          Also, I use PowerShell to translate hashtables into properly formatted JSON. You can find JSON formatters online.

          Hope that helps. Dave