Class: OvirtSDK4::QuotasService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(quota, opts = {}) ⇒ Quota
Creates a new quota.
-
#list(opts = {}) ⇒ Array<Quota>
Lists quotas of a data center.
-
#quota_service(id) ⇒ QuotaService
Locates the
quotaservice. -
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(quota, opts = {}) ⇒ Quota
Creates a new quota.
An example of creating a new quota:
POST /ovirt-engine/api/datacenters/123/quotas HTTP/1.1
<quota>
<name>myquota</name>
<description>My new quota for virtual machines</description>
</quota>
19778 19779 19780 |
# File 'lib/ovirtsdk4/services.rb', line 19778 def add(quota, opts = {}) internal_add(quota, Quota, ADD, opts) end |
#list(opts = {}) ⇒ Array<Quota>
Lists quotas of a data center.
The order of the returned list of quotas isn’t guaranteed.
19812 19813 19814 |
# File 'lib/ovirtsdk4/services.rb', line 19812 def list(opts = {}) internal_get(LIST, opts) end |
#quota_service(id) ⇒ QuotaService
Locates the quota service.
19823 19824 19825 |
# File 'lib/ovirtsdk4/services.rb', line 19823 def quota_service(id) QuotaService.new(self, id) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 |
# File 'lib/ovirtsdk4/services.rb', line 19834 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return quota_service(path) end return quota_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |