Class: OvirtSDK4::OpenStackSubnet

Inherits:
Identified 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 = {}) ⇒ OpenStackSubnet

Creates a new instance of the OvirtSDK4::OpenStackSubnet 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):

  • :cidr (String)

    The value of attribute cidr.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :dns_servers (Array<String>, Array<Hash>)

    The values of attribute dns_servers.

  • :gateway (String)

    The value of attribute gateway.

  • :id (String)

    The value of attribute id.

  • :ip_version (String)

    The value of attribute ip_version.

  • :name (String)

    The value of attribute name.

  • :openstack_network (OpenStackNetwork, Hash)

    The value of attribute openstack_network.


12401
12402
12403
12404
12405
12406
12407
12408
# File 'lib/ovirtsdk4/types.rb', line 12401

def initialize(opts = {})
  super(opts)
  self.cidr = opts[:cidr]
  self.dns_servers = opts[:dns_servers]
  self.gateway = opts[:gateway]
  self.ip_version = opts[:ip_version]
  self.openstack_network = opts[:openstack_network]
end

Instance Method Details

#==(other) ⇒ Object

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


12413
12414
12415
12416
12417
12418
12419
12420
# File 'lib/ovirtsdk4/types.rb', line 12413

def ==(other)
  super &&
  @cidr == other.cidr &&
  @dns_servers == other.dns_servers &&
  @gateway == other.gateway &&
  @ip_version == other.ip_version &&
  @openstack_network == other.openstack_network
end

#cidrString

Returns the value of the cidr attribute.

Returns:

  • (String)

12211
12212
12213
# File 'lib/ovirtsdk4/types.rb', line 12211

def cidr
  @cidr
end

#cidr=(value) ⇒ Object

Sets the value of the cidr attribute.

Parameters:

  • value (String)

12220
12221
12222
# File 'lib/ovirtsdk4/types.rb', line 12220

def cidr=(value)
  @cidr = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

12229
12230
12231
# File 'lib/ovirtsdk4/types.rb', line 12229

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

12238
12239
12240
# File 'lib/ovirtsdk4/types.rb', line 12238

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

12247
12248
12249
# File 'lib/ovirtsdk4/types.rb', line 12247

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

12256
12257
12258
# File 'lib/ovirtsdk4/types.rb', line 12256

def description=(value)
  @description = value
end

#dns_serversArray<String>

Returns the value of the dns_servers attribute.

Returns:

  • (Array<String>)

12265
12266
12267
# File 'lib/ovirtsdk4/types.rb', line 12265

def dns_servers
  @dns_servers
end

#dns_servers=(list) ⇒ Object

Sets the value of the dns_servers attribute.

Parameters:

  • list (Array<String>)

12274
12275
12276
# File 'lib/ovirtsdk4/types.rb', line 12274

def dns_servers=(list)
  @dns_servers = list
end

#gatewayString

Returns the value of the gateway attribute.

Returns:

  • (String)

12283
12284
12285
# File 'lib/ovirtsdk4/types.rb', line 12283

def gateway
  @gateway
end

#gateway=(value) ⇒ Object

Sets the value of the gateway attribute.

Parameters:

  • value (String)

12292
12293
12294
# File 'lib/ovirtsdk4/types.rb', line 12292

def gateway=(value)
  @gateway = value
end

#hashObject

Generates a hash value for this object.


12425
12426
12427
12428
12429
12430
12431
12432
# File 'lib/ovirtsdk4/types.rb', line 12425

def hash
  super +
  @cidr.hash +
  @dns_servers.hash +
  @gateway.hash +
  @ip_version.hash +
  @openstack_network.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

12301
12302
12303
# File 'lib/ovirtsdk4/types.rb', line 12301

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

12310
12311
12312
# File 'lib/ovirtsdk4/types.rb', line 12310

def id=(value)
  @id = value
end

#ip_versionString

Returns the value of the ip_version attribute.

Returns:

  • (String)

12319
12320
12321
# File 'lib/ovirtsdk4/types.rb', line 12319

def ip_version
  @ip_version
end

#ip_version=(value) ⇒ Object

Sets the value of the ip_version attribute.

Parameters:

  • value (String)

12328
12329
12330
# File 'lib/ovirtsdk4/types.rb', line 12328

def ip_version=(value)
  @ip_version = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

12337
12338
12339
# File 'lib/ovirtsdk4/types.rb', line 12337

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

12346
12347
12348
# File 'lib/ovirtsdk4/types.rb', line 12346

def name=(value)
  @name = value
end

#openstack_networkOpenStackNetwork

Returns the value of the openstack_network attribute.

Returns:


12355
12356
12357
# File 'lib/ovirtsdk4/types.rb', line 12355

def openstack_network
  @openstack_network
end

#openstack_network=(value) ⇒ Object

Sets the value of the openstack_network attribute.

The value parameter can be an instance of OvirtSDK4::OpenStackNetwork 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:


12368
12369
12370
12371
12372
12373
# File 'lib/ovirtsdk4/types.rb', line 12368

def openstack_network=(value)
  if value.is_a?(Hash)
    value = OpenStackNetwork.new(value)
  end
  @openstack_network = value
end