class OvirtSDK4::QuotaService

Constants

GET
REMOVE
UPDATE

Public Instance Methods

get(opts = {}) click to toggle source

Retrieves a quota.

An example of retrieving a quota:

source

GET /ovirt-engine/api/datacenters/123/quotas/456


source,xml

<quota id=“456”>

<name>myquota</name>
<description>My new quota for virtual machines</description>
<cluster_hard_limit_pct>20</cluster_hard_limit_pct>
<cluster_soft_limit_pct>80</cluster_soft_limit_pct>
<storage_hard_limit_pct>20</storage_hard_limit_pct>
<storage_soft_limit_pct>80</storage_soft_limit_pct>

</quota>


@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 [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 [Quota]

# File lib/ovirtsdk4/services.rb, line 19494
def get(opts = {})
  internal_get(GET, opts)
end
permissions_service() click to toggle source

Locates the `permissions` service.

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

# File lib/ovirtsdk4/services.rb, line 19584
def permissions_service
  @permissions_service ||= AssignedPermissionsService.new(self, 'permissions')
end
quota_cluster_limits_service() click to toggle source

Locates the `quota_cluster_limits` service.

@return [QuotaClusterLimitsService] A reference to `quota_cluster_limits` service.

# File lib/ovirtsdk4/services.rb, line 19593
def quota_cluster_limits_service
  @quota_cluster_limits_service ||= QuotaClusterLimitsService.new(self, 'quotaclusterlimits')
end
quota_storage_limits_service() click to toggle source

Locates the `quota_storage_limits` service.

@return [QuotaStorageLimitsService] A reference to `quota_storage_limits` service.

# File lib/ovirtsdk4/services.rb, line 19602
def quota_storage_limits_service
  @quota_storage_limits_service ||= QuotaStorageLimitsService.new(self, 'quotastoragelimits')
end
remove(opts = {}) click to toggle source

Delete a quota.

An example of deleting a quota:

source

DELETE /ovirt-engine/api/datacenters/123-456/quotas/654-321 -0472718ab224 HTTP/1.1 Accept: application/xml Content-type: application/xml


@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the remove should be performed asynchronously. @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.

# File lib/ovirtsdk4/services.rb, line 19529
def remove(opts = {})
  internal_remove(REMOVE, opts)
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 19613
def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'permissions'
    return permissions_service
  end
  if path.start_with?('permissions/')
    return permissions_service.service(path[12..-1])
  end
  if path == 'quotaclusterlimits'
    return quota_cluster_limits_service
  end
  if path.start_with?('quotaclusterlimits/')
    return quota_cluster_limits_service.service(path[19..-1])
  end
  if path == 'quotastoragelimits'
    return quota_storage_limits_service
  end
  if path.start_with?('quotastoragelimits/')
    return quota_storage_limits_service.service(path[19..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end
update(quota, opts = {}) click to toggle source

Updates a quota.

An example of updating a quota:

source

PUT /ovirt-engine/api/datacenters/123/quotas/456


source,xml

<quota>

<cluster_hard_limit_pct>30</cluster_hard_limit_pct>
<cluster_soft_limit_pct>70</cluster_soft_limit_pct>
<storage_hard_limit_pct>20</storage_hard_limit_pct>
<storage_soft_limit_pct>80</storage_soft_limit_pct>

</quota>


@param quota [Quota] The `quota` to update. @param opts [Hash] Additional options.

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

@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 [Quota]

# File lib/ovirtsdk4/services.rb, line 19575
def update(quota, opts = {})
  internal_update(quota, Quota, UPDATE, opts)
end