use of com.microsoft.azure.management.compute.VirtualMachineExtensionInstanceView in project azure-sdk-for-java by Azure.
the class LinuxDiskVolumeEncryptionMonitorImpl method instanceViewFirstSubStatus.
/**
* @return the first sub-status from instance view sub-status collection associated with the
* encryption extension
*/
private JsonNode instanceViewFirstSubStatus() {
if (!hasEncryptionExtension()) {
return null;
}
VirtualMachineExtensionInstanceView instanceView = this.encryptionExtension.instanceView();
if (instanceView == null || instanceView.substatuses() == null) {
return null;
}
List<InstanceViewStatus> instanceViewSubStatuses = instanceView.substatuses();
if (instanceViewSubStatuses.size() == 0) {
return null;
}
ObjectMapper mapper = new ObjectMapper();
final JsonNode rootNode;
try {
rootNode = mapper.readTree(instanceViewSubStatuses.get(0).message());
} catch (IOException exception) {
return null;
}
return rootNode;
}
Aggregations