Class: OvirtSDK4::CloudInit

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (CloudInit) initialize(opts = {})

Creates a new instance of the OvirtSDK4::CloudInit class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :authorized_keys (Array<AuthorizedKey>, Array<Hash>)

    The values of attribute authorized_keys.

  • :files (Array<File>, Array<Hash>)

    The values of attribute files.

  • :host (Host, Hash)

    The value of attribute host.

  • :network_configuration (NetworkConfiguration, Hash)

    The value of attribute network_configuration.

  • :regenerate_ssh_keys (Boolean)

    The value of attribute regenerate_ssh_keys.

  • :timezone (String)

    The value of attribute timezone.

  • :users (Array<User>, Array<Hash>)

    The values of attribute users.



1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'lib/ovirtsdk4/types.rb', line 1460

def initialize(opts = {})
  super(opts)
  self.authorized_keys = opts[:authorized_keys]
  self.files = opts[:files]
  self.host = opts[:host]
  self.network_configuration = opts[:network_configuration]
  self.regenerate_ssh_keys = opts[:regenerate_ssh_keys]
  self.timezone = opts[:timezone]
  self.users = opts[:users]
end

Instance Method Details

- (Array<AuthorizedKey>) authorized_keys

Returns the value of the authorized_keys attribute.

Returns:



1282
1283
1284
# File 'lib/ovirtsdk4/types.rb', line 1282

def authorized_keys
  return @authorized_keys
end

- (Object) authorized_keys=(list)

Sets the value of the authorized_keys attribute.

Parameters:



1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'lib/ovirtsdk4/types.rb', line 1290

def authorized_keys=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = AuthorizedKey.new(value)
      end
    end
  end
  @authorized_keys = list
end

- (Array<File>) files

Returns the value of the files attribute.

Returns:



1307
1308
1309
# File 'lib/ovirtsdk4/types.rb', line 1307

def files
  return @files
end

- (Object) files=(list)

Sets the value of the files attribute.

Parameters:

  • list (Array<File>)


1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
# File 'lib/ovirtsdk4/types.rb', line 1315

def files=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = File.new(value)
      end
    end
  end
  @files = list
end

- (Host) host

Returns the value of the host attribute.

Returns:



1332
1333
1334
# File 'lib/ovirtsdk4/types.rb', line 1332

def host
  return @host
end

- (Object) host=(value)

Sets the value of the host attribute.

The value parameter can be an instance of Host or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Host, Hash)


1345
1346
1347
1348
1349
1350
# File 'lib/ovirtsdk4/types.rb', line 1345

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

- (NetworkConfiguration) network_configuration

Returns the value of the network_configuration attribute.



1357
1358
1359
# File 'lib/ovirtsdk4/types.rb', line 1357

def network_configuration
  return @network_configuration
end

- (Object) network_configuration=(value)

Sets the value of the network_configuration attribute.

The value parameter can be an instance of NetworkConfiguration or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



1370
1371
1372
1373
1374
1375
# File 'lib/ovirtsdk4/types.rb', line 1370

def network_configuration=(value)
  if value.is_a?(Hash)
    value = NetworkConfiguration.new(value)
  end
  @network_configuration = value
end

- (Boolean) regenerate_ssh_keys

Returns the value of the regenerate_ssh_keys attribute.

Returns:

  • (Boolean)


1382
1383
1384
# File 'lib/ovirtsdk4/types.rb', line 1382

def regenerate_ssh_keys
  return @regenerate_ssh_keys
end

- (Object) regenerate_ssh_keys=(value)

Sets the value of the regenerate_ssh_keys attribute.

Parameters:

  • value (Boolean)


1391
1392
1393
# File 'lib/ovirtsdk4/types.rb', line 1391

def regenerate_ssh_keys=(value)
  @regenerate_ssh_keys = value
end

- (String) timezone

Returns the value of the timezone attribute.

Returns:

  • (String)


1400
1401
1402
# File 'lib/ovirtsdk4/types.rb', line 1400

def timezone
  return @timezone
end

- (Object) timezone=(value)

Sets the value of the timezone attribute.

Parameters:

  • value (String)


1409
1410
1411
# File 'lib/ovirtsdk4/types.rb', line 1409

def timezone=(value)
  @timezone = value
end

- (Array<User>) users

Returns the value of the users attribute.

Returns:



1418
1419
1420
# File 'lib/ovirtsdk4/types.rb', line 1418

def users
  return @users
end

- (Object) users=(list)

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)


1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
# File 'lib/ovirtsdk4/types.rb', line 1426

def users=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = User.new(value)
      end
    end
  end
  @users = list
end