Delete (DELETE) RunbookVersions
Delete using the HTTP DELETE operation.
Code Examples
Request
Method | Request URI | HTTP Version |
---|---|---|
DELETE |
HTTPS://<HOST>:<PORT>/00000000-0000-0000-0000-000000000000/ RunbookVersions(guid'<GUID>') |
HTTP/1.1 |
Request URI Parameters
URI Parameter | Description |
---|---|
GUID |
Required. The unique identifier value (RunbookVersionID) for a RunbookVersion entity. |
Request URI Example
Example URI |
---|
DELETE https://sma-server:9090/00000000-0000-0000-0000-000000000000/RunbookVersions(guid'159fb0d4-8c32-4388-8944-a7ac07678d18') HTTP/1.1 |
Request Headers
For more information about the common request headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.
Request Body
The DELETE operation has no request body.
Response
Response Codes
Response Code | Description |
---|---|
HTTP/1.1 204 No Content |
Request fulfilled. |
Response Headers
For more information about the common response headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.
Response Body
The DELETE operation has no response body.
Code Examples
The following example deletes a specific RunbookVersion, identified by the RunbookVersionID (a unique guid value).
namespace CodeSample.Microsoft.SystemCenter.SMA
{
public class SMASamples
{
public static void Main()
{
// Replace this with the name of your SMA web service endpoint.
string serviceEndPoint = "https://sma-server:9090/00000000-0000-0000-0000-000000000000";
// Setup the connection to SMA
OrchestratorApi SMAService = new OrchestratorApi(new Uri(serviceEndPoint));
// Set credentials to the default or to a specific user.
((DataServiceContext)SMAService).Credentials = CredentialCache.DefaultCredentials;
//((DataServiceContext)SMAService).Credentials = new NetworkCredential("user", "pwd", "domain");
try
{
// Note: The runbook must be in edit to allow a delete of the RunbookVersion.
// Identify a specific RunbookVersion instance to search for.
var runbookVersionID = new Guid("159fb0d4-8c32-4388-8944-a7ac07678d18");
// Query for the specific RunbookVersion instance identified by RunbookVersionID.
var runbookVersion = SMAService.RunbookVersions.Where(r => r.RunbookVersionID == runbookVersionID).FirstOrDefault();
// Delete the RunbookVersion object.
// Note: This action is queued up until the SaveChanges action is called.
SMAService.DeleteObject(runbookVersion);
// Save all pending actions (client -> server communication initiated).
SMAService.SaveChanges();
}
catch (Exception ex)
{
throw new ApplicationException("An error occurred during execution.", ex);
}
}
}
}