CreateResourceGroup()
This method creates a resource group.
func (c *Client) CreateResourceGroup(ctx context.Context, opt CreateResourceGroupOption, callOptions ...grpc.CallOption) error
notes
A Milvus instance begins with a default resource group that includes all available query nodes.
To optimize resource utilization, you can create additional resource groups, reassign specific query nodes from the default group, and load collections into these newly configured groups.
This approach ensures that collections are allocated dedicated query nodes, enabling efficient and isolated search services.
For details about resource groups, refer to Manage Resource Group.
Request Parameters
Parameter |
Description |
Type |
---|---|---|
|
Context for the current call to work. |
|
|
Optional parameters of the methods. |
|
|
Optional parameters for calling the methods. |
|
CreateResourceGroupOption
This is an interface type. The createResourceGroupOption
struct type implements this interface type.
You can use the NewCreateResourceGroupOption()
function to get the concrete implementation.
NewCreateResourceGroupOption
The signature of this method is as follows:
func NewCreateResourceGroupOption(name string) *createResourceGroupOption
Parameter |
Description |
Type |
---|---|---|
|
Name of the target resource group. |
|
Return
Null
Example
import (
"context"
"github.com/milvus-io/milvus/client/v2/milvusclient"
)
err = cli.CreateResourceGroup(ctx, milvusclient.NewCreateResourceGroupOption("my_rg"))
if err != nil {
// handle error
}