(cli *client, options *CreateOptions)
| 156 | } |
| 157 | |
| 158 | func createShard(cli *client, options *CreateOptions) error { |
| 159 | rsp, err := cli.restyCli.R(). |
| 160 | SetPathParam("namespace", options.namespace). |
| 161 | SetPathParam("cluster", options.cluster). |
| 162 | SetBody(map[string]interface{}{ |
| 163 | "name": options.cluster, |
| 164 | "nodes": options.nodes, |
| 165 | "password": options.password, |
| 166 | }). |
| 167 | Post("/namespaces/{namespace}/clusters/{cluster}/shards") |
| 168 | if err != nil { |
| 169 | return err |
| 170 | } |
| 171 | |
| 172 | if rsp.IsError() { |
| 173 | return unmarshalError(rsp.Body()) |
| 174 | } |
| 175 | printLine("create the new shard successfully.") |
| 176 | return nil |
| 177 | } |
| 178 | |
| 179 | func createNodes(cli *client, options *CreateOptions) error { |
| 180 | rsp, err := cli.restyCli.R(). |
no test coverage detected