Class: Nomad::AgentMember

Inherits:
Response show all
Defined in:
lib/nomad/api/agent.rb

Constant Summary collapse

STATUS_ALIVE =

The text for an “alive” member

"alive".freeze

Constants inherited from Response

Response::BUILTIN_LOADERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Response

#==, decode, #initialize, #to_h

Constructor Details

This class inherits a constructor from Nomad::Response

Instance Attribute Details

#addressString (readonly)

The address of the member

Returns:

  • (String)


145
# File 'lib/nomad/api/agent.rb', line 145

field :Addr, as: :address

#delegate_curInteger (readonly)

The delegate_cur

Returns:

  • (Integer)


190
# File 'lib/nomad/api/agent.rb', line 190

field :DelegateCur, as: :delegate_cur

#delegate_maxInteger (readonly)

The delegate_max

Returns:

  • (Integer)


185
# File 'lib/nomad/api/agent.rb', line 185

field :DelegateMax, as: :delegate_max

#delegate_minInteger (readonly)

The delegate_min

Returns:

  • (Integer)


180
# File 'lib/nomad/api/agent.rb', line 180

field :DelegateMin, as: :delegate_min

#nameString (readonly)

The name of the member

Returns:

  • (String)


140
# File 'lib/nomad/api/agent.rb', line 140

field :Name, as: :name

#portInteger (readonly)

The rpc port of the member

Returns:

  • (Integer)


150
# File 'lib/nomad/api/agent.rb', line 150

field :Port, as: :port

#protocol_curInteger (readonly)

The protocol_cur

Returns:

  • (Integer)


175
# File 'lib/nomad/api/agent.rb', line 175

field :ProtocolCur, as: :protocol_cur

#protocol_maxInteger (readonly)

The protocol_max

Returns:

  • (Integer)


170
# File 'lib/nomad/api/agent.rb', line 170

field :ProtocolMax, as: :protocol_max

#protocol_minInteger (readonly)

The protocol_min

Returns:

  • (Integer)


165
# File 'lib/nomad/api/agent.rb', line 165

field :ProtocolMin, as: :protocol_min

#statusString (readonly)

The status

Returns:

  • (String)


160
# File 'lib/nomad/api/agent.rb', line 160

field :Status, as: :status

#tagsHash<String,String> (readonly)

The tags of the member (arbitary)

Returns:

  • (Hash<String,String>)


155
# File 'lib/nomad/api/agent.rb', line 155

field :Tags, as: :tags, load: :stringify_keys

Instance Method Details

#alive?Boolean

Determines if this member is alive.

Returns:

  • (Boolean)


195
196
197
# File 'lib/nomad/api/agent.rb', line 195

def alive?
  self.status == STATUS_ALIVE
end