Michael Pasternak has posted comments on this change.

Change subject: restapi: Support for gluster hooks added
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(12 inline comments)

this patch breaks basic REST principals, let's discuss it

....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/ClusterResource.java
Line 35: 
Line 36:     @Path("glustervolumes")
Line 37:     public GlusterVolumesResource getGlusterVolumesResource();
Line 38: 
Line 39:     @Path("glusterhooks")
maybe we should call it just "hooks", i.e we may reuse it in some point i guess
Line 40:     public GlusterHooksResource getGlusterHooksResource();


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/gluster/GlusterHookResource.java
Line 23:     @GET
Line 24:     @Formatted
Line 25:     public GlusterHook get();
Line 26: 
Line 27:     @Path("{action: (enable|disable|add|update|remove)}/{oid}")
1.  add|update|remove should be *not* actions, but HTTP methods

2. any specific reason why you can't do enable|disable via update?
Line 28:     public ActionResource getActionSubresource(@PathParam("action") 
String action, @PathParam("oid") String oid);
Line 29: 
Line 30:     @POST
Line 31:     @Formatted


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 3148:         </xs:annotation>
Line 3149:       </xs:element>
Line 3150:     </xs:sequence>
Line 3151:   </xs:complexType>
Line 3152:   
WS
Line 3153:   <xs:element name="hook_status" type="HookStatus"/>
Line 3154:   <xs:complexType name="HookStatus">
Line 3155:     <xs:sequence>
Line 3156:       <xs:element name="hook_status" type="xs:string" minOccurs="0" 
maxOccurs="unbounded">


Line 3161:         </xs:annotation>
Line 3162:       </xs:element>
Line 3163:     </xs:sequence>
Line 3164:   </xs:complexType>
Line 3165:   
WS
Line 3166:   <xs:element name="content_types" type="ContentTypes"/>
Line 3167:   <xs:complexType name="ContentTypes">
Line 3168:     <xs:sequence>
Line 3169:       <xs:element name="content_type" type="xs:string" minOccurs="0" 
maxOccurs="unbounded">


Line 3174:         </xs:annotation>
Line 3175:       </xs:element>
Line 3176:     </xs:sequence>
Line 3177:   </xs:complexType>
Line 3178:   
WS
Line 3179:   <xs:element name="server_hooks" type="GlusterServerHooks" />
Line 3180:   <xs:complexType name="GlusterServerHooks">
Line 3181:     <xs:complexContent>
Line 3182:       <xs:extension base="BaseResources">


Line 3190:         </xs:sequence>
Line 3191:       </xs:extension>
Line 3192:     </xs:complexContent>
Line 3193:   </xs:complexType>
Line 3194:   
WS
Line 3195:   <xs:element name="server_hook" type="GlusterServerHook"/>
Line 3196:   <xs:complexType name="GlusterServerHook">
Line 3197:     <xs:annotation>
Line 3198:       <xs:appinfo>


Line 3209:         </xs:sequence>
Line 3210:       </xs:extension>
Line 3211:     </xs:complexContent>
Line 3212:   </xs:complexType>
Line 3213:   
WS
Line 3214:   <xs:element name="gluster_hook" type="GlusterHook"/>
Line 3215:   <xs:complexType name="GlusterHook">
Line 3216:     <xs:annotation>
Line 3217:       <xs:appinfo>


Line 3235:       </xs:extension>
Line 3236:     </xs:complexContent>
Line 3237:   </xs:complexType>
Line 3238:   
Line 3239:  
WS
Line 3240:   <xs:element name="glusterhooks" type="GlusterHooks" />
Line 3241:   <xs:complexType name="GlusterHooks">
Line 3242:     <xs:complexContent>
Line 3243:       <xs:extension base="BaseResources">


Line 3251:         </xs:sequence>
Line 3252:       </xs:extension>
Line 3253:     </xs:complexContent>
Line 3254:   </xs:complexType>
Line 3255:   
WS
Line 3256:   <xs:element name="pm_proxies" type="PmProxies"/>
Line 3257:   <xs:complexType name="PmProxies">
Line 3258:     <xs:sequence>
Line 3259:       <xs:element ref="pm_proxy" minOccurs="0" maxOccurs="unbounded">


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 3211:     urlparams: {}
Line 3212:     headers:
Line 3213:       Content-Type: {value: application/xml|json, required: true}
Line 3214:       Correlation-Id: {value: 'any string', required: false}
Line 3215: - name: 
/api/clusters/{cluster:id}/glusterhooks/{glusterhook:id}/add|rel=add
should be done via HTTP method
Line 3216:   request:
Line 3217:     body:
Line 3218:       parameterType: Action
Line 3219:       signatures:


Line 3222:     urlparams: {}
Line 3223:     headers:
Line 3224:       Content-Type: {value: application/xml|json, required: true}
Line 3225:       Correlation-Id: {value: 'any string', required: false}
Line 3226: - name: 
/api/clusters/{cluster:id}/glusterhooks/{glusterhook:id}/update|rel=update
should be done via HTTP method
Line 3227:   request:
Line 3228:     body:
Line 3229:       parameterType: Action
Line 3230:       signatures:


Line 3233:     urlparams: {}
Line 3234:     headers:
Line 3235:       Content-Type: {value: application/xml|json, required: true}
Line 3236:       Correlation-Id: {value: 'any string', required: false}
Line 3237: - name: 
/api/clusters/{cluster:id}/glusterhooks/{glusterhook:id}/remove|rel=remove
should be done via HTTP method
Line 3238:   request:
Line 3239:     body:
Line 3240:       parameterType: Action
Line 3241:       signatures:


-- 
To view, visit http://gerrit.ovirt.org/16512
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf9c0299977448e0b50feeed6e38a015c60b86fd
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sahina Bose <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to