(Migrated) Deployment state

(This message has been automatically imported from the retired mailing list)

Hi there,

there was a discussion we had off-list that we moved over here.

The question was, essentially, if using an external tool drive the
deployment of services, when to known that a service is already deployed
given that zato.service.upload-package [1] is asynchronous.

Well, the easiest way would be to use the Zato’s public API and combine
zato.service.get-by-name [2] with zato.service.get-deployment-info-list [3].

The steps would be

  • Deploy a service using upload-package
  • Give it some time and then periodically check whether it’s already
    available using get-by-name [2]
  • If it is, note the ID and invoke get-deployment-info-list - in
    response you receive a bunch of information regarding each server a
    service is deployed on

This all can be wrapped in a single custom service and could in fact be
added to the core if someone’s willing to contribute it, at least as
much as it’s needed for one’s case and I’d do the rest.

There was also a related question about hooks [4], in particular whether
after_add_to_store is called for each server a service is deployed on.

The answer is yes, it’s called for each server however this hook may not
be enough for the case of notifying external systems of a completed
deployment because the hook doesn’t have access to any built-in
messaging means, such as outgoing HTTP connections. Making them
available sure sounds like an interesting addition but it’s not there yet.

[1] https://zato.io/docs/public-api/details/zato.service.upload-package.html

[2] https://zato.io/docs/public-api/details/zato.service.get-by-name.html


[4] https://zato.io/docs/progguide/service-hooks.html