API: Add Temporary Disk Space


Browse by products and services

Add temporary disk space to your server over the Public API. This method provides a way to add temporary disk space to a sever for a specific (mt) Media Temple service that is associated with the authenticated account.

Request Info

The following URL and HTTP method should be used.

HTTP Method URL
POST https://api.mediatemple.net/api/v1/services/{serviceId}/disk/temp

The following parameters must be provided in the URL.

Parameter Type Description
serviceId int The service id

Response Info

The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.

Sample Request

To add temporary disk space to the server for service ID 556, do the following.

 
curl -D log.txt -s -X "POST" "https://api.mediatemple.net/api/v1/services/556/disk/temp.json?apikey=a5h34sf62..."
 

Sample Response

Here is an example of the returned result.

 
{
"response" : {
"statusCode" : 202,
"timeStamp" : 1284609174311,
"date" : "2010-09-16T03:52:54.311+0000",
"errors" : [ ],
"custom" : [ ]
}
}
 

Sample Operation Pending

If another add temporary disk space operation is already pending (e.g. the above request is called a second time before the previous add temporary disk space job has completed), then you can expect a response like the following.

 
{
"response" : {
"statusCode" : 409,
"timeStamp" : 1284609198593,
"date" : "2010-09-16T03:53:18.593+0000",
"errors" : [ {
"errorCode" : "OperationPending",
"message" : "An existing operation that conflicts is currently pending.  This operation cannot be scheduled until it completes."
} ],
"custom" : [ ]
}
}
 

Response Fields

All responses should be in the standard response format. For more information, see Parsing API responses.

Response Errors

Status Code Error Code Error Description
404 InvalidService The specified serviceId was invalid.
409 OperationPending There is an existing operation that has not completed.
500 UnknownError There was an unexpected error.

Response Info

The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.

Sample Request

To add temporary disk space to a server with service ID 556, do the following.

 
curl -D log.txt -s -X "PUT" "http://api.mediatemple.net/api/v1/services/556/disk/addTemp.json?apikey=a5h34sf62..."
 

Sample Response

Here is an example of the returned result.

 
Output:

{
"response" : {
"statusCode" : 200,
"timeStamp" : 1284609174311,
"date" : "2010-09-16T03:52:54.311+0000",
"errors" : [ ],
"custom" : [ ]
}
}
 

Sample Operation Pending

If an operation to add temporary disk space is already pending (i.e. the above request is called a second time before the previous add temporary disk space job has completed), then you can expect a response like the following.

 
Output:

{
"response" : {
"statusCode" : 409,
"timeStamp" : 1284609198593,
"date" : "2010-09-16T03:53:18.593+0000",
"errors" : [ {
"errorCode" : "OperationPending",
"message" : "An existing operation that conflicts is currently pending.  This operation cannot be scheduled until it completes."
} ],
"custom" : [ ]
}
}
 

Response Fields

All responses should be in the standard response format. For more information, see Parsing API responses.