(client *client, options *GetOptions)
| 75 | } |
| 76 | |
| 77 | func getCluster(client *client, options *GetOptions) error { |
| 78 | rsp, err := client.restyCli.R().SetPathParams(map[string]string{ |
| 79 | "namespace": options.namespace, |
| 80 | "cluster": options.cluster, |
| 81 | }).Get("/namespaces/{namespace}/clusters/{cluster}") |
| 82 | if err != nil { |
| 83 | return err |
| 84 | } |
| 85 | if rsp.IsError() { |
| 86 | return unmarshalError(rsp.Body()) |
| 87 | } |
| 88 | |
| 89 | var result struct { |
| 90 | Cluster *store.Cluster `json:"cluster"` |
| 91 | } |
| 92 | if err := unmarshalData(rsp.Body(), &result); err != nil { |
| 93 | return err |
| 94 | } |
| 95 | printCluster(result.Cluster) |
| 96 | return nil |
| 97 | } |
| 98 | |
| 99 | func init() { |
| 100 | GetCommand.Flags().StringVarP(&getOptions.namespace, "namespace", "n", "", "The namespace of the resource") |
no test coverage detected