feat(hostinger): VPS resource metrics modal — CPU, RAM, disco, tráfico, uptime
This commit is contained in:
@@ -382,8 +382,10 @@ func (c *HostingerClient) SetVPSHostname(vmID int, hostname string) error {
|
||||
}
|
||||
|
||||
// GetVPSMetrics obtiene las métricas de uso de una VM.
|
||||
func (c *HostingerClient) GetVPSMetrics(vmID int) (json.RawMessage, error) {
|
||||
path := fmt.Sprintf("/vps/v1/virtual-machines/%d/metrics", vmID)
|
||||
// dateFrom y dateTo deben estar en formato RFC3339, p. ej. "2025-01-01T00:00:00Z".
|
||||
func (c *HostingerClient) GetVPSMetrics(vmID int, dateFrom, dateTo string) (json.RawMessage, error) {
|
||||
path := fmt.Sprintf("/vps/v1/virtual-machines/%d/metrics?date_from=%s&date_to=%s",
|
||||
vmID, dateFrom, dateTo)
|
||||
body, err := c.getRaw(context.Background(), path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user