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

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ CloudInit

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.


1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
# File 'lib/ovirtsdk4/types.rb', line 1954

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

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.


1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
# File 'lib/ovirtsdk4/types.rb', line 1968

def ==(other)
  super &&
  @authorized_keys == other.authorized_keys &&
  @files == other.files &&
  @host == other.host &&
  @network_configuration == other.network_configuration &&
  @regenerate_ssh_keys == other.regenerate_ssh_keys &&
  @timezone == other.timezone &&
  @users == other.users
end

#authorized_keysArray<AuthorizedKey>

Returns the value of the authorized_keys attribute.

Returns:


1773
1774
1775
# File 'lib/ovirtsdk4/types.rb', line 1773

def authorized_keys
  @authorized_keys
end

#authorized_keys=(list) ⇒ Object

Sets the value of the authorized_keys attribute.

Parameters:


1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
# File 'lib/ovirtsdk4/types.rb', line 1782

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

#filesArray<File>

Returns the value of the files attribute.

Returns:


1799
1800
1801
# File 'lib/ovirtsdk4/types.rb', line 1799

def files
  @files
end

#files=(list) ⇒ Object

Sets the value of the files attribute.

Parameters:

  • list (Array<File>)

1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
# File 'lib/ovirtsdk4/types.rb', line 1808

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

#hashObject

Generates a hash value for this object.


1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
# File 'lib/ovirtsdk4/types.rb', line 1982

def hash
  super +
  @authorized_keys.hash +
  @files.hash +
  @host.hash +
  @network_configuration.hash +
  @regenerate_ssh_keys.hash +
  @timezone.hash +
  @users.hash
end

#hostHost

Returns the value of the host attribute.

Returns:


1825
1826
1827
# File 'lib/ovirtsdk4/types.rb', line 1825

def host
  @host
end

#host=(value) ⇒ Object

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)

1838
1839
1840
1841
1842
1843
# File 'lib/ovirtsdk4/types.rb', line 1838

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

#network_configurationNetworkConfiguration

Returns the value of the network_configuration attribute.


1850
1851
1852
# File 'lib/ovirtsdk4/types.rb', line 1850

def network_configuration
  @network_configuration
end

#network_configuration=(value) ⇒ Object

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:


1863
1864
1865
1866
1867
1868
# File 'lib/ovirtsdk4/types.rb', line 1863

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

#regenerate_ssh_keysBoolean

Returns the value of the regenerate_ssh_keys attribute.

Returns:

  • (Boolean)

1875
1876
1877
# File 'lib/ovirtsdk4/types.rb', line 1875

def regenerate_ssh_keys
  @regenerate_ssh_keys
end

#regenerate_ssh_keys=(value) ⇒ Object

Sets the value of the regenerate_ssh_keys attribute.

Parameters:

  • value (Boolean)

1884
1885
1886
# File 'lib/ovirtsdk4/types.rb', line 1884

def regenerate_ssh_keys=(value)
  @regenerate_ssh_keys = value
end

#timezoneString

Returns the value of the timezone attribute.

Returns:

  • (String)

1893
1894
1895
# File 'lib/ovirtsdk4/types.rb', line 1893

def timezone
  @timezone
end

#timezone=(value) ⇒ Object

Sets the value of the timezone attribute.

Parameters:

  • value (String)

1902
1903
1904
# File 'lib/ovirtsdk4/types.rb', line 1902

def timezone=(value)
  @timezone = value
end

#usersArray<User>

Returns the value of the users attribute.

Returns:


1911
1912
1913
# File 'lib/ovirtsdk4/types.rb', line 1911

def users
  @users
end

#users=(list) ⇒ Object

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)

1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
# File 'lib/ovirtsdk4/types.rb', line 1920

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