Juniper / contrail

Contrail repo for core components (go based)
Apache License 2.0
44 stars 32 forks source link

Implement PATCH support #30

Open jnprchandras opened 6 years ago

nati commented 6 years ago

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.

jnprchandras commented 6 years ago

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.

nati commented 6 years ago

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.

jnprchandras commented 6 years ago

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.

nati commented 6 years ago

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.

jnprchandras commented 6 years ago

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.

nati commented 6 years ago

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

damianoneill commented 6 years ago

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 notifications@github.com 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.

cyrilMargaria commented 6 years ago

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:

nati commented 6 years ago

@cyrilMargaria That should be handled by orchestrator layer only.

cyrilMargaria commented 6 years ago

@nati OpenAPI too?

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