MCPcopy Create free account
hub / github.com/cloudfoundry/cli / QuickDeleteOrgIfExists

Function QuickDeleteOrgIfExists

integration/helpers/org_and_space.go:132–142  ·  view source on GitHub ↗

QuickDeleteOrgIfExists deletes the org with the given name, if it exists, using 'cf curl /v3/organizations... -X DELETE'.

(orgName string)

Source from the content-addressed store, hash-verified

130// QuickDeleteOrgIfExists deletes the org with the given name, if it exists, using
131// 'cf curl /v3/organizations... -X DELETE'.
132func QuickDeleteOrgIfExists(orgName string) {
133 session := CF("org", "--guid", orgName)
134 Eventually(session).Should(Exit())
135 if session.ExitCode() != 0 {
136 return
137 }
138 guid := strings.TrimSpace(string(session.Out.Contents()))
139 url := fmt.Sprintf("/v3/organizations/%s", guid)
140 session = CF("curl", "-X", "DELETE", url)
141 Eventually(session).Should(Exit())
142}
143
144// QuickDeleteSpace deletes the space with the given name, if it exists, using
145// 'cf curl /v3/spaces... -X DELETE'.

Callers 1

Calls 1

CFFunction · 0.85

Tested by

no test coverage detected