mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-04 13:17:43 -06:00
b862cd2ccb
* Terraform ProfitBricks Builder * make fmt * Merge remote-tracking branch 'upstream/master' into terraform-provider-profitbricks # Conflicts: # command/internal_plugin_list.go * Addressing PR remarks * Removed importers * Added ProfitBricks Data Sources * Added documentation * Updated to REST v3: - nat parameter for Nics - availabilityZone for Volumes Minor code clean up * Minor code clean up * Fixed typo in volume documentation * make fmt * Addressing requested changes * Added a step in load balancer tests in CheckDestroy where we are making sure that the test doesn't leave dangling resources in ProfitBricks * Changed expected image name * Fixed data center test Code clean up
32 lines
588 B
Go
32 lines
588 B
Go
package profitbricks
|
|
|
|
import "net/http"
|
|
import "fmt"
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
func MkJson(i interface{}) string {
|
|
jason, err := json.MarshalIndent(&i, "", " ")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
// fmt.Println(string(jason))
|
|
return string(jason)
|
|
}
|
|
|
|
// Resp is the struct returned by all Rest request functions
|
|
type Resp struct {
|
|
Req *http.Request
|
|
StatusCode int
|
|
Headers http.Header
|
|
Body []byte
|
|
}
|
|
|
|
// PrintHeaders prints the http headers as k,v pairs
|
|
func (r *Resp) PrintHeaders() {
|
|
for key, value := range r.Headers {
|
|
fmt.Println(key, " : ", value[0])
|
|
}
|
|
|
|
} |