(cli *client, options *CreateOptions)
| 135 | } |
| 136 | |
| 137 | func createCluster(cli *client, options *CreateOptions) error { |
| 138 | rsp, err := cli.restyCli.R(). |
| 139 | SetPathParam("namespace", options.namespace). |
| 140 | SetBody(map[string]interface{}{ |
| 141 | "name": options.cluster, |
| 142 | "replicas": options.replica, |
| 143 | "nodes": options.nodes, |
| 144 | "password": options.password, |
| 145 | }). |
| 146 | Post("/namespaces/{namespace}/clusters") |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | |
| 151 | if rsp.IsError() { |
| 152 | return unmarshalError(rsp.Body()) |
| 153 | } |
| 154 | printLine("create cluster: %s successfully.", options.cluster) |
| 155 | return nil |
| 156 | } |
| 157 | |
| 158 | func createShard(cli *client, options *CreateOptions) error { |
| 159 | rsp, err := cli.restyCli.R(). |
no test coverage detected