QueryCPUModel returns a CPUModel for the specified model name.
(model string)
| 199 | |
| 200 | // QueryCPUModel returns a CPUModel for the specified model name. |
| 201 | func (m *Monitor) QueryCPUModel(model string) (*CPUModel, error) { |
| 202 | // Prepare the response. |
| 203 | var resp struct { |
| 204 | Return struct { |
| 205 | Model CPUModel `json:"model"` |
| 206 | } `json:"return"` |
| 207 | } |
| 208 | |
| 209 | args := map[string]any{ |
| 210 | "model": map[string]string{"name": model}, |
| 211 | "type": "full", |
| 212 | } |
| 213 | |
| 214 | err := m.Run("query-cpu-model-expansion", args, &resp) |
| 215 | if err != nil { |
| 216 | return nil, fmt.Errorf("Failed to query CPU model: %w", err) |
| 217 | } |
| 218 | |
| 219 | return &resp.Return.Model, nil |
| 220 | } |
| 221 | |
| 222 | // Status returns the current VM status. |
| 223 | func (m *Monitor) Status() (string, error) { |
no test coverage detected