checkPassword();
return response(instancesArray(), instanceFilter());
}
protected NSArray<MInstance> instancesArray() {
MApplication application = (MApplication) routeObjectForKey("name");
String id = request().stringFormValueForKey("id");
NSArray<MInstance> instances = siteConfig().instanceArray();
if (application != null) {
if (id != null) {
instances = ERXQ.filtered(siteConfig().instanceArray(), ERXQ.is("applicationName", application.name()).and(ERXQ.is("id", id)));
} else {
instances = ERXQ.filtered(siteConfig().instanceArray(), ERXQ.is("applicationName", application.name()));
}
}
return instances;
}