Class: BunBun::Client::PullZone::EdgeRules

Inherits:
Namespace
  • Object
show all
Defined in:
lib/bunbun/client/pull_zone/edge_rules.rb

Instance Method Summary collapse

Methods inherited from Namespace

#initialize, #inspect

Constructor Details

This class inherits a constructor from BunBun::Client::Namespace

Instance Method Details

#delete(zone_id, rule_id) ⇒ Object



10
11
12
# File 'lib/bunbun/client/pull_zone/edge_rules.rb', line 10

def delete(zone_id, rule_id)
  @client.delete("/pullzone/#{zone_id}/edgerules/#{rule_id}")
end

#disenable(zone_id, rule_id) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/bunbun/client/pull_zone/edge_rules.rb', line 14

def disenable(zone_id, rule_id)
  body_params = {
    Id: Integer(zone_id),
    Value: false
  }

  @client.post("/pullzone/#{zone_id}/edgerules/#{rule_id}/setEdgeRuleEnabled", body_params)
end

#enable(zone_id, rule_id) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/bunbun/client/pull_zone/edge_rules.rb', line 23

def enable(zone_id, rule_id)
  body_params = {
    Id: Integer(zone_id),
    Value: true
  }

  @client.post("/pullzone/#{zone_id}/edgerules/#{rule_id}/setEdgeRuleEnabled", body_params)
end

#post(zone_id, body_params) ⇒ Object Also known as: create, update



4
5
6
# File 'lib/bunbun/client/pull_zone/edge_rules.rb', line 4

def post(zone_id, body_params)
  @client.post("/pullzone/#{zone_id}/edgerules/addOrUpdate", BunBun::Body.transform_keys(body_params))
end