[artifact-manager] (#898) Fix push of vROps policies#911
[artifact-manager] (#898) Fix push of vROps policies#911stanislav-skkolev-spec wants to merge 13 commits intomainfrom
Conversation
...anager/src/main/java/com/vmware/pscoe/iac/artifact/aria/operations/rest/RestClientVrops.java
Outdated
Show resolved
Hide resolved
| Element policyElement = policyElements.get(i); | ||
| String policyName = policyElement.getAttribute("name"); | ||
| HashMap<String, String> childMap = new HashMap<>(); | ||
| Optional<Policy> currentPolicy = allPolicies.stream().filter(pol -> pol.getName().equals(policyElement.getAttribute("name"))).findAny(); |
There was a problem hiding this comment.
What amount of policies do we expect here? I am wondering if it makes sense to convert this to a map and use the name or id for key so we can reduce the filtering operations in case we expect a big list.
There was a problem hiding this comment.
What amount of policies do we expect here? I am wondering if it makes sense to convert this to a map and use the name or id for key so we can reduce the filtering operations in case we expect a big list.
From what I have saw they are not that many.
There was a problem hiding this comment.
Map also would make sure no duplicate policy ids are present in the zip.
| */ | ||
| private void importPolicies(final Package vropsPackage, final File tmpDir) { | ||
|
|
||
| List<AlertDefinition> alertDefinitions = restClient.getAlltDefinitionsOfType(VropsPackageMemberType.ALERT_DEFINITION) |
There was a problem hiding this comment.
Minor thing but there is a "t" beteween All and Definitions in this functions and the ones belows
| ZipOutputStream zos = new ZipOutputStream(fos); | ||
| FileInputStream fis = new FileInputStream(file.getPath())) { | ||
|
|
||
| ZipEntry zipEntry = new ZipEntry(new File(file.getPath()).getName()); |
There was a problem hiding this comment.
While do we need to create a new File() here from the file input?
fixed some cosmetic errors
.../artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/common/utils/XmlUtilities.java
Show resolved
Hide resolved
VenelinBakalov
left a comment
There was a problem hiding this comment.
Pending discussion after further discoveries
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Description
Fix for failing to push policies for vROps. Implemented functionallity of each policy .xml to check for missing alerts, symptoms and recommendations on the target server.
Checklist
Fixed #XXX -orClosed #XXX -prefix to auto-close the issueTesting
Tested with complex policies on both local and client environment.
Release Notes
Fixes #898