Permanently deletes an empty bucket. The path parameter is the name of the bucket to delete. In this example, we are deleting the bucket "chilkat-test-bucket". Success is indicated by a 204 response status code with an empty response body.
curl -X DELETE https://www.googleapis.com/storage/v1/b/chilkat-test-bucket?project=MY_CLOUD_STORAGE_PROJECT \
--header "Authorization: Bearer CLOUD_STORAGE_TOKEN"
[Reflection.Assembly]::LoadFile("C:\myAssemblies\ChilkatDotNet47.dll")
$rest = New-Object Chilkat.Rest
# URL: https://www.googleapis.com/storage/v1/b/chilkat-test-bucket?project=MY_CLOUD_STORAGE_PROJECT
$bTls = $true
$port = 443
$bAutoReconnect = $true
$success = $rest.Connect("www.googleapis.com",$port,$bTls,$bAutoReconnect)
if ($success -ne $true) {
$("ConnectFailReason: " + $rest.ConnectFailReason)
$($rest.LastErrorText)
exit
}
$rest.AddHeader("Authorization","Bearer CLOUD_STORAGE_TOKEN")
$sbResponseBody = New-Object Chilkat.StringBuilder
$success = $rest.FullRequestNoBodySb("DELETE","/storage/v1/b/chilkat-test-bucket?project=MY_CLOUD_STORAGE_PROJECT",$sbResponseBody)
if ($success -ne $true) {
$($rest.LastErrorText)
exit
}
$respStatusCode = $rest.ResponseStatusCode
if ($respStatusCode -ge 400) {
$("Response Status Code = " + $respStatusCode)
$("Response Header:")
$($rest.ResponseHeader)
$("Response Body:")
$($sbResponseBody.GetAsString())
exit
}