Coder Social home page Coder Social logo

Comments (2)

pierresouchay avatar pierresouchay commented on July 21, 2024

Hello @kinnalru ,

The endpoint already implemented in diplomat: https://github.com/WeAreFarmGeek/diplomat/blob/master/lib/diplomat/agent.rb#L31

It of course works only for a single agent (aka it find agent only for a single Consul Agent). For me, it has little usage as it is not really unique (it is unique ONLY per agent, not within cluster).

Still, the serviceID is available for the whole cluster as well in Diplomat::Service.get.

So, if I understand clearly, it means that what you want it:

# Return nil or the service having given ID for Consul agent we are configured with
def agent_service_from_id(id_to_lookup)
  Diplomat::Agent.services.select{|i,s| s['ID'] == serviceid_to_look_at}.first
end

Can we close the issue or did I miss something?

from diplomat.

kinnalru avatar kinnalru commented on July 21, 2024

Yep. Thanx.

from diplomat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.