I am looking for a way to list media within a vDC to determine if it needs to be deleted before the vDC is removed. Also, I would like to delete any files found.
Can anyone help me?
I have made progress. I figured out a method to delete media found in a vDC. It works, however I am getting an "Access is forbidden" message as the method loops through each media file. The file actually gets deleted, but exits out of the method because of the thrown error. Any help is appreciated. Code is below:
internal static void FindMediaInvDC(string vDCName)
Vdc vdc = FindVdc("MyOrg", vDCName);
List<ReferenceType> media = vdc.GetMediaRefs();
foreach (ResourceReferenceType mediaFile in media)
Console.WriteLine("Name: " + mediaFile.name + " - " + "HREF " + mediaFile.href);
catch (Exception ex)
throw new VCloudException(ex.Message);