Class: Latitude::API::Resources::ElasticIP

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

Defined Under Namespace

Classes: Location, Region, Server

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

Instance 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

#addressString

Returns:

  • (String)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#created_atTime (readonly)

Returns:

  • (Time)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#familyString

Returns:

  • (String)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#modeString

Returns:

  • (String)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#prefix_lengthInteger

Returns:

  • (Integer)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#projectLatitude::API::Objects::Project



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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#regionRegion

Returns:



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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#serverServer

Returns:



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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

#statusString

Returns:

  • (String)


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
# File 'lib/latitude/api/resources/elastic_ip.rb', line 24

class ElasticIP < APIResource
    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] hostname
    #   @return [String]
    # @!attribute [r] primary_ipv4
    #   @return [String]
    # @!attribute [r] operating_system
    #   @return [String]
  class Server < APIObject
    attribute :id, :string, read_only: true
    attribute :hostname, :string, read_only: true
    attribute :primary_ipv4, :string, read_only: true
    attribute :operating_system, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] slug
    #   @return [String]
  class Location < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :slug, :string, read_only: true
  end

    # @!attribute [r] id
    #   @return [String]
    # @!attribute [r] name
    #   @return [String]
    # @!attribute [r] location
    #   @return [Location]
  class Region < APIObject
    attribute :id, :string, read_only: true
    attribute :name, :string, read_only: true
    attribute :location, Location, read_only: true
  end

  attribute :address, :string
  attribute :family, :string
  attribute :prefix_length, :integer
  attribute :mode, :string
  attribute :status, :string
  attribute :created_at, :time, read_only: true
  attribute :server, Server
  attribute :project, Objects::Project
  attribute :region, Region

  resource_type "elastic_ips"
  resource_path "/elastic_ips"
  id_prefix     "eip_"

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

  class << self
    def move(id, server_id:, opts: {})
      update(id, { server_id: server_id }, opts)
    end
  end

  def move_to(server_id, opts = {})
    self.class.move(id, server_id: server_id, opts: opts)
  end
end

Class Method Details

.move(id, server_id:, opts: {}) ⇒ Object



85
86
87
# File 'lib/latitude/api/resources/elastic_ip.rb', line 85

def move(id, server_id:, opts: {})
  update(id, { server_id: server_id }, opts)
end

Instance Method Details

#move_to(server_id, opts = {}) ⇒ Object



90
91
92
# File 'lib/latitude/api/resources/elastic_ip.rb', line 90

def move_to(server_id, opts = {})
  self.class.move(id, server_id: server_id, opts: opts)
end