mirror of
https://github.com/compute-blade-community/compute-blade-agent.git
synced 2026-04-21 17:45:43 +02:00
* chore: update repository references from uptime-industries to compute-blade-community chore: update repository references from uptime-industries to compute-blade-community for consistency and clarity across all files fix: update links in CHANGELOG.md and README.md to point to the new repository location for accurate documentation fix: update Dockerfile and systemd service file to reflect the new repository URL for proper source tracking refactor: change import paths in Go files to use the new repository name for correct package referencing * chore: Add CODEOWNERS * feat: add auto-labeling --------- Co-authored-by: Cedric Kienzler <cedric@specht-labs.de>
39 lines
803 B
Go
39 lines
803 B
Go
package main
|
|
|
|
import (
|
|
bladeapiv1alpha1 "github.com/compute-blade-community/compute-blade-agent/api/bladeapi/v1alpha1"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
percent int
|
|
)
|
|
|
|
func init() {
|
|
cmdFan.Flags().IntVarP(&percent, "percent", "p", 40, "Fan speed in percent (Default: 40).")
|
|
_ = cmdFan.MarkFlagRequired("percent")
|
|
|
|
cmdSet.AddCommand(cmdFan)
|
|
}
|
|
|
|
var (
|
|
cmdFan = &cobra.Command{
|
|
Use: "fan",
|
|
Short: "Control the fan behavior of the compute-blade",
|
|
Example: "bladectl set fan --percent 50",
|
|
Args: cobra.ExactArgs(0),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
var err error
|
|
|
|
ctx := cmd.Context()
|
|
client := clientFromContext(ctx)
|
|
|
|
_, err = client.SetFanSpeed(ctx, &bladeapiv1alpha1.SetFanSpeedRequest{
|
|
Percent: int64(percent),
|
|
})
|
|
|
|
return err
|
|
},
|
|
}
|
|
)
|