getServerVersionV2()
This operation gets server version information. Use detail(true) when you need build time, Git commit, Go version, and deploy mode in addition to the version string.
public GetServerVersionResp getServerVersionV2(GetServerVersionReq request)
Request Syntax
getServerVersionV2(GetServerVersionReq.builder()
.detail(Boolean detail)
.build());
BUILDER METHODS:
-
detail(Boolean detail)Whether to fetch detailed server build information. Defaults to
Boolean.FALSE.
RETURN TYPE:
GetServerVersionResp
RETURNS:
A GetServerVersionResp object that contains the version information of the connected Milvus server. The object exposes the following getters:
-
getVersion()(String) -The version of the Milvus server.
-
getBuildTime()(String) -The build time of the server.
-
getGitCommit()(String) -The git commit of the server build.
-
getGoVersion()(String) -The Go version used to build the server.
-
getDeployMode()(String) -The deployment mode of the server.
EXCEPTIONS:
-
MilvusClientException
This exception will be raised when validation fails or the server returns an error for this operation.
Example
import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.service.utility.request.GetServerVersionReq;
import io.milvus.v2.service.utility.response.GetServerVersionResp;
ConnectConfig connectConfig = ConnectConfig.builder()
.uri("http://localhost:19530")
.token("root:Milvus")
.build();
MilvusClientV2 client = new MilvusClientV2(connectConfig);
GetServerVersionResp version = client.getServerVersionV2(GetServerVersionReq.builder()
.detail(true)
.build());
System.out.println(version.getVersion());
System.out.println(version.getGitCommit());