Class: Saklient::Cloud::Resources::Iface
- Defined in:
- lib/saklient/cloud/resources/iface.rb
Overview
インタフェースの実体1つに対応し, 属性の取得や操作を行うためのクラス.
Instance Attribute Summary collapse
-
#activity ⇒ IfaceActivity
readonly
アクティビティ.
-
#id ⇒ String
readonly
ID.
-
#ip_address ⇒ String
readonly
IPv4アドレス(共有セグメントによる自動割当).
-
#mac_address ⇒ String
readonly
MACアドレス.
-
#server_id ⇒ String
このインタフェースが取り付けられているサーバのID.
-
#swytch_id ⇒ String
このインタフェースの接続先スイッチのID.
-
#user_ip_address ⇒ String
ユーザ設定IPv4アドレス.
Attributes inherited from Resource
Instance Method Summary collapse
- #_class_name ⇒ String
- #_id ⇒ String
-
#connect_to_shared_segment ⇒ Iface
共有セグメントに接続します.
-
#connect_to_swytch(swytch) ⇒ Iface
スイッチに接続します.
-
#connect_to_swytch_by_id(swytchId) ⇒ Iface
指定したIDのスイッチに接続します.
-
#disconnect_from_swytch ⇒ Iface
スイッチから切断します.
-
#find_swytch ⇒ Swytch
接続先のスイッチを取得します.
- #get_activity ⇒ IfaceActivity
-
#initialize(client, obj, wrapped = false) ⇒ Iface
constructor
A new instance of Iface.
-
#reload ⇒ Iface
最新のリソース情報を再取得します.
-
#save ⇒ Iface
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
Methods inherited from Resource
#api_deserialize, #api_serialize, create_with, #destroy, #dump, #exists, #request_retry, #set_param
Constructor Details
#initialize(client, obj, wrapped = false) ⇒ Iface
Returns a new instance of Iface.
124 125 126 127 128 129 130 |
# File 'lib/saklient/cloud/resources/iface.rb', line 124 def initialize(client, obj, wrapped = false) super(client) Saklient::Util::validate_type(client, 'Saklient::Cloud::Client') Saklient::Util::validate_type(wrapped, 'bool') @_activity = Saklient::Cloud::Resources::IfaceActivity.new(client) api_deserialize(obj, wrapped) end |
Instance Attribute Details
#activity ⇒ IfaceActivity (readonly)
アクティビティ
114 115 116 |
# File 'lib/saklient/cloud/resources/iface.rb', line 114 def activity @activity end |
#id ⇒ String (readonly)
ID
206 207 208 |
# File 'lib/saklient/cloud/resources/iface.rb', line 206 def id @id end |
#ip_address ⇒ String (readonly)
IPv4アドレス(共有セグメントによる自動割当)
254 255 256 |
# File 'lib/saklient/cloud/resources/iface.rb', line 254 def ip_address @ip_address end |
#mac_address ⇒ String (readonly)
MACアドレス
230 231 232 |
# File 'lib/saklient/cloud/resources/iface.rb', line 230 def mac_address @mac_address end |
#server_id ⇒ String
このインタフェースが取り付けられているサーバのID
331 332 333 |
# File 'lib/saklient/cloud/resources/iface.rb', line 331 def server_id @server_id end |
#swytch_id ⇒ String
このインタフェースの接続先スイッチのID
372 373 374 |
# File 'lib/saklient/cloud/resources/iface.rb', line 372 def swytch_id @swytch_id end |
#user_ip_address ⇒ String
ユーザ設定IPv4アドレス
290 291 292 |
# File 'lib/saklient/cloud/resources/iface.rb', line 290 def user_ip_address @user_ip_address end |
Instance Method Details
#_class_name ⇒ String
73 74 75 |
# File 'lib/saklient/cloud/resources/iface.rb', line 73 def _class_name return 'Iface' end |
#_id ⇒ String
79 80 81 |
# File 'lib/saklient/cloud/resources/iface.rb', line 79 def _id return get_id end |
#connect_to_shared_segment ⇒ Iface
共有セグメントに接続します.
167 168 169 170 |
# File 'lib/saklient/cloud/resources/iface.rb', line 167 def connect_to_shared_segment @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/to/switch/shared') return reload end |
#connect_to_swytch(swytch) ⇒ Iface
スイッチに接続します.
148 149 150 151 152 |
# File 'lib/saklient/cloud/resources/iface.rb', line 148 def connect_to_swytch(swytch) Saklient::Util::validate_type(swytch, 'Saklient::Cloud::Resources::Swytch') @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/to/switch/' + Saklient::Util::url_encode(swytch._id)) return reload end |
#connect_to_swytch_by_id(swytchId) ⇒ Iface
指定したIDのスイッチに接続します.
158 159 160 161 162 |
# File 'lib/saklient/cloud/resources/iface.rb', line 158 def connect_to_swytch_by_id(swytchId) Saklient::Util::validate_type(swytchId, 'String') @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/to/switch/' + swytchId) return reload end |
#disconnect_from_swytch ⇒ Iface
スイッチから切断します.
175 176 177 178 |
# File 'lib/saklient/cloud/resources/iface.rb', line 175 def disconnect_from_swytch @_client.request('DELETE', _api_path + '/' + Saklient::Util::url_encode(_id) + '/to/switch') return reload end |
#find_swytch ⇒ Swytch
接続先のスイッチを取得します.
183 184 185 186 |
# File 'lib/saklient/cloud/resources/iface.rb', line 183 def find_swytch model = Saklient::Util::create_class_instance('saklient.cloud.models.Model_Swytch', [@_client]) return model.get_by_id(self.swytch_id) end |
#get_activity ⇒ IfaceActivity
107 108 109 |
# File 'lib/saklient/cloud/resources/iface.rb', line 107 def get_activity return @_activity end |
#reload ⇒ Iface
最新のリソース情報を再取得します.
93 94 95 |
# File 'lib/saklient/cloud/resources/iface.rb', line 93 def reload return _reload end |
#save ⇒ Iface
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
86 87 88 |
# File 'lib/saklient/cloud/resources/iface.rb', line 86 def save return _save end |