Method: VMC::Client#bind_service

Defined in:
lib/vmc/client.rb

#bind_service(service, appname) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
# File 'lib/vmc/client.rb', line 230

def bind_service(service, appname)
  
  svc = services.detect { |s| s[:name] == service }
  app = app_info(appname)
  if infra_supported? && ! infras_match?(app,svc)
    raise TargetError, "Service #{service} and App #{appname} are not on the same infra"
  end
  services = app[:services] || []
  app[:services] = services << service
  update_app(appname, app)
end