Sha256: 83f11fbd30b6b41cfd640d36a9e3037c5e177962b87a737725838d07e8f72776

Contents?: true

Size: 1.11 KB

Versions: 24

Compression:

Stored size: 1.11 KB

Contents

require 'cgi'

class Fastly
  # Acces Control List Entry configuration
  class ACLEntry < Base
    attr_accessor :id, :service_id, :ip, :subnet, :acl_id, :negated, :comment

    ##
    # :attr: ip
    #
    # The IP address.

    ##
    # :attr: subnet
    #
    # Optional subnet for the IP address.

    ##
    # :attr: acl_id
    #
    # The ACL this entry belongs to.

    ##
    # :attr: negated
    #
    # A boolean that will negate the match if true.

    ##
    # :attr: comment
    #
    # A descriptive note.

    def self.get_path(service_id, acl_id, id)
      "/service/#{service_id}/acl/#{acl_id}/entry/#{CGI.escape(id)}"
    end

    def self.post_path(opts)
      "/service/#{opts[:service_id]}/acl/#{opts[:acl_id]}/entry"
    end

    def self.put_path(object)
      get_path(object.service_id, object.acl_id, object.id)
    end

    def self.delete_path(object)
      put_path(object)
    end

    def self.list_path(opts = {})
      "/service/#{opts[:service_id]}/acl/#{opts[:acl_id]}/entries"
    end

    def self.singularize
      'acl_entry'
    end

    def self.pluralize
      'acl_entries'
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fastly-3.0.2 lib/fastly/acl_entry.rb
fastly-3.0.1 lib/fastly/acl_entry.rb
fastly-3.0.0 lib/fastly/acl_entry.rb
fastly-2.5.3 lib/fastly/acl_entry.rb
fastly-2.5.2 lib/fastly/acl_entry.rb
fastly-2.5.1 lib/fastly/acl_entry.rb
fastly-2.5.0 lib/fastly/acl_entry.rb
fastly-2.4.0 lib/fastly/acl_entry.rb
fastly-2.3.1 lib/fastly/acl_entry.rb
fastly-2.3.0 lib/fastly/acl_entry.rb
fastly-2.2.0 lib/fastly/acl_entry.rb
fastly-2.1.0 lib/fastly/acl_entry.rb
fastly-2.0.0 lib/fastly/acl_entry.rb
fastly-1.15.0 lib/fastly/acl_entry.rb
fastly-1.14.0 lib/fastly/acl_entry.rb
fastly-1.13.2 lib/fastly/acl_entry.rb
fastly-1.13.1 lib/fastly/acl_entry.rb
fastly-1.13.0 lib/fastly/acl_entry.rb
fastly-1.12.0 lib/fastly/acl_entry.rb
fastly-1.11.0 lib/fastly/acl_entry.rb