(client *client, options *MigrationOptions)
| 89 | } |
| 90 | |
| 91 | func 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 | |
| 111 | func init() { |
| 112 | MigrateCommand.Flags().StringVar(&migrateOptions.slot, "slot", "", "The slot to migrate") |
no test coverage detected