Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API versioning #60

Merged
merged 3 commits into from
Oct 5, 2020
Merged

Conversation

sachinholla
Copy link
Contributor

1) Enhanced REST server to accept the client version through new request
header 'Accept-Version'. This is an optional header. If specified, it
should be of Translib's yang bundle version format "Major.Minor.Patch".
Server returns 400 status if Accept-Version value is invalid.

2) Accept-Version header value is passed as "ClientVersion" value to the
translib APIs. Translib version check errors are mapped to 400 status
with error-type "protocol", error-tag "invalid-value" and an error-info
json object indicating allowed version range (server version and server
base version).

Sameple error response payload:

  {
  "ietf-restconf:errors" : {
    "error" : [
      {
        "error-type" : "protocol",
        "error-tag" : "operation-not-supported",
        "error-message" : "Unsupported client version 0.0.1",
        "error-info" : {
          "version-error" : {
            "ServerBaseVersion" : "1.0.0",
            "ServerVersion" : "2.1.3",
            "ClientVersion" : "0.0.1"
          }
        }

3) Translib version checks are not performed if client did not send the
Accept-Version header.

1) Enhanced REST server to accept the client version through new request
header 'Accept-Version'. This is an optional header. If specified, it
should be of Translib's yang bundle version format "Major.Minor.Patch".
Server returns 400 status if Accept-Version value is invalid.

2) Accept-Version header value is passed as "ClientVersion" value to the
translib APIs. Translib version check errors are mapped to 400 status
with error-type "protocol", error-tag "invalid-value" and an error-info
json object indicating allowed version range (server version and server
base version).

Sameple error response payload:
  {
  "ietf-restconf:errors" : {
    "error" : [
      {
        "error-type" : "protocol",
        "error-tag" : "operation-not-supported",
        "error-message" : "Unsupported client version 0.0.1",
        "error-info" : {
          "version-error" : {
            "ServerBaseVersion" : "1.0.0",
            "ServerVersion" : "2.1.3",
            "ClientVersion" : "0.0.1"
          }
        }
      }]}}

3) Translib version checks are not performed if client did not send the
Accept-Version header.

Signed-off-by: Sachin Holla <sachin.holla@broadcom.com>
@renukamanavalan renukamanavalan merged commit ae96693 into sonic-net:master Oct 5, 2020
@sachinholla sachinholla deleted the api_version branch October 12, 2020 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants