Class: Saklient::Cloud::Resources::DiskConfig
- Inherits:
-
Object
- Object
- Saklient::Cloud::Resources::DiskConfig
- Defined in:
- lib/saklient/cloud/resources/disk_config.rb
Overview
ディスク修正のパラメータ.
Instance Attribute Summary (collapse)
-
- (String) default_route
デフォルトルート.
-
- (String) host_name
ホスト名.
-
- (String) ip_address
IPアドレス.
-
- (Fixnum) network_mask_len
ネットワークマスク長.
-
- (String) password
ログインパスワード.
-
- (Array<Script>) scripts
readonly
スタートアップスクリプト Script の配列(pushによりスクリプトを追加できます).
-
- (String) ssh_key
SSHキー.
-
- (Array<String>) ssh_keys
readonly
SSHキー.
Instance Method Summary (collapse)
-
- (DiskConfig) add_script(script)
スタートアップスクリプトを追加します.
-
- (DiskConfig) write
修正内容を実際のディスクに書き込みます.
Instance Attribute Details
- (String) default_route
デフォルトルート
250 251 252 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 250 def default_route @default_route end |
- (String) host_name
ホスト名
86 87 88 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 86 def host_name @host_name end |
- (String) ip_address
IPアドレス
214 215 216 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 214 def ip_address @ip_address end |
- (Fixnum) network_mask_len
ネットワークマスク長
286 287 288 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 286 def network_mask_len @network_mask_len end |
- (String) password
ログインパスワード
122 123 124 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 122 def password @password end |
- (Array<Script>) scripts (readonly)
スタートアップスクリプト Script の配列(pushによりスクリプトを追加できます)
313 314 315 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 313 def scripts @scripts end |
- (String) ssh_key
SSHキー
169 170 171 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 169 def ssh_key @ssh_key end |
- (Array<String>) ssh_keys (readonly)
SSHキー
182 183 184 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 182 def ssh_keys @ssh_keys end |
Instance Method Details
- (DiskConfig) add_script(script)
スタートアップスクリプトを追加します.
diskConfig.addScript(script) と diskConfig.scripts.push(script) の効果は同等です.
342 343 344 345 346 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 342 def add_script(script) Saklient::Util::validate_type(script, 'Saklient::Cloud::Resources::Script') @_scripts << script return self end |
- (DiskConfig) write
修正内容を実際のディスクに書き込みます.
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/saklient/cloud/resources/disk_config.rb', line 351 def write q = {} Saklient::Util::set_by_path(q, 'HostName', @_host_name) if !(@_host_name).nil? Saklient::Util::set_by_path(q, 'Password', @_password) if !(@_password).nil? Saklient::Util::set_by_path(q, 'SSHKey.PublicKey', @_ssh_keys.join("\n")) if @_ssh_keys.length > 0 Saklient::Util::set_by_path(q, 'UserIPAddress', @_ip_address) if !(@_ip_address).nil? Saklient::Util::set_by_path(q, 'UserSubnet.DefaultRoute', @_default_route) if !(@_default_route).nil? Saklient::Util::set_by_path(q, 'UserSubnet.NetworkMaskLen', @_network_mask_len) if !(@_network_mask_len).nil? if 0 < @_scripts.length notes = [] for script in @_scripts notes << { ID: script._id } end Saklient::Util::set_by_path(q, 'Notes', notes) end path = '/disk/' + @_disk_id + '/config' @_client.request('PUT', path, q) return self end |