@@ -11,6 +11,7 @@ use dropshot::{
1111 HttpResponseOk , HttpResponseUpdatedNoContent , PaginationParams , Path ,
1212 Query , RequestContext , ResultsPage , TypedBody ,
1313} ;
14+ use dropshot_api_manager_types:: api_versions;
1415use lldpd_types:: {
1516 build_info:: BuildInfo ,
1617 interfaces:: { Interface , InterfaceAdd } ,
@@ -20,6 +21,33 @@ use protocol::types::{ChassisId, PortId, SystemCapabilities};
2021use schemars:: JsonSchema ;
2122use serde:: { Deserialize , Serialize } ;
2223
24+ api_versions ! ( [
25+ // WHEN CHANGING THE API (part 1 of 2):
26+ //
27+ // +- Pick a new semver and define it in the list below. The list MUST
28+ // | remain sorted, which generally means that your version should go at
29+ // | the very top.
30+ // |
31+ // | Duplicate this line, uncomment the *second* copy, update that copy for
32+ // | your new API version, and leave the first copy commented out as an
33+ // | example for the next person.
34+ // v
35+ // (next_int, IDENT),
36+ ( 1 , INITIAL ) ,
37+ ] ) ;
38+
39+ // WHEN CHANGING THE API (part 2 of 2):
40+ //
41+ // The call to `api_versions!` above defines constants of type
42+ // `semver::Version` that you can use in your Dropshot API definition to specify
43+ // the version when a particular endpoint was added or removed. For example, if
44+ // you used:
45+ //
46+ // (2, ADD_FOOBAR)
47+ //
48+ // Then you could use `VERSION_ADD_FOOBAR` as the version in which endpoints
49+ // were added or removed.
50+
2351#[ dropshot:: api_description]
2452pub trait LldpdApi {
2553 type Context ;
0 commit comments