class OvirtSDK4::PermitsService
Constants
- ADD
- LIST
Public Instance Methods
Adds a permit to the role. The permit name can be retrieved from the xref:services-cluster_levels service.
For example to assign a permit `create_vm` to the role with id `123` send a request like this:
.… POST /ovirt-engine/api/roles/123/permits .…
With a request body like this:
- source,xml
<permit>
<name>create_vm</name>
</permit>
@param permit [Permit] The permit to add.
@param opts [Hash] Additional options.
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
@return [Permit]
# File lib/ovirtsdk4/services.rb, line 19076 def add(permit, opts = {}) internal_add(permit, Permit, ADD, opts) end
List
the permits of the role.
For example to list the permits of the role with the id `123` send a request like this:
.… GET /ovirt-engine/api/roles/123/permits .…
- source,xml
<permits>
<permit href="/ovirt-engine/api/roles/123/permits/5" id="5"> <name>change_vm_cd</name> <administrative>false</administrative> <role href="/ovirt-engine/api/roles/123" id="123"/> </permit> <permit href="/ovirt-engine/api/roles/123/permits/7" id="7"> <name>connect_to_vm</name> <administrative>false</administrative> <role href="/ovirt-engine/api/roles/123" id="123"/> </permit>
</permits>
The order of the returned list of permits isn't guaranteed.
@param opts [Hash] Additional options.
@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part
of the current request. See <<documents/003_common_concepts/follow, here>> for details.
@option opts [Integer] :max Sets the maximum number of permits to return. If not specified all the permits are returned.
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
@return [Array<Permit>]
# File lib/ovirtsdk4/services.rb, line 19132 def list(opts = {}) internal_get(LIST, opts) end
Sub-resource locator method, returns individual permit resource on which the remainder of the URI is dispatched.
@param id [String] The identifier of the `permit`.
@return [PermitService] A reference to the `permit` service.
# File lib/ovirtsdk4/services.rb, line 19143 def permit_service(id) PermitService.new(self, id) 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 19154 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return permit_service(path) end return permit_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end