Bug 1477053

Summary: API to set additional feature at cluster
Product: [oVirt] ovirt-engine Reporter: Sahina Bose <sabose>
Component: RestAPIAssignee: Sahina Bose <sabose>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: medium Docs Contact:
Priority: high    
Version: 4.1.4CC: bgraveno, bugs, lsvaty, lveyde
Target Milestone: ovirt-4.1.6Flags: sabose: ovirt-4.1?
sabose: planning_ack?
sabose: devel_ack+
lsvaty: testing_ack+
Target Release: 4.1.6.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.1.6.2 Doc Type: Enhancement
Doc Text:
This update lists the additional features available for a cluster level, and allows you to enable or disable additional cluster features using an API.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-19 10:03:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Gluster RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1471658, 1485854    

Description Sahina Bose 2017-08-01 07:05:49 UTC
Description of problem:

Additional features are configured at cluster level and can be enabled per cluster (for a cluster that's at defined cluster level) in engine
Enabling/disabling this should be available via the API

Version-Release number of selected component (if applicable):
4.1

How reproducible:
NA

Comment 1 Gonza 2017-09-12 08:29:16 UTC
Verified with:
ovirt-engine-4.2.0-0.0.master.20170906185835.gitcee3e58.el7.centos.noarch

# curl -vvvv -X POST -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/22f3c88b-3e9c-43bd-bf03-ecc467528a6c/enabledfeatures \
-d "<cluster_feature id=\"00000020-0020-0020-0020-000000000300\"/>"                 
...
> POST /ovirt-engine/api/clusters/22f3c88b-3e9c-43bd-bf03-ecc467528a6c/enabledfeatures HTTP/1.1
...
{
  "name" : "libgfapi_supported",
  "id" : "00000020-0020-0020-0020-000000000300"
* Connection #0 to host engine.com left intact
}%  

# curl -vvvv -X DELETE -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/22f3c88b-3e9c-43bd-bf03-ecc467528a6c/enabledfeatures/00000020-0020-0020-0020-000000000300
...
> DELETE /ovirt-engine/api/clusters/22f3c88b-3e9c-43bd-bf03-ecc467528a6c/enabledfeatures/00000020-0020-0020-0020-000000000300 
...
{
  "status" : "complete"
* Connection #0 to host engine.com left intact
}%

Comment 2 Sandro Bonazzola 2017-09-18 07:24:03 UTC
(In reply to Gonza from comment #1)
> Verified with:
> ovirt-engine-4.2.0-0.0.master.20170906185835.gitcee3e58.el7.centos.noarch

This bug is targeted 4.1.6 and should be tested with 4.1.6 engine.
Moving back to QE

Comment 3 Gonza 2017-09-18 09:08:55 UTC
Verified with:
ovirt-engine-4.1.6.2-0.1.el7.noarch

# curl -vvvv -X GET -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures   
...
> GET /ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures HTTP/1.1
...
{ }%

# curl -vvvv -X POST -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures \
-d "<cluster_feature id=\"00000020-0020-0020-0020-000000000300\"/>"
...
> POST /ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures HTTP/1.1
...
{
  "name" : "libgfapi_supported",
  "id" : "00000020-0020-0020-0020-000000000300"
}%

# curl -vvvv -X GET -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures 
...
> GET /ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures HTTP/1.1
...
{
  "cluster_feature" : [ {
    "name" : "libgfapi_supported",
    "id" : "00000020-0020-0020-0020-000000000300"
  } ]

}%

# curl -vvvv -X DELETE -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal https://engine.com/ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures/00000020-0020-0020-0020-000000000300
...
> DELETE /ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures/00000020-0020-0020-0020-000000000300 HTTP/1.1
...
{
  "status" : "complete"
}%

# curl -vvvv -X GET -H "Content-type: application/xml" -H "Accept: application/json" -k -u admin@internal  https://engine.com/ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures
...
> GET /ovirt-engine/api/clusters/59b63c22-03e2-0368-00c2-00000000018f/enabledfeatures HTTP/1.1
...
{ }%