(asyncAPI schema.APIResponse, env cliconfig.Environment)
| 56 | } |
| 57 | |
| 58 | func asyncDescribeAPITable(asyncAPI schema.APIResponse, env cliconfig.Environment) (string, error) { |
| 59 | if asyncAPI.Metadata == nil { |
| 60 | return "", errors.ErrorUnexpected("missing metadata from operator response") |
| 61 | } |
| 62 | |
| 63 | if asyncAPI.Status == nil { |
| 64 | return "", errors.ErrorUnexpected(fmt.Sprintf("missing status for %s api", asyncAPI.Metadata.Name)) |
| 65 | } |
| 66 | |
| 67 | t := asyncAPIsTable([]schema.APIResponse{asyncAPI}, []string{env.Name}) |
| 68 | out := t.MustFormat() |
| 69 | |
| 70 | if asyncAPI.DashboardURL != nil && *asyncAPI.DashboardURL != "" { |
| 71 | out += "\n" + console.Bold("metrics dashboard: ") + *asyncAPI.DashboardURL + "\n" |
| 72 | } |
| 73 | |
| 74 | if asyncAPI.Endpoint != nil { |
| 75 | out += "\n" + console.Bold("endpoint: ") + *asyncAPI.Endpoint + "\n" |
| 76 | } |
| 77 | |
| 78 | t = replicaCountTable(asyncAPI.Status.ReplicaCounts) |
| 79 | out += "\n" + t.MustFormat() |
| 80 | |
| 81 | return out, nil |
| 82 | } |
| 83 | |
| 84 | func asyncAPIsTable(asyncAPIs []schema.APIResponse, envNames []string) table.Table { |
| 85 | rows := make([][]interface{}, 0, len(asyncAPIs)) |
no test coverage detected