Beispiel #1
0
func (b ServiceBroker) PublicizePlans() {
	url := fmt.Sprintf("/v2/services?inline-relations-depth=1&q=label:%s", b.Service.Name)
	var session *cmdtest.Session
	AsUser(AdminUserContext, func() {
		session = Cf("curl", url)
	})
	structure := ServicesResponse{}
	json.Unmarshal(session.FullOutput(), &structure)
	for _, service := range structure.Resources {
		if service.Entity.Label == b.Service.Name {
			for _, plan := range service.Entity.ServicePlans {
				if plan.Entity.Name == b.Plan.Name {
					b.PublicizePlan(plan.Metadata.Url)
					break
				}
			}
		}
	}
}
func interruptSession(session *cmdtest.Session) {
	session.Cmd.Process.Signal(os.Interrupt)
	session.Wait(time.Second)
}