gpt4 book ai didi

docker-swarm - 用于监听 docker swarm 事件的 API

转载 作者:行者123 更新时间:2023-12-04 04:21:42 28 4
gpt4 key购买 nike

我正在尝试连接到 docker 事件总线以监听 swarm 上发生的各种事件,例如节点离开和加入集群、创建的服务等。 问题。

  • 是否有可能在群体级别获得此类信息?
  • 如果是这样,是否dockerpy库可用于监听此类事件?
  • 最佳答案

    来自 docker API 文档:https://docs.docker.com/engine/api/v1.39

    Various objects within Docker report events when something happens to them.

    Containers report these events: attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, exec_die, export, health_status, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, and update

    Services report these events: create, update, and remove

    Nodes report these events: create, update, and remove



    来自 dockerpy 文档: https://docker-py.readthedocs.io/en/stable/api.html?highlight=event

    events(since=None, until=None, filters=None, decode=None) Get real-time events from the server. Similar to the docker events command.

    Parameters: since (UTC datetime or int) – Get events from this point until (UTC datetime or int) – Get events until this point filters (dict) – Filter the events by event time, container or image decode (bool) – If set to true, stream will be decoded into dicts on the fly. False by default. Returns: A docker.types.daemon.CancellableStream generator

    Raises: docker.errors.APIError – If the server returns an error.

    关于docker-swarm - 用于监听 docker swarm 事件的 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42286085/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com