(env cliconfig.Environment, apiName string)
| 91 | } |
| 92 | |
| 93 | func describeAPI(env cliconfig.Environment, apiName string) (string, error) { |
| 94 | apisRes, err := cluster.DescribeAPI(MustGetOperatorConfig(env.Name), apiName) |
| 95 | if err != nil { |
| 96 | return "", err |
| 97 | } |
| 98 | |
| 99 | if len(apisRes) == 0 { |
| 100 | exit.Error(errors.ErrorUnexpected(fmt.Sprintf("unable to find api %s", apiName))) |
| 101 | } |
| 102 | |
| 103 | apiRes := apisRes[0] |
| 104 | |
| 105 | switch apiRes.Metadata.Kind { |
| 106 | case userconfig.RealtimeAPIKind: |
| 107 | return realtimeDescribeAPITable(apiRes, env) |
| 108 | case userconfig.AsyncAPIKind: |
| 109 | return asyncDescribeAPITable(apiRes, env) |
| 110 | default: |
| 111 | return "", errors.ErrorUnexpected(fmt.Sprintf("encountered unexpected kind %s for api %s", apiRes.Metadata.Kind, apiRes.Metadata.Name)) |
| 112 | } |
| 113 | } |
no test coverage detected