Change in ovirt-engine[master]: restapi: Remove scheduling policy built-in names and thresholds
juan.hernandez at redhat.com
juan.hernandez at redhat.com
Tue Sep 29 19:29:55 UTC 2015
Juan Hernandez has submitted this change and it was merged.
Change subject: restapi: Remove scheduling policy built-in names and thresholds
......................................................................
restapi: Remove scheduling policy built-in names and thresholds
In the past the specification of scheduling policies for clusters was
based in built-in names and thresholds. For example a cluster that used
the evenly distributed scheduling policy was represented as follows:
<cluster>
<name>mycluster</name>
<scheduling_policy>
<policy>evenly_distributed</policy>
<thresholds high="80" duration="120"/>
</scheduling_policy>
...
</cluster>
This mechanism was replaced with a top level /schedulingpolicies
collection where scheduling policies can be defined with arbitrary names
and properties. For example, the same scheduling policy is represented
as follows in that top level collection:
<scheduling_policy>
<name>evenly_distributed</name>
<properties>
<property>
<name>CpuOverCommitDurationMinutes</name>
<value>2</value>
</property>
<property>
<name>HighUtilization</name>
<value>80</value>
</property>
</properties>
</scheduling_policy>
The representation of the cluster references the scheduling policy with
its identifier:
<cluster>
<name>mycluster</name>
<scheduling_policy id="..."/>
...
</cluster>
To preserve backwards compatibility the old "policy" and "thresholds"
elements were preserved. The scheduling policy representation embedded
within the cluster was also preserved. All these things have been
completely removed now, so the only way to specify a scheduling policy
when retrieving, creating or updating a cluster is to reference an
existing one using its identifier. For example, when retrieving a
cluster only the "id" (and "href") will be populated:
GET /clusters/{cluster:id}
<cluster>
...
<scheduling_policy id="..." href="..."/>
...
</cluster>
When creating or updating a cluster only the "id" will be accepted.
Change-Id: Iefabfc9b1d81ac650c2a7e352e9cbef9f1e63b49
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M backend/manager/modules/restapi/README.md
D backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/SchedulingPolicyType.java
M backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M backend/manager/modules/restapi/interface/definition/src/main/schema/api.xsd
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ClusterValidator.java
D backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/SchedulingPolicyValidator.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java
11 files changed, 182 insertions(+), 318 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit https://gerrit.ovirt.org/46098
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iefabfc9b1d81ac650c2a7e352e9cbef9f1e63b49
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
More information about the Engine-commits
mailing list