Supporting multiple API versions

Document Status

Status

Comment

DRAFT

(leinfelder) Listing scenarios for v1 and v2 interactions.

Overview

In order to accommodate changes to the the SystemMetadata type, new API methods will be introduced. Many existing v1 methods will have the same signatures but any method that deals with the SystemMetadata type will need to have a v2 version.

Requirements

  • All v1 objects are valid v2 objects, save for namespace.

  • All implementations of v2 must implement v1 methods.

  • TDB: only the minimally-necessary v2 methods will be defined. This would require

mixed-calls in when interacting with the API.

Scenarios

MN running v1 of the API (Tier 1)

# MN.v1.create() # Synch

  • MN.v1.listOjects()

  • CN.v1.create()

# Valid getSystemMetadata() calls
  • CN.v2.getSystemMetadata() –> v2.SystemMetadata

  • CN.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.v1.getSystemMetadata() –> v1.SystemMetadata

MN running v2 of the API (Tier 1)

# MN.v2.create() # Synch

  • MN.v2.listOjects()

  • CN.v2.create()

# Valid getSystemMetadata() calls
  • CN.v2.getSystemMetadata() –> v2.SystemMetadata

  • MN.v2.getSystemMetadata() –> v2.SystemMetadata

  • CN.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.v1.getSystemMetadata() –> v1.SystemMetadata

MN running v1 of the API (Tier 4)

# MN.v1.create() # Synch

  • MN.v1.listOjects()

  • CN.[v1|v2].create()

# Valid get() calls
  • CN.v2.getSystemMetadata() –> v2.SystemMetadata

  • CN.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.v1.getSystemMetadata() –> v1.SystemMetadata

# Replication to MN.target1 running v1 API
  • MN.v1.getReplica()

  • MN.target1.v1.getSystemMetadata() –> v1.SystemMetadata

# Replication to MN.target2 running v2 API
  • MN.v1.getReplica()

  • MN.target2.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.target2.v2.getSystemMetadata() –> v2.SystemMetadata

# Updates
  • CN.v1.setAccessPolicy() –> MN.target1.v1.systemMetadataChanged()

  • CN.v1.setAccessPolicy() –> MN.target2.v2.systemMetadataChanged()

  • CN.v2.setAccessPolicy() –> MN.target1.v1.systemMetadataChanged() ALLOWED?

  • CN.v2.setAccessPolicy() –> MN.target2.v2.systemMetadataChanged()

../_images/1c946e48e1c91354730833bf8c452dea427e9c51847e5c4a9912444141ca0c50.svg

Figure 1. Mixed MN API version interactions with replication

MN running v2 of the API (Tier 4)

# MN.v2.create() # Synch

  • MN.v1.listOjects()

  • CN.[v1|v2].create()

# Valid get() calls
  • CN.v2.getSystemMetadata() –> v2.SystemMetadata

  • CN.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.v1.getSystemMetadata() –> v1.SystemMetadata

# Replication to MN.target running v1 API
  • NOT ALLOWED

# Replication to MN.target running v2 API
  • MN.v1.getReplica()

  • MN.target.v1.getSystemMetadata() –> v1.SystemMetadata

  • MN.target.v2.getSystemMetadata() –> v2.SystemMetadata

../_images/19435ebdb207d0bb98861c84aff77a619e6ac7c73d2b7e875fe62750042ba331.svg

Figure 2. Mixed MN API version interactions with replication The original MN is running v2 of the API