MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / migrateSlot

Function migrateSlot

cmd/client/command/migrate.go:91–109  ·  view source on GitHub ↗
(client *client, options *MigrationOptions)

Source from the content-addressed store, hash-verified

89}
90
91func migrateSlot(client *client, options *MigrationOptions) error {
92 rsp, err := client.restyCli.R().
93 SetPathParam("namespace", options.namespace).
94 SetPathParam("cluster", options.cluster).
95 SetBody(map[string]interface{}{
96 "slot": options.slot,
97 "target": options.target,
98 "slotOnly": strconv.FormatBool(options.slotOnly),
99 }).
100 Post("/namespaces/{namespace}/clusters/{cluster}/migrate")
101 if err != nil {
102 return err
103 }
104 if rsp.IsError() {
105 return errors.New(rsp.String())
106 }
107 printLine("migrate slot[%s] task is submitted successfully.", options.slot)
108 return nil
109}
110
111func init() {
112 MigrateCommand.Flags().StringVar(&migrateOptions.slot, "slot", "", "The slot to migrate")

Callers 1

migrate.goFile · 0.70

Calls 2

printLineFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected