@@ -33,6 +33,7 @@ func GetGeneratedCommands() *core.Commands {
3333 k8sClusterSetType (),
3434 k8sClusterListAvailableVersions (),
3535 k8sClusterResetAdminToken (),
36+ k8sClusterMigrateToPrivateNetwork (),
3637 k8sPoolList (),
3738 k8sPoolCreate (),
3839 k8sPoolGet (),
@@ -1122,6 +1123,49 @@ func k8sClusterResetAdminToken() *core.Command {
11221123 }
11231124}
11241125
1126+ func k8sClusterMigrateToPrivateNetwork () * core.Command {
1127+ return & core.Command {
1128+ Short : `Migrate an existing cluster to a Private Network cluster` ,
1129+ Long : `Migrate a cluster that was created before the release of Private Network clusters to a new one with a Private Network.` ,
1130+ Namespace : "k8s" ,
1131+ Resource : "cluster" ,
1132+ Verb : "migrate-to-private-network" ,
1133+ // Deprecated: false,
1134+ ArgsType : reflect .TypeOf (k8s.MigrateToPrivateNetworkClusterRequest {}),
1135+ ArgSpecs : core.ArgSpecs {
1136+ {
1137+ Name : "cluster-id" ,
1138+ Short : `ID of the cluster to migrate` ,
1139+ Required : true ,
1140+ Deprecated : false ,
1141+ Positional : true ,
1142+ },
1143+ {
1144+ Name : "private-network-id" ,
1145+ Short : `ID of the Private Network to link to the cluster` ,
1146+ Required : true ,
1147+ Deprecated : false ,
1148+ Positional : false ,
1149+ },
1150+ core .RegionArgSpec (scw .RegionFrPar , scw .RegionNlAms , scw .RegionPlWaw ),
1151+ },
1152+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
1153+ request := args .(* k8s.MigrateToPrivateNetworkClusterRequest )
1154+
1155+ client := core .ExtractClient (ctx )
1156+ api := k8s .NewAPI (client )
1157+ return api .MigrateToPrivateNetworkCluster (request )
1158+
1159+ },
1160+ Examples : []* core.Example {
1161+ {
1162+ Short : "Migrate a cluster to a Private Network cluster" ,
1163+ Raw : `scw k8s cluster migrate-to-private-network 11111111-1111-1111-111111111111 private-network-id=11111111-1111-1111-111111111111` ,
1164+ },
1165+ },
1166+ }
1167+ }
1168+
11251169func k8sPoolList () * core.Command {
11261170 return & core.Command {
11271171 Short : `List Pools in a Cluster` ,
0 commit comments