class OvirtSDK4::SystemService

Public Class Methods

new(connection, path) click to toggle source

Creates a new implementation of the service.

@param connection [Connection] The connection to be used by this service.

@param path [String] The relative path of this service, for example `vms/123/disks`.

@api private

# File lib/ovirtsdk4/services.rb, line 24770
def initialize(connection, path)
  @connection = connection
  @path = path
end

Public Instance Methods

affinity_labels_service() click to toggle source

List all known affinity labels.

@return [AffinityLabelsService] A reference to `affinity_labels` service.

# File lib/ovirtsdk4/services.rb, line 24909
def affinity_labels_service
  AffinityLabelsService.new(@connection, "#{@path}/affinitylabels")
end
bookmarks_service() click to toggle source

Locates the `bookmarks` service.

@return [BookmarksService] A reference to `bookmarks` service.

# File lib/ovirtsdk4/services.rb, line 24918
def bookmarks_service
  BookmarksService.new(@connection, "#{@path}/bookmarks")
end
cluster_levels_service() click to toggle source

Reference to the service that provides information about the cluster levels supported by the system.

@return [ClusterLevelsService] A reference to `cluster_levels` service.

# File lib/ovirtsdk4/services.rb, line 24927
def cluster_levels_service
  ClusterLevelsService.new(@connection, "#{@path}/clusterlevels")
end
clusters_service() click to toggle source

Locates the `clusters` service.

@return [ClustersService] A reference to `clusters` service.

# File lib/ovirtsdk4/services.rb, line 24936
def clusters_service
  ClustersService.new(@connection, "#{@path}/clusters")
end
cpu_profiles_service() click to toggle source

Locates the `cpu_profiles` service.

@return [CpuProfilesService] A reference to `cpu_profiles` service.

# File lib/ovirtsdk4/services.rb, line 24945
def cpu_profiles_service
  CpuProfilesService.new(@connection, "#{@path}/cpuprofiles")
end
data_centers_service() click to toggle source

Locates the `data_centers` service.

@return [DataCentersService] A reference to `data_centers` service.

# File lib/ovirtsdk4/services.rb, line 24954
def data_centers_service
  DataCentersService.new(@connection, "#{@path}/datacenters")
end
disk_profiles_service() click to toggle source

Locates the `disk_profiles` service.

@return [DiskProfilesService] A reference to `disk_profiles` service.

# File lib/ovirtsdk4/services.rb, line 24963
def disk_profiles_service
  DiskProfilesService.new(@connection, "#{@path}/diskprofiles")
end
disks_service() click to toggle source

Locates the `disks` service.

@return [DisksService] A reference to `disks` service.

# File lib/ovirtsdk4/services.rb, line 24972
def disks_service
  DisksService.new(@connection, "#{@path}/disks")
end
domains_service() click to toggle source

Locates the `domains` service.

@return [DomainsService] A reference to `domains` service.

# File lib/ovirtsdk4/services.rb, line 24981
def domains_service
  DomainsService.new(@connection, "#{@path}/domains")
end
events_service() click to toggle source

Locates the `events` service.

@return [EventsService] A reference to `events` service.

# File lib/ovirtsdk4/services.rb, line 24990
def events_service
  EventsService.new(@connection, "#{@path}/events")
end
external_host_providers_service() click to toggle source

Locates the `external_host_providers` service.

@return [ExternalHostProvidersService] A reference to `external_host_providers` service.

# File lib/ovirtsdk4/services.rb, line 24999
def external_host_providers_service
  ExternalHostProvidersService.new(@connection, "#{@path}/externalhostproviders")
end
external_vm_imports_service() click to toggle source

Reference to service facilitating import of external virtual machines.

@return [ExternalVmImportsService] A reference to `external_vm_imports` service.

# File lib/ovirtsdk4/services.rb, line 25008
def external_vm_imports_service
  ExternalVmImportsService.new(@connection, "#{@path}/externalvmimports")
end
get(opts = {}) click to toggle source

Returns basic information describing the API, like the product name, the version number and a summary of the number of relevant objects.

source

GET /ovirt-engine/api


We get following response:

source,xml

<api>

<link rel="capabilities" href="/api/capabilities"/>
<link rel="clusters" href="/api/clusters"/>
<link rel="clusters/search" href="/api/clusters?search={query}"/>
<link rel="datacenters" href="/api/datacenters"/>
<link rel="datacenters/search" href="/api/datacenters?search={query}"/>
<link rel="events" href="/api/events"/>
<link rel="events/search" href="/api/events?search={query}"/>
<link rel="hosts" href="/api/hosts"/>
<link rel="hosts/search" href="/api/hosts?search={query}"/>
<link rel="networks" href="/api/networks"/>
<link rel="roles" href="/api/roles"/>
<link rel="storagedomains" href="/api/storagedomains"/>
<link rel="storagedomains/search" href="/api/storagedomains?search={query}"/>
<link rel="tags" href="/api/tags"/>
<link rel="templates" href="/api/templates"/>
<link rel="templates/search" href="/api/templates?search={query}"/>
<link rel="users" href="/api/users"/>
<link rel="groups" href="/api/groups"/>
<link rel="domains" href="/api/domains"/>
<link rel="vmpools" href="/api/vmpools"/>
<link rel="vmpools/search" href="/api/vmpools?search={query}"/>
<link rel="vms" href="/api/vms"/>
<link rel="vms/search" href="/api/vms?search={query}"/>
<product_info>
  <name>oVirt Engine</name>
  <vendor>ovirt.org</vendor>
  <version>
    <build>4</build>
    <full_version>4.0.4</full_version>
    <major>4</major>
    <minor>0</minor>
    <revision>0</revision>
  </version>
</product_info>
<special_objects>
  <blank_template href="/ovirt-engine/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
  <root_tag href="/ovirt-engine/api/tags/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
</special_objects>
<summary>
  <hosts>
    <active>0</active>
    <total>0</total>
  </hosts>
  <storage_domains>
    <active>0</active>
    <total>1</total>
  </storage_domains>
  <users>
    <active>1</active>
    <total>1</total>
  </users>
  <vms>
    <active>0</active>
    <total>0</total>
  </vms>
</summary>
<time>2016-09-14T12:00:48.132+02:00</time>

</api>


The entry point provides a user with links to the collections in a virtualization environment. The `rel` attribute of each collection link provides a reference point for each link.

The entry point also contains other data such as `product_info`, `special_objects` and `summary`.

@param opts [Hash] Additional options.

@return [Api]

# File lib/ovirtsdk4/services.rb, line 24860
def get(opts = {})
  query = {}
  request = HttpRequest.new(method: :GET, url: @path, query: query)
  response = @connection.send(request)
  case response.code
  when 200
    begin
      reader = XmlReader.new(response.body)
      return ApiReader.read_one(reader)
    ensure
      reader.close
    end
  else
    check_fault(response)
  end
end
groups_service() click to toggle source

Locates the `groups` service.

@return [GroupsService] A reference to `groups` service.

# File lib/ovirtsdk4/services.rb, line 25017
def groups_service
  GroupsService.new(@connection, "#{@path}/groups")
end
hosts_service() click to toggle source

Locates the `hosts` service.

@return [HostsService] A reference to `hosts` service.

# File lib/ovirtsdk4/services.rb, line 25026
def hosts_service
  HostsService.new(@connection, "#{@path}/hosts")
end
icons_service() click to toggle source

Locates the `icons` service.

@return [IconsService] A reference to `icons` service.

# File lib/ovirtsdk4/services.rb, line 25035
def icons_service
  IconsService.new(@connection, "#{@path}/icons")
end
image_transfers_service() click to toggle source

List of all image transfers being performed for image I/O in oVirt.

@return [ImageTransfersService] A reference to `image_transfers` service.

# File lib/ovirtsdk4/services.rb, line 25044
def image_transfers_service
  ImageTransfersService.new(@connection, "#{@path}/imagetransfers")
end
instance_types_service() click to toggle source

Locates the `instance_types` service.

@return [InstanceTypesService] A reference to `instance_types` service.

# File lib/ovirtsdk4/services.rb, line 25053
def instance_types_service
  InstanceTypesService.new(@connection, "#{@path}/instancetypes")
end
jobs_service() click to toggle source

List all the jobs monitored by the engine.

@return [JobsService] A reference to `jobs` service.

# File lib/ovirtsdk4/services.rb, line 25062
def jobs_service
  JobsService.new(@connection, "#{@path}/jobs")
end
katello_errata_service() click to toggle source

List the available Katello errata assigned to the engine.

@return [EngineKatelloErrataService] A reference to `katello_errata` service.

# File lib/ovirtsdk4/services.rb, line 25071
def katello_errata_service
  EngineKatelloErrataService.new(@connection, "#{@path}/katelloerrata")
end
mac_pools_service() click to toggle source

Locates the `mac_pools` service.

@return [MacPoolsService] A reference to `mac_pools` service.

# File lib/ovirtsdk4/services.rb, line 25080
def mac_pools_service
  MacPoolsService.new(@connection, "#{@path}/macpools")
end
network_filters_service() click to toggle source

Network filters will enhance the admin ability to manage the network packets traffic from/to the participated VMs.

@return [NetworkFiltersService] A reference to `network_filters` service.

# File lib/ovirtsdk4/services.rb, line 25090
def network_filters_service
  NetworkFiltersService.new(@connection, "#{@path}/networkfilters")
end
networks_service() click to toggle source

Locates the `networks` service.

@return [NetworksService] A reference to `networks` service.

# File lib/ovirtsdk4/services.rb, line 25099
def networks_service
  NetworksService.new(@connection, "#{@path}/networks")
end
openstack_image_providers_service() click to toggle source

Locates the `openstack_image_providers` service.

@return [OpenstackImageProvidersService] A reference to `openstack_image_providers` service.

# File lib/ovirtsdk4/services.rb, line 25108
def openstack_image_providers_service
  OpenstackImageProvidersService.new(@connection, "#{@path}/openstackimageproviders")
end
openstack_network_providers_service() click to toggle source

Locates the `openstack_network_providers` service.

@return [OpenstackNetworkProvidersService] A reference to `openstack_network_providers` service.

# File lib/ovirtsdk4/services.rb, line 25117
def openstack_network_providers_service
  OpenstackNetworkProvidersService.new(@connection, "#{@path}/openstacknetworkproviders")
end
openstack_volume_providers_service() click to toggle source

Locates the `openstack_volume_providers` service.

@return [OpenstackVolumeProvidersService] A reference to `openstack_volume_providers` service.

# File lib/ovirtsdk4/services.rb, line 25126
def openstack_volume_providers_service
  OpenstackVolumeProvidersService.new(@connection, "#{@path}/openstackvolumeproviders")
end
operating_systems_service() click to toggle source

Locates the `operating_systems` service.

@return [OperatingSystemsService] A reference to `operating_systems` service.

# File lib/ovirtsdk4/services.rb, line 25135
def operating_systems_service
  OperatingSystemsService.new(@connection, "#{@path}/operatingsystems")
end
permissions_service() click to toggle source

Locates the `permissions` service.

@return [SystemPermissionsService] A reference to `permissions` service.

# File lib/ovirtsdk4/services.rb, line 25144
def permissions_service
  SystemPermissionsService.new(@connection, "#{@path}/permissions")
end
reload_configurations(opts = {}) click to toggle source

Executes the `reload_configurations` method.

@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the reload should be performed asynchronously.

# File lib/ovirtsdk4/services.rb, line 24884
def reload_configurations(opts = {})
  action = Action.new(opts)
  writer = XmlWriter.new(nil, true)
  ActionWriter.write_one(action, writer)
  body = writer.string
  writer.close
  request = HttpRequest.new(
    method: :POST,
    url: "#{@path}/reloadconfigurations",
    body: body
  )
  response = @connection.send(request)
  case response.code
  when 200
    action = check_action(response)
  else
    check_action(response)
  end
end
roles_service() click to toggle source

Locates the `roles` service.

@return [RolesService] A reference to `roles` service.

# File lib/ovirtsdk4/services.rb, line 25153
def roles_service
  RolesService.new(@connection, "#{@path}/roles")
end
scheduling_policies_service() click to toggle source

Locates the `scheduling_policies` service.

@return [SchedulingPoliciesService] A reference to `scheduling_policies` service.

# File lib/ovirtsdk4/services.rb, line 25162
def scheduling_policies_service
  SchedulingPoliciesService.new(@connection, "#{@path}/schedulingpolicies")
end
scheduling_policy_units_service() click to toggle source

Locates the `scheduling_policy_units` service.

@return [SchedulingPolicyUnitsService] A reference to `scheduling_policy_units` service.

# File lib/ovirtsdk4/services.rb, line 25171
def scheduling_policy_units_service
  SchedulingPolicyUnitsService.new(@connection, "#{@path}/schedulingpolicyunits")
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 25254
def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'affinitylabels'
    return affinity_labels_service
  end
  if path.start_with?('affinitylabels/')
    return affinity_labels_service.service(path[15..-1])
  end
  if path == 'bookmarks'
    return bookmarks_service
  end
  if path.start_with?('bookmarks/')
    return bookmarks_service.service(path[10..-1])
  end
  if path == 'clusterlevels'
    return cluster_levels_service
  end
  if path.start_with?('clusterlevels/')
    return cluster_levels_service.service(path[14..-1])
  end
  if path == 'clusters'
    return clusters_service
  end
  if path.start_with?('clusters/')
    return clusters_service.service(path[9..-1])
  end
  if path == 'cpuprofiles'
    return cpu_profiles_service
  end
  if path.start_with?('cpuprofiles/')
    return cpu_profiles_service.service(path[12..-1])
  end
  if path == 'datacenters'
    return data_centers_service
  end
  if path.start_with?('datacenters/')
    return data_centers_service.service(path[12..-1])
  end
  if path == 'diskprofiles'
    return disk_profiles_service
  end
  if path.start_with?('diskprofiles/')
    return disk_profiles_service.service(path[13..-1])
  end
  if path == 'disks'
    return disks_service
  end
  if path.start_with?('disks/')
    return disks_service.service(path[6..-1])
  end
  if path == 'domains'
    return domains_service
  end
  if path.start_with?('domains/')
    return domains_service.service(path[8..-1])
  end
  if path == 'events'
    return events_service
  end
  if path.start_with?('events/')
    return events_service.service(path[7..-1])
  end
  if path == 'externalhostproviders'
    return external_host_providers_service
  end
  if path.start_with?('externalhostproviders/')
    return external_host_providers_service.service(path[22..-1])
  end
  if path == 'externalvmimports'
    return external_vm_imports_service
  end
  if path.start_with?('externalvmimports/')
    return external_vm_imports_service.service(path[18..-1])
  end
  if path == 'groups'
    return groups_service
  end
  if path.start_with?('groups/')
    return groups_service.service(path[7..-1])
  end
  if path == 'hosts'
    return hosts_service
  end
  if path.start_with?('hosts/')
    return hosts_service.service(path[6..-1])
  end
  if path == 'icons'
    return icons_service
  end
  if path.start_with?('icons/')
    return icons_service.service(path[6..-1])
  end
  if path == 'imagetransfers'
    return image_transfers_service
  end
  if path.start_with?('imagetransfers/')
    return image_transfers_service.service(path[15..-1])
  end
  if path == 'instancetypes'
    return instance_types_service
  end
  if path.start_with?('instancetypes/')
    return instance_types_service.service(path[14..-1])
  end
  if path == 'jobs'
    return jobs_service
  end
  if path.start_with?('jobs/')
    return jobs_service.service(path[5..-1])
  end
  if path == 'katelloerrata'
    return katello_errata_service
  end
  if path.start_with?('katelloerrata/')
    return katello_errata_service.service(path[14..-1])
  end
  if path == 'macpools'
    return mac_pools_service
  end
  if path.start_with?('macpools/')
    return mac_pools_service.service(path[9..-1])
  end
  if path == 'networkfilters'
    return network_filters_service
  end
  if path.start_with?('networkfilters/')
    return network_filters_service.service(path[15..-1])
  end
  if path == 'networks'
    return networks_service
  end
  if path.start_with?('networks/')
    return networks_service.service(path[9..-1])
  end
  if path == 'openstackimageproviders'
    return openstack_image_providers_service
  end
  if path.start_with?('openstackimageproviders/')
    return openstack_image_providers_service.service(path[24..-1])
  end
  if path == 'openstacknetworkproviders'
    return openstack_network_providers_service
  end
  if path.start_with?('openstacknetworkproviders/')
    return openstack_network_providers_service.service(path[26..-1])
  end
  if path == 'openstackvolumeproviders'
    return openstack_volume_providers_service
  end
  if path.start_with?('openstackvolumeproviders/')
    return openstack_volume_providers_service.service(path[25..-1])
  end
  if path == 'operatingsystems'
    return operating_systems_service
  end
  if path.start_with?('operatingsystems/')
    return operating_systems_service.service(path[17..-1])
  end
  if path == 'permissions'
    return permissions_service
  end
  if path.start_with?('permissions/')
    return permissions_service.service(path[12..-1])
  end
  if path == 'roles'
    return roles_service
  end
  if path.start_with?('roles/')
    return roles_service.service(path[6..-1])
  end
  if path == 'schedulingpolicies'
    return scheduling_policies_service
  end
  if path.start_with?('schedulingpolicies/')
    return scheduling_policies_service.service(path[19..-1])
  end
  if path == 'schedulingpolicyunits'
    return scheduling_policy_units_service
  end
  if path.start_with?('schedulingpolicyunits/')
    return scheduling_policy_units_service.service(path[22..-1])
  end
  if path == 'storageconnections'
    return storage_connections_service
  end
  if path.start_with?('storageconnections/')
    return storage_connections_service.service(path[19..-1])
  end
  if path == 'storagedomains'
    return storage_domains_service
  end
  if path.start_with?('storagedomains/')
    return storage_domains_service.service(path[15..-1])
  end
  if path == 'tags'
    return tags_service
  end
  if path.start_with?('tags/')
    return tags_service.service(path[5..-1])
  end
  if path == 'templates'
    return templates_service
  end
  if path.start_with?('templates/')
    return templates_service.service(path[10..-1])
  end
  if path == 'users'
    return users_service
  end
  if path.start_with?('users/')
    return users_service.service(path[6..-1])
  end
  if path == 'vmpools'
    return vm_pools_service
  end
  if path.start_with?('vmpools/')
    return vm_pools_service.service(path[8..-1])
  end
  if path == 'vms'
    return vms_service
  end
  if path.start_with?('vms/')
    return vms_service.service(path[4..-1])
  end
  if path == 'vnicprofiles'
    return vnic_profiles_service
  end
  if path.start_with?('vnicprofiles/')
    return vnic_profiles_service.service(path[13..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end
storage_connections_service() click to toggle source

Locates the `storage_connections` service.

@return [StorageServerConnectionsService] A reference to `storage_connections` service.

# File lib/ovirtsdk4/services.rb, line 25180
def storage_connections_service
  StorageServerConnectionsService.new(@connection, "#{@path}/storageconnections")
end
storage_domains_service() click to toggle source

Locates the `storage_domains` service.

@return [StorageDomainsService] A reference to `storage_domains` service.

# File lib/ovirtsdk4/services.rb, line 25189
def storage_domains_service
  StorageDomainsService.new(@connection, "#{@path}/storagedomains")
end
tags_service() click to toggle source

Locates the `tags` service.

@return [TagsService] A reference to `tags` service.

# File lib/ovirtsdk4/services.rb, line 25198
def tags_service
  TagsService.new(@connection, "#{@path}/tags")
end
templates_service() click to toggle source

Locates the `templates` service.

@return [TemplatesService] A reference to `templates` service.

# File lib/ovirtsdk4/services.rb, line 25207
def templates_service
  TemplatesService.new(@connection, "#{@path}/templates")
end
to_s() click to toggle source

Returns an string representation of this service.

@return [String]

# File lib/ovirtsdk4/services.rb, line 25494
def to_s
  "#<#{SystemService}:#{@path}>"
end
users_service() click to toggle source

Locates the `users` service.

@return [UsersService] A reference to `users` service.

# File lib/ovirtsdk4/services.rb, line 25216
def users_service
  UsersService.new(@connection, "#{@path}/users")
end
vm_pools_service() click to toggle source

Locates the `vm_pools` service.

@return [VmPoolsService] A reference to `vm_pools` service.

# File lib/ovirtsdk4/services.rb, line 25225
def vm_pools_service
  VmPoolsService.new(@connection, "#{@path}/vmpools")
end
vms_service() click to toggle source

Locates the `vms` service.

@return [VmsService] A reference to `vms` service.

# File lib/ovirtsdk4/services.rb, line 25234
def vms_service
  VmsService.new(@connection, "#{@path}/vms")
end
vnic_profiles_service() click to toggle source

Locates the `vnic_profiles` service.

@return [VnicProfilesService] A reference to `vnic_profiles` service.

# File lib/ovirtsdk4/services.rb, line 25243
def vnic_profiles_service
  VnicProfilesService.new(@connection, "#{@path}/vnicprofiles")
end