Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCRUM-4618: add MaTI host info and link #1747

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/cliapp/src/containers/layout/SiteLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ export const SiteLayout = (props) => {
url: `http://logs.alliancegenome.org:5601/app/logtrail#/?q=*&h=agr.curation.${siteContext?.apiVersion?.env}.api.server&t=Now&i=logstash*&_g=()`,
target: '_blank',
},
{
label: 'MaTI Swagger UI',
icon: 'pi pi-fw pi-home',
url: `${siteContext?.apiVersion?.matiHost}q/swagger-ui/`,
target: '_blank',
},
{ label: 'Site Health', icon: 'pi pi-fw pi-plus', to: '/healthpage' },
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package org.alliancegenome.curation_api.controllers;

import static org.reflections.scanners.Scanners.TypesAnnotated;

import java.util.Set;
import java.util.TreeMap;

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion;
import org.alliancegenome.curation_api.interfaces.APIVersionInterface;
import org.alliancegenome.curation_api.model.output.APIVersionInfo;
import org.alliancegenome.curation_api.services.APIVersionInfoService;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.reflections.Reflections;

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import java.util.Set;
import java.util.TreeMap;

import static org.reflections.scanners.Scanners.TypesAnnotated;

@RequestScoped
public class APIVersionInfoController implements APIVersionInterface {
Expand Down Expand Up @@ -65,8 +64,17 @@ public APIVersionInfo get() {
} else {
info.setEsHost(esHost);
}
info.setMatiHost(getMaTIHost());
info.setEnv(env);
return info;
}

private String getMaTIHost() {
return switch (env) {
case "alpha" -> "https://alpha-mati.alliancegenome.org/";
case "beta" -> "https://beta-mati.alliancegenome.org/";
case "production" -> "https://mati.alliancegenome.org/";
default -> "http://localhost:8081/";
};
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.alliancegenome.curation_api.model.output;

import java.util.TreeMap;

import org.alliancegenome.curation_api.view.View;

import com.fasterxml.jackson.annotation.JsonView;

import lombok.Data;
import org.alliancegenome.curation_api.view.View;

import java.util.TreeMap;

@Data
public class APIVersionInfo {
Expand All @@ -23,5 +21,6 @@ public class APIVersionInfo {
private String esHost;
@JsonView(View.FieldsOnly.class)
private String env;

@JsonView(View.FieldsOnly.class)
private String matiHost;
}
Loading