I am trying to delete all catalogs from oraganization i have writen below code to get the catloges from org in this same loop not able to use
Admincataloge it's through exception, if any one help me to extent this code to delete the all catalogs in organizaiton, it's greate help for me. i am new java coding this code not structured,
if
(!organizationsMap.isEmpty())
{
ReferenceType organizationReference =
organizationsMap .get(organizationName);
System.
out.print(organizationName);
System.
out.println();
System.
out.println(organizationReference.getHref());
Organization organization = Organization.getOrganizationByReference(
vcloudClient, organizationReference);
Collection<ReferenceType> catalogLinks = organization.getCatalogRefs();
if (!catalogLinks.isEmpty())
{
for (ReferenceType catalogLink : catalogLinks)
{
Catalog catalog = Catalog.getCatalogByReference(
vcloudClient, catalogLink);
CatalogType catalogType = catalog.getResource();
System.
out.print("--" + catalogType.getName());
System.
out.println();
//System.out.println("--- " + catalogLink.getHref());
} System.
out.println();
}
else
System.
out.println("No Catalogs Found");
}
else {
System.
out.println("No Organizations");
System.exit(0);
}
Hi,
You need to go to the VcloudAdmin and then iterate through the AdminOrganizations and its AdminCatalogs to delete the catalogs.
You can do something like this.
// Get to the Vcloud Admin.
Regards,
Rajesh Kamal.
for got to mention I am using Java SDK for vCloud Director 1.5
Hi,
You need to go to the VcloudAdmin and then iterate through the AdminOrganizations and its AdminCatalogs to delete the catalogs.
You can do something like this.
// Get to the Vcloud Admin.
Regards,
Rajesh Kamal.
Thanks Rajesh, It's really help full for me a able to execute this code to delete the catalogs for vcd1.5