class Saklient::Cloud::Resources::Ipv4Net

IPv4ネットワークの実体1つに対応し, 属性の取得や操作を行うためのクラス.

Attributes

_range[RW]

@private @return [Ipv4Range]

address[R]

ネットワークアドレス

@return [String]

default_route[R]

デフォルトルート

@return [String]

id[R]

ID

@return [String]

m_address[RW]

ネットワークアドレス

@return [String]

m_default_route[RW]

デフォルトルート

@return [String]

m_id[RW]

ID

@return [String]

m_mask_len[RW]

マスク長

@return [Fixnum]

m_next_hop[RW]

ネクストホップ

@return [String]

mask_len[R]

マスク長

@return [Fixnum]

n_address[RW]

@return [bool]

n_default_route[RW]

@return [bool]

n_id[RW]

@return [bool]

n_mask_len[RW]

@return [bool]

n_next_hop[RW]

@return [bool]

next_hop[R]

ネクストホップ

@return [String]

range[R]

利用可能なIPアドレス範囲

@return [Ipv4Range]

Public Class Methods

new(client, obj, wrapped = false) click to toggle source

@private @param [Saklient::Cloud::Client] client @param [any] obj @param [bool] wrapped

# File lib/saklient/cloud/resources/ipv4_net.rb, line 109
def initialize(client, obj, wrapped = false)
  super(client)
  Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
  Saklient::Util::validate_type(wrapped, 'bool')
  api_deserialize(obj, wrapped)
end

Public Instance Methods

_class_name() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 88
def _class_name
  return 'Ipv4Net'
end
_id() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 94
def _id
  return get_id
end
get_range() click to toggle source

@private @return [Ipv4Range]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 51
def get_range
  return @_range
end
reload() click to toggle source

最新のリソース情報を再取得します.

@return [Swytch] this

# File lib/saklient/cloud/resources/ipv4_net.rb, line 101
def reload
  return _reload
end

Protected Instance Methods

_api_path() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 68
def _api_path
  return '/subnet'
end
_on_after_api_deserialize(r, root) click to toggle source

@private @param [any] r @param [any] root @return [void]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 122
def _on_after_api_deserialize(r, root)
  @_range = nil
  addresses = r[:IPAddresses]
  @_range = Saklient::Cloud::Resources::Ipv4Range.new(addresses) if !(addresses).nil?
end
_root_key() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 74
def _root_key
  return 'Subnet'
end
_root_key_m() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 80
def _root_key_m
  return 'Subnets'
end
api_deserialize_impl(r) click to toggle source

(This method is generated in Translator_default#buildImpl)

@param [any] r

# File lib/saklient/cloud/resources/ipv4_net.rb, line 251
def api_deserialize_impl(r)
  @is_new = (r).nil?
  r = {} if @is_new
  @is_incomplete = false
  if Saklient::Util::exists_path(r, 'ID')
    @m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
  else
    @m_id = nil
    @is_incomplete = true
  end
  @n_id = false
  if Saklient::Util::exists_path(r, 'NetworkAddress')
    @m_address = (Saklient::Util::get_by_path(r, 'NetworkAddress')).nil? ? nil : Saklient::Util::get_by_path(r, 'NetworkAddress').to_s
  else
    @m_address = nil
    @is_incomplete = true
  end
  @n_address = false
  if Saklient::Util::exists_path(r, 'NetworkMaskLen')
    @m_mask_len = (Saklient::Util::get_by_path(r, 'NetworkMaskLen')).nil? ? nil : (Saklient::Util::get_by_path(r, 'NetworkMaskLen').to_s).to_s().to_i(10)
  else
    @m_mask_len = nil
    @is_incomplete = true
  end
  @n_mask_len = false
  if Saklient::Util::exists_path(r, 'DefaultRoute')
    @m_default_route = (Saklient::Util::get_by_path(r, 'DefaultRoute')).nil? ? nil : Saklient::Util::get_by_path(r, 'DefaultRoute').to_s
  else
    @m_default_route = nil
    @is_incomplete = true
  end
  @n_default_route = false
  if Saklient::Util::exists_path(r, 'NextHop')
    @m_next_hop = (Saklient::Util::get_by_path(r, 'NextHop')).nil? ? nil : Saklient::Util::get_by_path(r, 'NextHop').to_s
  else
    @m_next_hop = nil
    @is_incomplete = true
  end
  @n_next_hop = false
end
api_serialize_impl(withClean = false) click to toggle source

@private @param [bool] withClean @return [any]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 295
def api_serialize_impl(withClean = false)
  Saklient::Util::validate_type(withClean, 'bool')
  ret = {}
  Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
  Saklient::Util::set_by_path(ret, 'NetworkAddress', @m_address) if withClean || @n_address
  Saklient::Util::set_by_path(ret, 'NetworkMaskLen', @m_mask_len) if withClean || @n_mask_len
  Saklient::Util::set_by_path(ret, 'DefaultRoute', @m_default_route) if withClean || @n_default_route
  Saklient::Util::set_by_path(ret, 'NextHop', @m_next_hop) if withClean || @n_next_hop
  return ret
end
get_address() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 159
def get_address
  return @m_address
end
get_default_route() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 207
def get_default_route
  return @m_default_route
end
get_id() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 135
def get_id
  return @m_id
end
get_mask_len() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [Fixnum]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 183
def get_mask_len
  return @m_mask_len
end
get_next_hop() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/ipv4_net.rb, line 231
def get_next_hop
  return @m_next_hop
end