mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-05-31 13:00:41 +08:00
rebase master
This commit is contained in:
@@ -26,6 +26,10 @@ func init() {
|
||||
ID string
|
||||
}
|
||||
|
||||
shellutils.R(&InstanceOperation{}, "instance-delete", "Delete instance", func(cli *zstack.SRegion, args *InstanceOperation) error {
|
||||
return cli.DeleteVM(args.ID)
|
||||
})
|
||||
|
||||
shellutils.R(&InstanceOperation{}, "instance-console-password", "Show instance console password", func(cli *zstack.SRegion, args *InstanceOperation) error {
|
||||
password, err := cli.GetInstanceConsolePassword(args.ID)
|
||||
if err != nil {
|
||||
@@ -44,4 +48,35 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
shellutils.R(&InstanceOperation{}, "instance-start", "Start instance", func(cli *zstack.SRegion, args *InstanceOperation) error {
|
||||
return cli.StartVM(args.ID)
|
||||
})
|
||||
|
||||
shellutils.R(&InstanceOperation{}, "instance-boot-order", "Show instance boot order", func(cli *zstack.SRegion, args *InstanceOperation) error {
|
||||
fmt.Println(cli.GetBootOrder(args.ID))
|
||||
return nil
|
||||
})
|
||||
|
||||
type InstanceStopOption struct {
|
||||
ID string
|
||||
IsForce bool
|
||||
}
|
||||
|
||||
shellutils.R(&InstanceStopOption{}, "instance-stop", "Start instance", func(cli *zstack.SRegion, args *InstanceStopOption) error {
|
||||
return cli.StopVM(args.ID, args.IsForce)
|
||||
})
|
||||
|
||||
type InstanceSecgroupOption struct {
|
||||
ID string
|
||||
SECGRPID string
|
||||
}
|
||||
|
||||
shellutils.R(&InstanceSecgroupOption{}, "instance-assign-secgroup", "Assign secgroup for a instance", func(cli *zstack.SRegion, args *InstanceSecgroupOption) error {
|
||||
return cli.AssignSecurityGroup(args.ID, args.SECGRPID)
|
||||
})
|
||||
|
||||
shellutils.R(&InstanceSecgroupOption{}, "instance-revoke-secgroup", "Assign secgroup for a instance", func(cli *zstack.SRegion, args *InstanceSecgroupOption) error {
|
||||
return cli.RevokeSecurityGroup(args.ID, args.SECGRPID)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user