contrail icon indicating copy to clipboard operation
contrail copied to clipboard

Implement PATCH support

Open jnprchandras opened this issue 7 years ago • 11 comments

jnprchandras avatar Dec 28 '17 11:12 jnprchandras

Could you add reason why we need both of PUT and PATCH? I know they have different meanings but I don't see use cases.

nati avatar Jan 02 '18 15:01 nati

PUT method is sent by the client to create or replace the target data resource. Where as PATCH allows to update the required properties alone.

In ATOM, Intent infrastrcture would be supporting incremental changes. So the Orcestration layer would invoke the Intent Layer with PATCH request. This intern would translate to another intent(Incase multi layered intent) or LLM. In any case, the translated data would need to be patched.

Let me know if you want me to detail with some example.

jnprchandras avatar Jan 02 '18 16:01 jnprchandras

We only use PUT in contrail API or OpenStack API for simplicity, and only specified properties will be updated. I still don't see enough benefit for supporting this.

nati avatar Jan 03 '18 17:01 nati

Contrail PUT is PATCH. The semantics of PUT should completely opverride. But it acts as Patch in contrail.

Other pending item in PATCH is : If A has B vertex, client should be able to update both A and B in single call. Currently Client need to call A and B seperately.

jnprchandras avatar Jan 03 '18 17:01 jnprchandras

Could you give me an example for the vertex?

yes Contrai/Neutron PUT is PATCH, but we don't have any problem around it. and I don't see many use of completely override.

nati avatar Jan 08 '18 17:01 nati

Lets take a service in metro controller usecases. EVPN service. This contains set of endpoints (devices). These can be in hundreds.In contrail data model, this can be modeled as evpn->endpoints. Here Evpn is one vertex and Endpoint is one vertex. "Evpn" vertex will have "has edge" with "endpoint". client should be able to update multiple endpoint vertices in single Patch API. currently contrail existing APIs requires multiple REST calls to update.

jnprchandras avatar Jan 08 '18 17:01 jnprchandras

Let's call it as Bluk create/update/delete API. I've created an issue for discussing it . https://github.com/Juniper/contrail/issues/46

nati avatar Jan 09 '18 18:01 nati

Guys as a reminder we agreed that all REST APIs would conform to the OpenAPI Specification. Please ensure this is being considered in your discussion.

Damian.

On 9 Jan 2018, at 18:05, Nachi Ueno [email protected] wrote:

Let's call it as Bluk create/update/delete API. I've created an issue for discussing it . #46 https://github.com/Juniper/contrail/issues/46 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Juniper/contrail/issues/30#issuecomment-356365580, or mute the thread https://github.com/notifications/unsubscribe-auth/AOtkcrmOtZFB5t-fKH_8eXRg9-zClra_ks5tI6pfgaJpZM4ROO1u.

damianoneill avatar Jan 11 '18 12:01 damianoneill

There is also a requirement in the Orchestrator to support RESTCONF + YANG APIs, which also distinguish between PUT and PATCH. Its possible to map partially YANG to Json-schema (draft-4) , but we have to be more detailed in which schema is supported: - OpenAPI and JSON-schema draft 4 are not 100% compatible. - We do have our own intent schema, which uses json-schema, but the JSON-schema draft 4 or OpenAPI or another variant (specifically : anyOf, oneOf, allOf , or discriminator, ..etc)

cyrilMargaria avatar Jan 11 '18 20:01 cyrilMargaria

@cyrilMargaria That should be handled by orchestrator layer only.

nati avatar Jan 12 '18 18:01 nati

@nati OpenAPI too?

Does ATOM supports full JSON-schema draft 4, full openAPI variant, what are the extensions to either base?

cyrilMargaria avatar Jan 12 '18 19:01 cyrilMargaria