Giter Site home page Giter Site logo

Implement PATCH support about contrail HOT 11 OPEN

juniper avatar juniper commented on August 10, 2024
Implement PATCH support

from contrail.

Comments (11)

nati avatar nati commented on August 10, 2024

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.

from contrail.

jnprchandras avatar jnprchandras commented on August 10, 2024

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.

from contrail.

nati avatar nati commented on August 10, 2024

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.

from contrail.

jnprchandras avatar jnprchandras commented on August 10, 2024

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.

from contrail.

nati avatar nati commented on August 10, 2024

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.

from contrail.

jnprchandras avatar jnprchandras commented on August 10, 2024

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.

from contrail.

nati avatar nati commented on August 10, 2024

Let's call it as Bluk create/update/delete API. I've created an issue for discussing it . #46

from contrail.

damianoneill avatar damianoneill commented on August 10, 2024

from contrail.

cyrilMargaria avatar cyrilMargaria commented on August 10, 2024

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)

from contrail.

nati avatar nati commented on August 10, 2024

@cyrilMargaria
That should be handled by orchestrator layer only.

from contrail.

cyrilMargaria avatar cyrilMargaria commented on August 10, 2024

@nati
OpenAPI too?

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

from contrail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.