Skip to content

Commit b275173

Browse files
authored
Merge pull request #352 from mikekistler/drop-version-discovery
Drop guidance on version discovery
2 parents e74cc22 + d41b4ec commit b275173

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

azure/Guidelines.md

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
| Date | Notes |
55
| ----------- | -------------------------------------------------------------- |
6+
| 2022-May-11 | Drop guidance on version discovery |
67
| 2022-Mar-29 | Add guidelines about using durations |
78
| 2022-Mar-25 | Update guideline for date values in headers to follow RFC 7231 |
89
| 2022-Feb-01 | Updated error guidance |
@@ -736,50 +737,6 @@ While removing a value from an enum is a breaking change, adding value to an enu
736737

737738
> :ballot_box_with_check: **You SHOULD** use extensible enums unless you are positive that the symbol set will **NEVER** change over time.
738739
739-
#### Version Discovery
740-
741-
Simpler clients may be hardcoded to a single version of a service. Since Azure services offer each version for a well-known period of time, a client that’s regularly maintained can be always operational without further complexity as long as during regular maintenance the client is moved forward to new versions in advance of older ones being retired.
742-
743-
API version discovery is needed when either a given hosted service may expose a different API version to different clients (e.g. latest API version only available in certain regions or to certain tenants) or the service itself may exist in different instances (e.g. a service that may be run on Azure or hosted on-premises).
744-
In both of those cases clients may get ahead of services in the API version they use. In might also be possible for a client version to ship ahead of its corresponding service update, leading to the same situation. Lastly, version discovery is useful for clients that want to warn operators that an API they depend on may expire soon.
745-
746-
:white_check_mark: **DO** support API version discovery, including
747-
748-
1. Support HTTP `OPTIONS` requests against all resources, including the root URL for a given tenant or the global root if no tenant identity is tracked or not a multi-tenant service
749-
750-
2. Include the `api-supported-versions` header, containing a comma-separated list of versions conforming to the Azure versioning scheme. This list must include all group versions as well as all major-minor versions supported by the target resource. For cases where no specific version applies (e.g. sometimes the root resource), the list still must contain the group versions supported by the service.
751-
752-
3. If a given service supports versions of the API that are known to be planned for deprecation in a year or less, it must include those versions (group and major.minor) in the `api-deprecated-versions` header.
753-
754-
4. For services that do rolling updates where there is a point in time where some front-ends are ahead of others version-wise, all front-ends **MUST** report the previous version as the latest version until the rolling update covers all instances and only then switch over to reporting the new latest version. This ensures that clients will not detect a version and then get load-balanced into a front-end that does not support it yet.
755-
756-
:ballot_box_with_check: **YOU SHOULD** support the following for version discovery:
757-
758-
1. In addition to the functionality described here, services should support HTTP `OPTIONS` requests for other purposes such as further discovery, CORS, etc.
759-
760-
2. Services should allow unauthenticated HTTP `OPTIONS` requests. When doing so, authors need to consider whether HTTP `OPTIONS` requests against non-existing resources result in 404s and whether that is leaking sensitive information. Certain scenarios, such as support for CORS pre-flight requests, require allowing unauthenticated HTTP `OPTIONS` requests.
761-
762-
3. If using OData and addressing an expanded resource, the HTTP `OPTIONS` request should return the group versions that are supported across the expanded set.
763-
764-
Example request to discover API versions (blob storage container list API):
765-
766-
```text
767-
OPTIONS /?comp=list HTTP/1.1
768-
host: accountname.blob.core.azure.net
769-
```
770-
771-
Example response:
772-
773-
```text
774-
200 OK
775-
api-supported-versions: 2011-08,2012-02,1.1,2.0
776-
api-deprecated-versions: 2009-04,1.0
777-
Content-Length: 0
778-
```
779-
780-
Clients that use version discovery are expected to cache version information. Since there’s a year of lead time after an API version shows in the `api-deprecated-versions` before it’s removed, checking once a week should provide sufficient lead time to client authors or operators.
781-
In the rare case where a server rolls back a version that clients are already using, the service will reject requests because they are ahead of the latest version supported. Whenever a client sees a `version-too-new` error, it should re-execute its version discovery procedure.
782-
783740
### Repeatability of requests
784741

785742
The ability to retry failed requests for which a client never received a response greatly simplifies the ability to write resilient distributed applications. While HTTP designates some methods as safe and/or idempotent (and thus retryable), being able to retry other operations such as create-using-POST-to-collection is desirable.

0 commit comments

Comments
 (0)