Class: Latitude::API::Resources::Firewall

Inherits:
APIResource
  • Object
show all
Extended by:
Operations::Create, Operations::Delete, Operations::List, Operations::Retrieve, Operations::Update
Defined in:
lib/latitude/api/resources/firewall.rb

Defined Under Namespace

Classes: Assignment, Rule

Constant Summary

Constants inherited from APIResource

APIResource::READ_ONLY_ATTRIBUTES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#id, #meta, #path_params, #raw_data, #type

Class Method Summary collapse

Methods included from Operations::List

all, list

Methods included from Operations::Create

create

Methods included from Operations::Retrieve

retrieve

Methods included from Operations::Update

update

Methods included from Operations::Delete

delete

Methods inherited from APIResource

#==, #[], #[]=, #as_json, #attributes, #changed?, class_url, config_source, construct_from, #delete, execute_request, extract_path_params, #hash, id_prefix, #initialize, #inspect, instance_url, #method_missing, path_param_keys, #refresh, resource_path, resource_type, #resource_url, #respond_to_missing?, #save, #to_h, #unsaved_attributes, with_config, #write_attribute

Methods included from Attributes::ClassMethods

#attribute, #attribute_specs

Methods included from Attributes::InstanceMethods

#attribute_spec, #read_attribute, #wrap_attribute

Constructor Details

This class inherits a constructor from Latitude::API::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Latitude::API::APIResource

Instance Attribute Details

#firewallObject



# File 'lib/latitude/api/resources/firewall.rb', line 55

#firewall_idObject



# File 'lib/latitude/api/resources/firewall.rb', line 59

#nameString

Returns:

  • (String)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/latitude/api/resources/firewall.rb', line 12

class Firewall < APIResource
    # @!attribute [r] from
    #   @return [String]
    # @!attribute [r] to
    #   @return [String]
    # @!attribute [r] port
    #   @return [String]
    # @!attribute [r] protocol
    #   @return [String]
    # @!attribute [r] default
    #   @return [Boolean]
  class Rule < APIObject
    attribute :from, :string, read_only: true
    attribute :to, :string, read_only: true
    attribute :port, :string, read_only: true
    attribute :protocol, :string, read_only: true
    attribute :default, :boolean, read_only: true
  end

  attribute :name, :string
  attribute :project, Objects::Project
  attribute :rules, [Rule]

  resource_type "firewalls"
  resource_path "/firewalls"
  id_prefix     "firewall_"

  extend Operations::List
  extend Operations::Create
  extend Operations::Retrieve
  extend Operations::Update
  extend Operations::Delete

  class << self
    def assignments
      Assignment
    end
  end

  # @!attribute [rw] server

  #   @return [Server]

  # @!attribute [rw] firewall

  #   @return [Firewall]

  # @!attribute [rw] firewall_id

  #   @return [String]

  class Assignment < APIResource

      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] hostname

      #   @return [String]

      # @!attribute [r] primary_ipv4

      #   @return [String]

    class Server < APIObject

      attribute :id, :string, read_only: true

      attribute :hostname, :string, read_only: true

      attribute :primary_ipv4, :string, read_only: true

    end


      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] name

      #   @return [String]

    class Firewall < APIObject

      attribute :id, :string, read_only: true

      attribute :name, :string, read_only: true

    end


    attribute :server, Server

    attribute :firewall, Firewall

    attribute :firewall_id, :string

    resource_type "firewall_assignments"
    resource_path "/firewalls/:firewall_id/assignments"

    extend Operations::List
    extend Operations::Create
    extend Operations::Delete

    class << self
      def list_all(params = {}, opts = {})
        query = RequestParams.encode(params)
        parsed = execute_request(method: :get, path: "/firewalls/assignments", query: query, opts: opts)
        ListObject.new(resource_class: self, parsed: parsed, request_params: params, request_opts: opts)
      end
    end
  end
end

#projectLatitude::API::Objects::Project



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/latitude/api/resources/firewall.rb', line 12

class Firewall < APIResource
    # @!attribute [r] from
    #   @return [String]
    # @!attribute [r] to
    #   @return [String]
    # @!attribute [r] port
    #   @return [String]
    # @!attribute [r] protocol
    #   @return [String]
    # @!attribute [r] default
    #   @return [Boolean]
  class Rule < APIObject
    attribute :from, :string, read_only: true
    attribute :to, :string, read_only: true
    attribute :port, :string, read_only: true
    attribute :protocol, :string, read_only: true
    attribute :default, :boolean, read_only: true
  end

  attribute :name, :string
  attribute :project, Objects::Project
  attribute :rules, [Rule]

  resource_type "firewalls"
  resource_path "/firewalls"
  id_prefix     "firewall_"

  extend Operations::List
  extend Operations::Create
  extend Operations::Retrieve
  extend Operations::Update
  extend Operations::Delete

  class << self
    def assignments
      Assignment
    end
  end

  # @!attribute [rw] server

  #   @return [Server]

  # @!attribute [rw] firewall

  #   @return [Firewall]

  # @!attribute [rw] firewall_id

  #   @return [String]

  class Assignment < APIResource

      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] hostname

      #   @return [String]

      # @!attribute [r] primary_ipv4

      #   @return [String]

    class Server < APIObject

      attribute :id, :string, read_only: true

      attribute :hostname, :string, read_only: true

      attribute :primary_ipv4, :string, read_only: true

    end


      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] name

      #   @return [String]

    class Firewall < APIObject

      attribute :id, :string, read_only: true

      attribute :name, :string, read_only: true

    end


    attribute :server, Server

    attribute :firewall, Firewall

    attribute :firewall_id, :string

    resource_type "firewall_assignments"
    resource_path "/firewalls/:firewall_id/assignments"

    extend Operations::List
    extend Operations::Create
    extend Operations::Delete

    class << self
      def list_all(params = {}, opts = {})
        query = RequestParams.encode(params)
        parsed = execute_request(method: :get, path: "/firewalls/assignments", query: query, opts: opts)
        ListObject.new(resource_class: self, parsed: parsed, request_params: params, request_opts: opts)
      end
    end
  end
end

#rulesArray<Rule>

Returns:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/latitude/api/resources/firewall.rb', line 12

class Firewall < APIResource
    # @!attribute [r] from
    #   @return [String]
    # @!attribute [r] to
    #   @return [String]
    # @!attribute [r] port
    #   @return [String]
    # @!attribute [r] protocol
    #   @return [String]
    # @!attribute [r] default
    #   @return [Boolean]
  class Rule < APIObject
    attribute :from, :string, read_only: true
    attribute :to, :string, read_only: true
    attribute :port, :string, read_only: true
    attribute :protocol, :string, read_only: true
    attribute :default, :boolean, read_only: true
  end

  attribute :name, :string
  attribute :project, Objects::Project
  attribute :rules, [Rule]

  resource_type "firewalls"
  resource_path "/firewalls"
  id_prefix     "firewall_"

  extend Operations::List
  extend Operations::Create
  extend Operations::Retrieve
  extend Operations::Update
  extend Operations::Delete

  class << self
    def assignments
      Assignment
    end
  end

  # @!attribute [rw] server

  #   @return [Server]

  # @!attribute [rw] firewall

  #   @return [Firewall]

  # @!attribute [rw] firewall_id

  #   @return [String]

  class Assignment < APIResource

      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] hostname

      #   @return [String]

      # @!attribute [r] primary_ipv4

      #   @return [String]

    class Server < APIObject

      attribute :id, :string, read_only: true

      attribute :hostname, :string, read_only: true

      attribute :primary_ipv4, :string, read_only: true

    end


      # @!attribute [r] id

      #   @return [String]

      # @!attribute [r] name

      #   @return [String]

    class Firewall < APIObject

      attribute :id, :string, read_only: true

      attribute :name, :string, read_only: true

    end


    attribute :server, Server

    attribute :firewall, Firewall

    attribute :firewall_id, :string

    resource_type "firewall_assignments"
    resource_path "/firewalls/:firewall_id/assignments"

    extend Operations::List
    extend Operations::Create
    extend Operations::Delete

    class << self
      def list_all(params = {}, opts = {})
        query = RequestParams.encode(params)
        parsed = execute_request(method: :get, path: "/firewalls/assignments", query: query, opts: opts)
        ListObject.new(resource_class: self, parsed: parsed, request_params: params, request_opts: opts)
      end
    end
  end
end

#serverObject



# File 'lib/latitude/api/resources/firewall.rb', line 51

Class Method Details

.assignmentsObject



46
47
48
# File 'lib/latitude/api/resources/firewall.rb', line 46

def assignments
  Assignment
end