github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/hypervisor/httpd/listSubnets.go (about)

     1  package httpd
     2  
     3  import (
     4  	"bufio"
     5  	"net/http"
     6  
     7  	"github.com/Cloud-Foundations/Dominator/lib/json"
     8  )
     9  
    10  func (s state) listSubnetsHandler(w http.ResponseWriter, req *http.Request) {
    11  	writer := bufio.NewWriter(w)
    12  	defer writer.Flush()
    13  	subnets := s.manager.ListSubnets(true)
    14  	json.WriteWithIndent(writer, "    ", subnets)
    15  }