This API method deletes an existing target. There is currently no “undo” so this method must be used with care.
Request
DELETE /target/geohost_name/target_name HTTP/1.0 Host: api.gslb.me Accept: encoding_type Authorization: Basic base64_credentials
Where:
- geohost_name is the name of the geohost where you want to delete the target name
- target_name is the name of the target you want to delete
- base64_credentials is username:password in base64-encoded format (HTTP Basic Authentication)
- encoding_type is either application/xml or application/json (if the “Accept” header is omitted, response will be JSON-encoded)
Sample requests:
- Raw request:
DELETE /target/mygeohost.zone.com/11.22.33.44 HTTP/1.0 Host: api.gslb.me Accept: application/json Content-Length: 0 Authorization: Basic dGVzdHVzZXJAZ3NsYi5tZTp0ZXN0cGFzc3dvcmQK
- Using curl:
curl -u testuser@gslb.me:testpassword -X DELETE -H "Accept: application/json" -k https://api.gslb.me/target/mygeohost.zone.com/11.22.33.44
Response
- In case of success:
HTTP/1.1 200 OK Content-Type: application/json {"message":"Done","returncode":"0"}
- If the target does not exist
HTTP/1.1 404 Not Found Content-Type: application/json {"message":"Target not found","returncode":"2"}
- In case of internal error:
HTTP/1.1 500 Server Error Content-Type: application/json {"message":"Internal error, please contact support@gslb.me","returncode":"4"}