Refresh install disk usage
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/usage/refresh_disk_usage"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <credentials>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/usage/refresh_disk_usage';const options = {method: 'POST', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/usage/refresh_disk_usage \ --header 'Authorization: Basic <credentials>'Triggers an asynchronous job to recalculate the disk usage for the install.
Limitations & Warnings
- Asynchronous: the request returns immediately and does not return the
updated usage data. To check progress, poll for daily usage metrics at
GET /installs/{install_id}/usage. The estimated time of completion is thestorage_refresh_expected_timefield in the daily usage metrics; if it isnull, the job has already completed. - The last time storage was refreshed is the
storage_update_timefield of the daily usage metrics. - Multiple requests for the same environment result in a single recalculation.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The UUID of the install.
Example
294deacc-d8b8-4005-82c4-0727ba8ddde0Responses
Section titled “Responses”Returns null. The disk usage refresh has been initiated.
Bad Request
Authentication Error
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "Bad Credentials"}Not authorized
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "You don't have permission to perform that action"}Not found
object
A message regarding the error that occurred on the server
(Optional) A URL where documentation regarding this specific error can be found
Example
{ "message": "Not Found"}Too many requests
Internal Server Error
object
A message regarding the error that occurred on the server
Example
{ "message": "An unexpected error occurred, please try again in a few minutes"}An invalid response was received from an upstream server
Service unavailable
default
Section titled “default”An unexpected error response.
object
A message regarding the error that occurred on the server
Example
{ "message": "An unexpected error occurred, please try again in a few minutes"}