GetServerVersion
This operation returns the version of the connected Milvus server.
go
func (c *Client) GetServerVersion(ctx context.Context, option GetServerVersionOption, callOptions ...grpc.CallOption) (string, error)
Request Syntax
Creates the request for GetServerVersion().
go
option := milvusclient.NewGetServerVersionOption()
version, err := client.GetServerVersion(ctx, option)
BUILDER METHODS:
-
NewGetServerVersionOption()Creates the request for GetServerVersion().
RETURN TYPE:
string, error
RETURNS:
The requested string value. Returns an error if the operation fails.
PARAMETERS:
-
result (string) -
The string value returned by GetServerVersion().
ERROR HANDLING:
-
error
The operation fails. Check
err != nilfor failure details.
Example
Demonstrates GetServerVersion() usage.
go
import (
"context"
"fmt"
"log"
"github.com/milvus-io/milvus/client/v3/milvusclient"
)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
Address: "YOUR_CLUSTER_ENDPOINT",
})
if err != nil {
log.Fatal("failed to create client:", err)
}
defer cli.Close(ctx)
version, err := cli.GetServerVersion(ctx, milvusclient.NewGetServerVersionOption())
if err != nil {
log.Fatal("failed to get server version:", err)
}
fmt.Println(version)