[Engine-devel] Question about API REST

Michael Pasternak mpastern at redhat.com
Tue Sep 3 12:28:52 UTC 2013


On 09/03/2013 03:14 PM, Gustavo Frederico Temple Pedrosa wrote:
> Hello everyone,
> 
>  
> 
> I'm adding the architecture meta-field of VMs, Templates and Clusters in REST API (see change #16700 in gerrit). It's a read-only field (like a “final” in Java), that the
> administrator cannot change it, but there are some situations where there might be a value for it, such as when an entity is received from the API, slightly modified and
> then its update method is called. So I would like to ask these questions about how to implement it:

not sure i follow, do you want it to be updatable or not?, can you elaborate a bit? do

> 
>  
> 
> 1) Should this attribute be mapped both ways (from the REST API to the engine and vice-versa)?

if you want it to be updateable, - yes.

> 
> 2) How should this field be declared in the rdsl_metadata? Do I have to explicitly put it in the optional arguments or should I omit it?

if they're valid for update - "put it in the optional arguments"

> 
> 3) How can I make this field strictly immutable (like the ID field is), 

currently we using immutability constraint in api for id only

> given that the architecture is a field of the CPU entity, and the methods used to check for invalid
> updates can only operate on fields that belong directly to the main entity?

this is not a api logic, consider adding CAN-DO-ACTION check at UPDATE command instead.

> 
>  
> 
> Thanks.
> 
>  
> 
> 
> 
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 


-- 

Michael Pasternak
RedHat, ENG-Virtualization R&D



More information about the Devel mailing list