Class: Saklient::Cloud::Resources::Archive
- Inherits:
-
Resource
- Object
- Resource
- Saklient::Cloud::Resources::Archive
- Defined in:
- lib/saklient/cloud/resources/archive.rb
Overview
アーカイブの実体1つに対応し, 属性の取得や操作を行うためのクラス.
Instance Attribute Summary (collapse)
-
- (String) availability
readonly
有効状態 Enums::EAvailability.
-
- (String) description
説明.
-
- (Fixnum) display_order
表示順序.
-
- (FtpInfo) ftp_info
readonly
FTP情報.
-
- (Icon) icon
アイコン.
-
- (String) id
readonly
ID.
-
- (bool) is_available
readonly
ディスクが利用可能なときtrueを返します.
-
- (String) name
名前.
-
- (DiskPlan) plan
readonly
プラン.
-
- (String) scope
readonly
スコープ Enums::EScope.
-
- (String) service_class
readonly
サービスクラス.
-
- (Fixnum) size_gib
サイズ.
-
- (Fixnum) size_mib
サイズ.
-
- (Resource) source
アーカイブのコピー元.
-
- (Array<String>) tags
タグ文字列の配列.
Instance Method Summary (collapse)
-
- (Archive) close_ftp
FTPSを終了し, アーカイブを利用可能な状態にします.
-
- (Archive) open_ftp(reset = false)
FTPSを開始し, イメージファイルをアップロード・ダウンロードできる状態にします.
-
- (Archive) reload
最新のリソース情報を再取得します.
-
- (Archive) save
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
-
- (bool) sleep_while_copying(timeoutSec = 3600)
コピー中のアーカイブが利用可能になるまで待機します.
Instance Attribute Details
- (String) availability (readonly)
有効状態 Enums::EAvailability
708 709 710 |
# File 'lib/saklient/cloud/resources/archive.rb', line 708 def availability @availability end |
- (String) description
説明
470 471 472 |
# File 'lib/saklient/cloud/resources/archive.rb', line 470 def description @description end |
- (Fixnum) display_order
表示順序
591 592 593 |
# File 'lib/saklient/cloud/resources/archive.rb', line 591 def display_order @display_order end |
- (FtpInfo) ftp_info (readonly)
FTP情報
242 243 244 |
# File 'lib/saklient/cloud/resources/archive.rb', line 242 def ftp_info @ftp_info end |
- (Icon) icon
アイコン
551 552 553 |
# File 'lib/saklient/cloud/resources/archive.rb', line 551 def icon @icon end |
- (String) id (readonly)
ID
370 371 372 |
# File 'lib/saklient/cloud/resources/archive.rb', line 370 def id @id end |
- (bool) is_available (readonly)
ディスクが利用可能なときtrueを返します.
150 151 152 |
# File 'lib/saklient/cloud/resources/archive.rb', line 150 def is_available @is_available end |
- (String) name
名前
430 431 432 |
# File 'lib/saklient/cloud/resources/archive.rb', line 430 def name @name end |
- (DiskPlan) plan (readonly)
プラン
684 685 686 |
# File 'lib/saklient/cloud/resources/archive.rb', line 684 def plan @plan end |
- (String) scope (readonly)
スコープ Enums::EScope
394 395 396 |
# File 'lib/saklient/cloud/resources/archive.rb', line 394 def scope @scope end |
- (String) service_class (readonly)
サービスクラス
660 661 662 |
# File 'lib/saklient/cloud/resources/archive.rb', line 660 def service_class @service_class end |
- (Fixnum) size_gib
179 180 181 |
# File 'lib/saklient/cloud/resources/archive.rb', line 179 def size_gib @size_gib end |
- (Fixnum) size_mib
632 633 634 |
# File 'lib/saklient/cloud/resources/archive.rb', line 632 def size_mib @size_mib end |
- (Resource) source
アーカイブのコピー元
215 216 217 |
# File 'lib/saklient/cloud/resources/archive.rb', line 215 def source @source end |
- (Array<String>) tags
タグ文字列の配列
511 512 513 |
# File 'lib/saklient/cloud/resources/archive.rb', line 511 def @tags end |
Instance Method Details
- (Archive) close_ftp
FTPSを終了し, アーカイブを利用可能な状態にします.
323 324 325 326 327 328 |
# File 'lib/saklient/cloud/resources/archive.rb', line 323 def close_ftp path = _api_path + '/' + Saklient::Util::url_encode(_id) + '/ftp' @_client.request('DELETE', path) @_ftp_info = nil return self end |
- (Archive) open_ftp(reset = false)
FTPSを開始し, イメージファイルをアップロード・ダウンロードできる状態にします.
アカウント情報は, ftpInfo プロパティから取得することができます.
310 311 312 313 314 315 316 317 318 |
# File 'lib/saklient/cloud/resources/archive.rb', line 310 def open_ftp(reset = false) Saklient::Util::validate_type(reset, 'bool') path = _api_path + '/' + Saklient::Util::url_encode(_id) + '/ftp' q = {} Saklient::Util::set_by_path(q, 'ChangePassword', reset) result = @_client.request('PUT', path, q) _on_after_api_deserialize(nil, result) return self end |
- (Archive) reload
最新のリソース情報を再取得します.
122 123 124 |
# File 'lib/saklient/cloud/resources/archive.rb', line 122 def reload return _reload end |
- (Archive) save
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
115 116 117 |
# File 'lib/saklient/cloud/resources/archive.rb', line 115 def save return _save end |
- (bool) sleep_while_copying(timeoutSec = 3600)
コピー中のアーカイブが利用可能になるまで待機します.
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/saklient/cloud/resources/archive.rb', line 334 def (timeoutSec = 3600) Saklient::Util::validate_type(timeoutSec, 'Fixnum') step = 3 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 |