Class: Saklient::Cloud::Resources::Appliance
- Inherits:
-
Resource
- Object
- Resource
- Saklient::Cloud::Resources::Appliance
- Defined in:
- lib/saklient/cloud/resources/appliance.rb
Overview
アプライアンスの実体1つに対応し, 属性の取得や操作を行うためのクラス.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (String) availability
readonly
有効状態 Enums::EAvailability.
- - (String) clazz
-
- (String) description
説明.
-
- (Icon) icon
アイコン.
-
- (String) id
readonly
ID.
-
- (Array<Iface>) ifaces
readonly
インタフェース Iface の配列.
-
- (String) name
名前.
-
- (Fixnum) plan_id
プラン.
-
- (any) raw_annotation
注釈.
-
- (any) raw_settings
設定の生データ.
-
- (String) service_class
readonly
サービスクラス.
- - (String) status readonly
-
- (String) swytch_id
readonly
接続先スイッチID.
-
- (Array<String>) tags
タグ文字列の配列.
Instance Method Summary (collapse)
-
- (Appliance) apply
アプライアンスの設定を反映します.
-
- (Appliance) boot
アプライアンスを起動します.
-
- (Swytch) get_swytch
このルータが接続されているスイッチを取得します.
-
- (Appliance) reboot
アプライアンスを強制再起動します.
-
- (Appliance) reload
最新のリソース情報を再取得します.
-
- (Appliance) save
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
-
- (Appliance) shutdown
アプライアンスをシャットダウンします.
-
- (bool) sleep_until_down(timeoutSec = 600)
アプライアンスが停止するまで待機します.
-
- (bool) sleep_until_up(timeoutSec = 600)
アプライアンスが起動するまで待機します.
-
- (bool) sleep_while_creating(timeoutSec = 600)
作成中のアプライアンスが利用可能になるまで待機します.
-
- (Appliance) stop
アプライアンスを強制停止します.
Instance Attribute Details
- (String) availability (readonly)
有効状態 Enums::EAvailability
742 743 744 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 742 def availability @availability end |
- (String) clazz
337 338 339 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 337 def clazz @clazz end |
- (String) description
説明
417 418 419 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 417 def description @description end |
- (Icon) icon
アイコン
498 499 500 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 498 def icon @icon end |
- (String) id (readonly)
ID
300 301 302 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 300 def id @id end |
- (Array<Iface>) ifaces (readonly)
インタフェース Iface の配列
567 568 569 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 567 def ifaces @ifaces end |
- (String) name
名前
377 378 379 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 377 def name @name end |
- (Fixnum) plan_id
プラン
539 540 541 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 539 def plan_id @plan_id end |
- (any) raw_annotation
注釈
603 604 605 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 603 def raw_annotation @raw_annotation end |
- (any) raw_settings
設定の生データ
643 644 645 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 643 def raw_settings @raw_settings end |
- (String) service_class (readonly)
サービスクラス
718 719 720 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 718 def service_class @service_class end |
- (String) status (readonly)
694 695 696 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 694 def status @status end |
- (String) swytch_id (readonly)
接続先スイッチID
766 767 768 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 766 def swytch_id @swytch_id end |
- (Array<String>) tags
タグ文字列の配列
458 459 460 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 458 def @tags end |
Instance Method Details
- (Appliance) apply
アプライアンスの設定を反映します.
180 181 182 183 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 180 def apply @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/config') return self end |
- (Appliance) boot
アプライアンスを起動します.
188 189 190 191 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 188 def boot @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/power') return self end |
- (Swytch) get_swytch
このルータが接続されているスイッチを取得します.
171 172 173 174 175 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 171 def get_swytch model = Saklient::Util::create_class_instance('saklient.cloud.models.Model_Swytch', [@_client]) id = get_swytch_id return model.get_by_id(id) end |
- (Appliance) reboot
アプライアンスを強制再起動します.
212 213 214 215 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 212 def reboot @_client.request('PUT', _api_path + '/' + Saklient::Util::url_encode(_id) + '/reset') return self end |
- (Appliance) reload
最新のリソース情報を再取得します.
142 143 144 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 142 def reload return _reload end |
- (Appliance) save
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
135 136 137 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 135 def save return _save end |
- (Appliance) shutdown
アプライアンスをシャットダウンします.
196 197 198 199 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 196 def shutdown @_client.request('DELETE', _api_path + '/' + Saklient::Util::url_encode(_id) + '/power') return self end |
- (bool) sleep_until_down(timeoutSec = 600)
アプライアンスが停止するまで待機します.
252 253 254 255 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 252 def sleep_until_down(timeoutSec = 600) Saklient::Util::validate_type(timeoutSec, 'Fixnum') return sleep_until(Saklient::Cloud::Enums::EServerInstanceStatus::down, timeoutSec) end |
- (bool) sleep_until_up(timeoutSec = 600)
アプライアンスが起動するまで待機します.
243 244 245 246 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 243 def sleep_until_up(timeoutSec = 600) Saklient::Util::validate_type(timeoutSec, 'Fixnum') return sleep_until(Saklient::Cloud::Enums::EServerInstanceStatus::up, timeoutSec) end |
- (bool) sleep_while_creating(timeoutSec = 600)
作成中のアプライアンスが利用可能になるまで待機します.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 221 def sleep_while_creating(timeoutSec = 600) Saklient::Util::validate_type(timeoutSec, 'Fixnum') step = 10 while 0 < timeoutSec do begin reload rescue Saklient::Errors::HttpException {} end a = get_availability return true if a == Saklient::Cloud::Enums::EAvailability::available timeoutSec = 0 if a != Saklient::Cloud::Enums::EAvailability:: timeoutSec -= step sleep(step) if 0 < timeoutSec end return false end |
- (Appliance) stop
アプライアンスを強制停止します.
204 205 206 207 |
# File 'lib/saklient/cloud/resources/appliance.rb', line 204 def stop @_client.request('DELETE', _api_path + '/' + Saklient::Util::url_encode(_id) + '/power', { Force: true }) return self end |