Class: OvirtSDK4::QuotaService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ Quota
Retrieves a quota.
-
#permissions_service ⇒ AssignedPermissionsService
Locates the
permissionsservice. -
#quota_cluster_limits_service ⇒ QuotaClusterLimitsService
Locates the
quota_cluster_limitsservice. -
#quota_storage_limits_service ⇒ QuotaStorageLimitsService
Locates the
quota_storage_limitsservice. -
#remove(opts = {}) ⇒ Object
Delete a quota.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#update(quota, opts = {}) ⇒ Quota
Updates a quota.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ Quota
Retrieves a quota.
An example of retrieving a quota:
GET /ovirt-engine/api/datacenters/123/quotas/456 HTTP/1.1
<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>
19237 19238 19239 |
# File 'lib/ovirtsdk4/services.rb', line 19237 def get(opts = {}) internal_get(GET, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions service.
19323 19324 19325 |
# File 'lib/ovirtsdk4/services.rb', line 19323 def @permissions_service ||= AssignedPermissionsService.new(self, 'permissions') end |
#quota_cluster_limits_service ⇒ QuotaClusterLimitsService
Locates the quota_cluster_limits service.
19332 19333 19334 |
# File 'lib/ovirtsdk4/services.rb', line 19332 def quota_cluster_limits_service @quota_cluster_limits_service ||= QuotaClusterLimitsService.new(self, 'quotaclusterlimits') end |
#quota_storage_limits_service ⇒ QuotaStorageLimitsService
Locates the quota_storage_limits service.
19341 19342 19343 |
# File 'lib/ovirtsdk4/services.rb', line 19341 def quota_storage_limits_service @quota_storage_limits_service ||= QuotaStorageLimitsService.new(self, 'quotastoragelimits') end |
#remove(opts = {}) ⇒ Object
Delete a quota.
An example of deleting a quota:
DELETE /ovirt-engine/api/datacenters/123-456/quotas/654-321-0472718ab224 HTTP/1.1
Accept: application/xml
Content-type: application/xml
19270 19271 19272 |
# File 'lib/ovirtsdk4/services.rb', line 19270 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 |
# File 'lib/ovirtsdk4/services.rb', line 19352 def service(path) if path.nil? || path == '' return self end if path == 'permissions' return end if path.start_with?('permissions/') return .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 = {}) ⇒ Quota
Updates a quota.
An example of updating a quota:
PUT /ovirt-engine/api/datacenters/123/quotas/456 HTTP/1.1
<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>
19314 19315 19316 |
# File 'lib/ovirtsdk4/services.rb', line 19314 def update(quota, opts = {}) internal_update(quota, Quota, UPDATE, opts) end |