Files
telecom-platform/apps/cli/internal/api/services.go
T
nutcas3 bd3226edf0 feat: Refactor CLI API client by splitting billing, carrier, and charging modules into separate files
- Extract Invoice, Payment, Subscriber types and GetInvoices, GetPayments, GenerateInvoice methods to billing.go
- Extract CarrierInfo, ConnectivityStatus, ProfileInfo types and carrier connector methods to carrier.go
- Extract CreditCheckRequest/Response, CreditBalanceResponse types and charging engine methods to charging.go
- Add PacketStats, CreditInfo types and GetPacketStats, GetCreditInfo
2026-04-25 05:33:41 +03:00

28 lines
713 B
Go

package api
// Service describes a platform service
type Service struct {
Name string `json:"name"`
Status string `json:"status"`
Version string `json:"version"`
Uptime string `json:"uptime"`
CPU float64 `json:"cpu"`
Memory string `json:"memory"`
}
// PostRestart requests the API to restart the named service.
func (c *Client) PostRestart(name string) error {
return c.doPostJSON("/api/v1/services/"+name+"/restart", nil, nil)
}
// ListServices returns platform services
func (c *Client) ListServices() ([]Service, error) {
var resp struct {
Data []Service `json:"data"`
}
if err := c.doGetJSON("/api/v1/services", &resp); err != nil {
return nil, err
}
return resp.Data, nil
}