本文整理了Java中org.batfish.common.Version.getVersion()
方法的一些代码示例,展示了Version.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getVersion()
方法的具体详情如下:
包路径:org.batfish.common.Version
类名称:Version
方法名:getVersion
[英]Returns the version of the current build of Batfish, or #UNKNOWN_VERSION if the version could not be detected.
[中]返回蝙蝠鱼当前版本,如果无法检测到该版本,则返回#未知#版本。
代码示例来源:origin: batfish/batfish
/**
* Returns {@code true} if the given version of some other endpoint is compatible with the Batfish
* version of this process.
*
* <p>At the time of writing, compatibility is determined on having identical major and minor
* versions.
*/
public static boolean isCompatibleVersion(
String myName, String otherName, @Nullable String otherVersion) {
return isCompatibleVersion(myName, getVersion(), otherName, otherVersion);
}
代码示例来源:origin: batfish/batfish
@GET
@Produces(MediaType.APPLICATION_JSON)
public JSONArray getInfo() {
_logger.info("PMS:getInfo\n");
return new JSONArray(
Arrays.asList(
CoordConsts.SVC_KEY_SUCCESS,
"Batfish coordinator v"
+ Version.getVersion()
+ ". Enter ../application.wadl (relative to your URL) to see supported methods"));
}
代码示例来源:origin: batfish/batfish
@Test
public void versionIsRealAtRuntime() {
assertThat(Version.getVersion(), not(containsString("project.version")));
assertThat(Version.getVersion(), not(equalTo(UNKNOWN_VERSION)));
}
}
代码示例来源:origin: batfish/batfish
private Builder getTarget(String network, String snapshot, String key) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.path(snapshot)
.path(CoordConstsV2.RSC_OBJECTS)
.queryParam(QP_KEY, key)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getQuestionSettingsTarget(String questionClass) {
return target(SVC_CFG_WORK_MGR2)
.path(RSC_NETWORKS)
.path(NETWORK)
.path(RSC_SETTINGS)
.path(RSC_QUESTIONS)
.path(questionClass)
.request()
.header(HTTP_HEADER_BATFISH_APIKEY, DEFAULT_API_KEY)
.header(HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getTargetAnalysis(String network, String analysis) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_ANALYSES)
.path(analysis)
.path(CoordConstsV2.RSC_QUESTIONS)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getNodeRolesTarget(String network, String snapshot, boolean inferred) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.path(snapshot)
.path(inferred ? CoordConstsV2.RSC_INFERRED_NODE_ROLES : CoordConstsV2.RSC_NODE_ROLES)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getQuestionTargetAnalysis(String network, String question, String analysis) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_ANALYSES)
.path(analysis)
.path(CoordConstsV2.RSC_QUESTIONS)
.path(question)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getPojoTopologyTarget(String network, String snapshot) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.path(snapshot)
.path(CoordConstsV2.RSC_POJO_TOPOLOGY)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getAddressBookTarget(String container, String bookName) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(container)
.path(CoordConstsV2.RSC_REFERENCE_LIBRARY)
.path(bookName)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getTopologyTarget(String network, String snapshot) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.path(snapshot)
.path(CoordConstsV2.RSC_TOPOLOGY)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getTarget(String network, boolean verbose) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.queryParam(CoordConstsV2.QP_VERBOSE, verbose)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getQuestionTargetAdHoc(String network, String question) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_QUESTIONS)
.path(question)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getIssueSettingsTarget(String network) {
return target(SVC_CFG_WORK_MGR2)
.path(RSC_NETWORKS)
.path(network)
.path(RSC_SETTINGS)
.path(RSC_ISSUES)
.request()
.header(HTTP_HEADER_BATFISH_APIKEY, DEFAULT_API_KEY)
.header(HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getWorkItemTarget(String network, String workId) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_WORK)
.path(workId)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getTarget(String network, String snapshot) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_SNAPSHOTS)
.path(snapshot)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getTarget(String network, String key) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_OBJECTS)
.queryParam(QP_KEY, key)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
private Builder getReferenceLibraryTarget(String network) {
return target(CoordConsts.SVC_CFG_WORK_MGR2)
.path(CoordConstsV2.RSC_NETWORKS)
.path(network)
.path(CoordConstsV2.RSC_REFERENCE_LIBRARY)
.request()
.header(CoordConstsV2.HTTP_HEADER_BATFISH_APIKEY, CoordConsts.DEFAULT_API_KEY)
.header(CoordConstsV2.HTTP_HEADER_BATFISH_VERSION, Version.getVersion());
}
代码示例来源:origin: batfish/batfish
@Test
public void testValidVersion() {
Response response =
target("/test").request().header(HTTP_HEADER_BATFISH_VERSION, Version.getVersion()).get();
assertThat(response.getStatus(), equalTo(OK.getStatusCode()));
}
}
代码示例来源:origin: batfish/batfish
private Answer serializeEnvironmentRoutingTables(Path inputPath, Path outputPath) {
Answer answer = new Answer();
ParseEnvironmentRoutingTablesAnswerElement answerElement =
new ParseEnvironmentRoutingTablesAnswerElement();
answerElement.setVersion(Version.getVersion());
answer.addAnswerElement(answerElement);
SortedMap<String, RoutesByVrf> routingTables =
getEnvironmentRoutingTables(inputPath, answerElement);
serializeEnvironmentRoutingTables(routingTables, outputPath);
serializeObject(answerElement, _testrigSettings.getParseEnvironmentRoutingTablesAnswerPath());
return answer;
}
内容来源于网络,如有侵权,请联系作者删除!