README.md in cloudflare-3.0.0 vs README.md in cloudflare-3.1.0
- old
+ new
@@ -64,10 +64,33 @@
dns_record = records.first
puts records.first.record[:name]
puts records
```
+Get firewall rules:
+
+```ruby
+all_rules = zones.first.firewall_rules.all
+block_rules = zones.first.firewall_rules.all("block") # or "whitelist" or "challenge"
+```
+
+Get blocked ips:
+
+```ruby
+block_rules = zones.first.firewall_rules.all("block")
+blocked_ips = zones.first.firewall_rules.firewalled_ips(block_rules)
+```
+
+Block an ip:
+
+```ruby
+# ip = "nnn.nnn.nnn.nnn"
+# note: "some note about the block"
+data = {"mode":"block","configuration":{"target":"ip","value":"#{ip}"},"notes":"#{note} #{Time.now.strftime("%m/%d/%y")} "}
+response = zones.first.firewall_rules.post(data.to_json, content_type: 'application/json')
+```
+
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
@@ -82,11 +105,12 @@
## License
Released under the MIT license.
Copyright, 2012, 2014, by [Marcin Prokop](https://github.com/b4k3r).
-Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
+Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
+Copyright, 2017, by [David Rosenbloom](http://artifactory.com).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -101,5 +125,8 @@
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+
+
+