Skip to main content
Glama
services.go2.11 kB
package kiali import ( "context" "fmt" "net/http" "net/url" ) // ServicesList returns the list of services across specified namespaces. func (k *Kiali) ServicesList(ctx context.Context, namespaces string) (string, error) { endpoint := ServicesEndpoint + "?health=true&istioResources=true&rateInterval=60s&onlyDefinitions=false" if namespaces != "" { endpoint += "&namespaces=" + url.QueryEscape(namespaces) } return k.executeRequest(ctx, http.MethodGet, endpoint, "", nil) } // ServiceDetails returns the details for a specific service in a namespace. func (k *Kiali) ServiceDetails(ctx context.Context, namespace string, service string) (string, error) { if namespace == "" { return "", fmt.Errorf("namespace is required") } if service == "" { return "", fmt.Errorf("service name is required") } endpoint := fmt.Sprintf(ServiceDetailsEndpoint, url.PathEscape(namespace), url.PathEscape(service)) + "?validate=true&rateInterval=60s" return k.executeRequest(ctx, http.MethodGet, endpoint, "", nil) } // ServiceMetrics returns the metrics for a specific service in a namespace. // Parameters: // - namespace: the namespace containing the service // - service: the name of the service // - queryParams: optional query parameters map for filtering metrics (e.g., "duration", "step", "rateInterval", "direction", "reporter", "filters[]", "byLabels[]", etc.) func (k *Kiali) ServiceMetrics(ctx context.Context, namespace string, service string, queryParams map[string]string) (string, error) { if namespace == "" { return "", fmt.Errorf("namespace is required") } if service == "" { return "", fmt.Errorf("service name is required") } endpoint := fmt.Sprintf(ServiceMetricsEndpoint, url.PathEscape(namespace), url.PathEscape(service)) // Add query parameters if provided if len(queryParams) > 0 { u, err := url.Parse(endpoint) if err != nil { return "", err } q := u.Query() for key, value := range queryParams { q.Set(key, value) } u.RawQuery = q.Encode() endpoint = u.String() } return k.executeRequest(ctx, http.MethodGet, endpoint, "", nil) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/containers/kubernetes-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server