api/maintenance.go
func (a *API) CreateMaintenanceWindow(cfg *Maintenance) (*Maintenance, error) {
	if cfg == nil {
		return nil, fmt.Errorf("Invalid maintenance window config [nil]")
	}

	jsonCfg, err := json.Marshal(cfg)
	if err != nil {
		return nil, err
	}

	if a.Debug {
		a.Log.Printf("[DEBUG] create maintenance window, sending JSON: %s", string(jsonCfg))
	}

	result, err := a.Post(config.MaintenancePrefix, jsonCfg)
	if err != nil {
		return nil, err
	}

	window := &Maintenance{}
	if err := json.Unmarshal(result, window); err != nil {
		return nil, err
	}

	return window, nil
}
func (a *API) CreateMaintenanceWindow(cfg *Maintenance) (*Maintenance, error) {
	if cfg == nil {
		return nil, fmt.Errorf("Invalid maintenance window config [nil]")
	}

	jsonCfg, err := json.Marshal(cfg)
	if err != nil {
		return nil, err
	}

	if a.Debug {
		a.Log.Printf("[DEBUG] create maintenance window, sending JSON: %s", string(jsonCfg))
	}

	result, err := a.Post(config.MaintenancePrefix, jsonCfg)
	if err != nil {
		return nil, err
	}

	window := &Maintenance{}
	if err := json.Unmarshal(result, window); err != nil {
		return nil, err
	}

	return window, nil
}
// CreateMaintenanceWindow creates a new maintenance [window].