Class: Fastly::ACL

Inherits:
BelongsToServiceAndVersion show all
Defined in:
lib/fastly/acl.rb

Overview

Acces Control List configuration

Instance Attribute Summary collapse

Attributes inherited from BelongsToServiceAndVersion

#version

Attributes inherited from Base

#fetcher

Instance Method Summary collapse

Methods inherited from BelongsToServiceAndVersion

#as_hash, delete_path, get_path, path_escape, post_path, put_path, #service, #version_number

Methods inherited from Base

#as_hash, #delete!, delete_path, get_path, #initialize, list_path, path, post_path, put_path, #require_api_key!, #save!

Constructor Details

This class inherits a constructor from Fastly::Base

Instance Attribute Details

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/fastly/acl.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/fastly/acl.rb', line 4

def name
  @name
end

#service_idObject

Returns the value of attribute service_id.



4
5
6
# File 'lib/fastly/acl.rb', line 4

def service_id
  @service_id
end

Instance Method Details

#create_entry(opts = {}) ⇒ Object

Create an ACL entry and add it to the ACL



30
31
32
33
34
35
36
37
38
39
# File 'lib/fastly/acl.rb', line 30

def create_entry(opts = {})
  fetcher.create_acl_entry(
    service_id: service_id,
    acl_id: id,
    ip: opts[:ip],
    negated: opts[:negated],
    subnet: opts[:subnet],
    comment: opts[:comment]
  )
end

#delete_entry(entry) ⇒ Object

Delete an ACL entry



58
59
60
# File 'lib/fastly/acl.rb', line 58

def delete_entry(entry)
  fetcher.delete_acl_entry(entry)
end

#get_entry(entry_id) ⇒ Object

Retrieve an ACL entry



44
45
46
# File 'lib/fastly/acl.rb', line 44

def get_entry(entry_id)
  fetcher.get_acl_entry(service_id, id, entry_id)
end

#list_entriesObject

List ACL entries that belong to the ACL



23
24
25
# File 'lib/fastly/acl.rb', line 23

def list_entries
  fetcher.list_acl_entries(:service_id => service_id, :acl_id => id)
end

#update_entry(entry) ⇒ Object

Update an ACL entry



51
52
53
# File 'lib/fastly/acl.rb', line 51

def update_entry(entry)
  fetcher.update_acl_entry(entry)
end