Group based policy API for intent based infrastructure automation