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 20285 def initialize(connection, path) @connection = connection @path = path end
List all known affinity labels.
@return [AffinityLabelsService] A reference to `affinity_labels` service.
# File lib/ovirtsdk4/services.rb, line 20342 def affinity_labels_service return AffinityLabelsService.new(@connection, "#{@path}/affinitylabels") end
Locates the `bookmarks` service.
@return [BookmarksService] A reference to `bookmarks` service.
# File lib/ovirtsdk4/services.rb, line 20350 def bookmarks_service return BookmarksService.new(@connection, "#{@path}/bookmarks") end
Locates the `clusters` service.
@return [ClustersService] A reference to `clusters` service.
# File lib/ovirtsdk4/services.rb, line 20358 def clusters_service return ClustersService.new(@connection, "#{@path}/clusters") end
Locates the `cpu_profiles` service.
@return [CpuProfilesService] A reference to `cpu_profiles` service.
# File lib/ovirtsdk4/services.rb, line 20366 def cpu_profiles_service return CpuProfilesService.new(@connection, "#{@path}/cpuprofiles") end
Locates the `data_centers` service.
@return [DataCentersService] A reference to `data_centers` service.
# File lib/ovirtsdk4/services.rb, line 20374 def data_centers_service return DataCentersService.new(@connection, "#{@path}/datacenters") end
Locates the `disk_profiles` service.
@return [DiskProfilesService] A reference to `disk_profiles` service.
# File lib/ovirtsdk4/services.rb, line 20382 def disk_profiles_service return DiskProfilesService.new(@connection, "#{@path}/diskprofiles") end
Locates the `disks` service.
@return [DisksService] A reference to `disks` service.
# File lib/ovirtsdk4/services.rb, line 20390 def disks_service return DisksService.new(@connection, "#{@path}/disks") end
Locates the `domains` service.
@return [DomainsService] A reference to `domains` service.
# File lib/ovirtsdk4/services.rb, line 20398 def domains_service return DomainsService.new(@connection, "#{@path}/domains") end
Locates the `events` service.
@return [EventsService] A reference to `events` service.
# File lib/ovirtsdk4/services.rb, line 20406 def events_service return EventsService.new(@connection, "#{@path}/events") end
Locates the `external_host_providers` service.
@return [ExternalHostProvidersService] A reference to `external_host_providers` service.
# File lib/ovirtsdk4/services.rb, line 20414 def external_host_providers_service return ExternalHostProvidersService.new(@connection, "#{@path}/externalhostproviders") end
Returns basic information describing the API, like the product name, the version number and a summary of the number of relevant objects.
@param opts [Hash] Additional options.
@return [Api]
# File lib/ovirtsdk4/services.rb, line 20298 def get(opts = {}) query = {} request = Request.new(:method => :GET, :path => @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
Locates the `groups` service.
@return [GroupsService] A reference to `groups` service.
# File lib/ovirtsdk4/services.rb, line 20422 def groups_service return GroupsService.new(@connection, "#{@path}/groups") end
Locates the `hosts` service.
@return [HostsService] A reference to `hosts` service.
# File lib/ovirtsdk4/services.rb, line 20430 def hosts_service return HostsService.new(@connection, "#{@path}/hosts") end
Locates the `icons` service.
@return [IconsService] A reference to `icons` service.
# File lib/ovirtsdk4/services.rb, line 20438 def icons_service return IconsService.new(@connection, "#{@path}/icons") end
Locates the `instance_types` service.
@return [InstanceTypesService] A reference to `instance_types` service.
# File lib/ovirtsdk4/services.rb, line 20446 def instance_types_service return InstanceTypesService.new(@connection, "#{@path}/instancetypes") end
Locates the `jobs` service.
@return [JobsService] A reference to `jobs` service.
# File lib/ovirtsdk4/services.rb, line 20454 def jobs_service return JobsService.new(@connection, "#{@path}/jobs") end
Locates the `katello_errata` service.
@return [EngineKatelloErrataService] A reference to `katello_errata` service.
# File lib/ovirtsdk4/services.rb, line 20462 def katello_errata_service return EngineKatelloErrataService.new(@connection, "#{@path}/katelloerrata") end
Locates the `mac_pools` service.
@return [MacPoolsService] A reference to `mac_pools` service.
# File lib/ovirtsdk4/services.rb, line 20470 def mac_pools_service return MacPoolsService.new(@connection, "#{@path}/macpools") end
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 20479 def network_filters_service return NetworkFiltersService.new(@connection, "#{@path}/networkfilters") end
Locates the `networks` service.
@return [NetworksService] A reference to `networks` service.
# File lib/ovirtsdk4/services.rb, line 20487 def networks_service return NetworksService.new(@connection, "#{@path}/networks") end
Locates the `openstack_image_providers` service.
@return [OpenstackImageProvidersService] A reference to `openstack_image_providers` service.
# File lib/ovirtsdk4/services.rb, line 20495 def openstack_image_providers_service return OpenstackImageProvidersService.new(@connection, "#{@path}/openstackimageproviders") end
Locates the `openstack_network_providers` service.
@return [OpenstackNetworkProvidersService] A reference to `openstack_network_providers` service.
# File lib/ovirtsdk4/services.rb, line 20503 def openstack_network_providers_service return OpenstackNetworkProvidersService.new(@connection, "#{@path}/openstacknetworkproviders") end
Locates the `openstack_volume_providers` service.
@return [OpenstackVolumeProvidersService] A reference to `openstack_volume_providers` service.
# File lib/ovirtsdk4/services.rb, line 20511 def openstack_volume_providers_service return OpenstackVolumeProvidersService.new(@connection, "#{@path}/openstackvolumeproviders") end
Locates the `operating_systems` service.
@return [OperatingSystemsService] A reference to `operating_systems` service.
# File lib/ovirtsdk4/services.rb, line 20519 def operating_systems_service return OperatingSystemsService.new(@connection, "#{@path}/operatingsystems") end
Locates the `permissions` service.
@return [SystemPermissionsService] A reference to `permissions` service.
# File lib/ovirtsdk4/services.rb, line 20527 def permissions_service return SystemPermissionsService.new(@connection, "#{@path}/permissions") end
Executes the `reload_configurations` method.
# File lib/ovirtsdk4/services.rb, line 20318 def reload_configurations(opts = {}) action = Action.new(opts) writer = XmlWriter.new(nil, true) ActionWriter.write_one(action, writer) body = writer.string writer.close request = Request.new({ :method => :POST, :path => "#{@path}/reloadconfigurations", :body => body, }) response = @connection.send(request) case response.code when 200 action = check_action(response) else check_fault(response) end end
Locates the `roles` service.
@return [RolesService] A reference to `roles` service.
# File lib/ovirtsdk4/services.rb, line 20535 def roles_service return RolesService.new(@connection, "#{@path}/roles") end
Locates the `scheduling_policies` service.
@return [SchedulingPoliciesService] A reference to `scheduling_policies` service.
# File lib/ovirtsdk4/services.rb, line 20543 def scheduling_policies_service return SchedulingPoliciesService.new(@connection, "#{@path}/schedulingpolicies") end
Locates the `scheduling_policy_units` service.
@return [SchedulingPolicyUnitsService] A reference to `scheduling_policy_units` service.
# File lib/ovirtsdk4/services.rb, line 20551 def scheduling_policy_units_service return SchedulingPolicyUnitsService.new(@connection, "#{@path}/schedulingpolicyunits") end
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 20626 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 == '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 == '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 == '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
Locates the `storage_connections` service.
@return [StorageServerConnectionsService] A reference to `storage_connections` service.
# File lib/ovirtsdk4/services.rb, line 20559 def storage_connections_service return StorageServerConnectionsService.new(@connection, "#{@path}/storageconnections") end
Locates the `storage_domains` service.
@return [StorageDomainsService] A reference to `storage_domains` service.
# File lib/ovirtsdk4/services.rb, line 20567 def storage_domains_service return StorageDomainsService.new(@connection, "#{@path}/storagedomains") end
Locates the `templates` service.
@return [TemplatesService] A reference to `templates` service.
# File lib/ovirtsdk4/services.rb, line 20583 def templates_service return TemplatesService.new(@connection, "#{@path}/templates") end
Returns an string representation of this service.
@return [String]
# File lib/ovirtsdk4/services.rb, line 20848 def to_s return "#<#{SystemService}:#{@path}>" end
Locates the `users` service.
@return [UsersService] A reference to `users` service.
# File lib/ovirtsdk4/services.rb, line 20591 def users_service return UsersService.new(@connection, "#{@path}/users") end
Locates the `vm_pools` service.
@return [VmPoolsService] A reference to `vm_pools` service.
# File lib/ovirtsdk4/services.rb, line 20599 def vm_pools_service return VmPoolsService.new(@connection, "#{@path}/vmpools") end
Locates the `vms` service.
@return [VmsService] A reference to `vms` service.
# File lib/ovirtsdk4/services.rb, line 20607 def vms_service return VmsService.new(@connection, "#{@path}/vms") end
Locates the `vnic_profiles` service.
@return [VnicProfilesService] A reference to `vnic_profiles` service.
# File lib/ovirtsdk4/services.rb, line 20615 def vnic_profiles_service return VnicProfilesService.new(@connection, "#{@path}/vnicprofiles") end