version is required if you wish to perform complex change, "transaction" in terms of dataplane api. for simple change indeed it is not required.
пн, 21 сент. 2020 г. в 14:29, Jonathan Matthews <cont...@jpluscplusm.com>: > I’ve not used the API yet, but my reading of those docs, alongside some > previous experience, suggests to me that the version should br an entirely > user-specified, opaque-to-haproxy string, whose purpose is to avoid stale > config writes from concurrent clients. > > However, the fact that the version seems to be required outside of > transactions, and indeed that changes outside transactions are even > possible, makes me think I’ve got that wrong. > > I agree with OP: there should be a “show me the current version ID” > endpoint. I don’t see how the best (apparent!) candidate ( > /v2/services/haproxy/configuration/raw ) can be used to achieve this, as it > also requires a version to be provided. > > I’m interested in what folks suggest :-) > > J > > On Mon, 21 Sep 2020 at 09:55, Ricardo Fraile <rfra...@rfraile.eu> wrote: > >> For example, to start a new transaction, as the documentation [1] >> >> points: >> >> >> >> version / required >> >> Configuration version on which to work on >> >> >> >> Or the blog post about it [2]: >> >> >> >> Call the /v1/services/haproxy/transactions endpoint to create a new >> >> transaction. This requires a version parameter in the URL, but the >> >> commands inside the transaction don’t need one. Whenever a POST, PUT, or >> >> DELETE command is called, a version must be included, which is then >> >> stamped onto the HAProxy configuration file. This ensures that if >> >> multiple clients are using the API, they’ll avoid conflicts. If the >> >> version you pass doesn’t match the version stamped onto the >> >> configuration file, you’ll get an error. When using a transaction, that >> >> version is specified up front when creating the transaction. >> >> >> >> What is the right way to get the version stamped on the configuration >> >> file? >> >> >> >> Thanks, >> >> >> >> [1] - >> >> >> https://www.haproxy.com/documentation/dataplaneapi/latest/#operation/startTransaction >> >> [2] - https://www.haproxy.com/blog/new-haproxy-data-plane-api/ >> >> >> >> >> >> > what do you mean by "file version" ? >> >> >> >> -- > Jonathan Matthews > https://jpluscplusm.com >