Skip to content

Commit cbedb69

Browse files
authored
Merge branch 'master' into v1.6635.0
2 parents caa9a2d + 34fc155 commit cbedb69

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

internal/namespaces/instance/v1/instance_cli.go

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func GetGeneratedCommands() *core.Commands {
4343
instanceUserDataSet(),
4444
instanceUserDataGet(),
4545
instanceServerGetCompatibleTypes(),
46+
instanceServerAttachFilesystem(),
47+
instanceServerDetachFilesystem(),
4648
instanceImageList(),
4749
instanceImageGet(),
4850
instanceImageCreate(),
@@ -1142,6 +1144,96 @@ If the specified Instance offer is flagged as end of service, the best compatibl
11421144
}
11431145
}
11441146

1147+
func instanceServerAttachFilesystem() *core.Command {
1148+
return &core.Command{
1149+
Short: `Attach a filesystem volume to an Instance`,
1150+
Long: `Attach a filesystem volume to an Instance.`,
1151+
Namespace: "instance",
1152+
Resource: "server",
1153+
Verb: "attach-filesystem",
1154+
// Deprecated: false,
1155+
ArgsType: reflect.TypeOf(instance.AttachServerFileSystemRequest{}),
1156+
ArgSpecs: core.ArgSpecs{
1157+
{
1158+
Name: "server-id",
1159+
Required: true,
1160+
Deprecated: false,
1161+
Positional: false,
1162+
},
1163+
{
1164+
Name: "filesystem-id",
1165+
Required: false,
1166+
Deprecated: false,
1167+
Positional: false,
1168+
},
1169+
core.ZoneArgSpec(
1170+
scw.ZoneFrPar1,
1171+
scw.ZoneFrPar2,
1172+
scw.ZoneFrPar3,
1173+
scw.ZoneNlAms1,
1174+
scw.ZoneNlAms2,
1175+
scw.ZoneNlAms3,
1176+
scw.ZonePlWaw1,
1177+
scw.ZonePlWaw2,
1178+
scw.ZonePlWaw3,
1179+
),
1180+
},
1181+
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
1182+
request := args.(*instance.AttachServerFileSystemRequest)
1183+
1184+
client := core.ExtractClient(ctx)
1185+
api := instance.NewAPI(client)
1186+
1187+
return api.AttachServerFileSystem(request)
1188+
},
1189+
}
1190+
}
1191+
1192+
func instanceServerDetachFilesystem() *core.Command {
1193+
return &core.Command{
1194+
Short: `Detach a filesystem volume to an Instance`,
1195+
Long: `Detach a filesystem volume to an Instance.`,
1196+
Namespace: "instance",
1197+
Resource: "server",
1198+
Verb: "detach-filesystem",
1199+
// Deprecated: false,
1200+
ArgsType: reflect.TypeOf(instance.DetachServerFileSystemRequest{}),
1201+
ArgSpecs: core.ArgSpecs{
1202+
{
1203+
Name: "server-id",
1204+
Required: true,
1205+
Deprecated: false,
1206+
Positional: false,
1207+
},
1208+
{
1209+
Name: "filesystem-id",
1210+
Required: false,
1211+
Deprecated: false,
1212+
Positional: false,
1213+
},
1214+
core.ZoneArgSpec(
1215+
scw.ZoneFrPar1,
1216+
scw.ZoneFrPar2,
1217+
scw.ZoneFrPar3,
1218+
scw.ZoneNlAms1,
1219+
scw.ZoneNlAms2,
1220+
scw.ZoneNlAms3,
1221+
scw.ZonePlWaw1,
1222+
scw.ZonePlWaw2,
1223+
scw.ZonePlWaw3,
1224+
),
1225+
},
1226+
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
1227+
request := args.(*instance.DetachServerFileSystemRequest)
1228+
1229+
client := core.ExtractClient(ctx)
1230+
api := instance.NewAPI(client)
1231+
1232+
return api.DetachServerFileSystem(request)
1233+
},
1234+
}
1235+
}
1236+
11451237
func instanceImageList() *core.Command {
11461238
return &core.Command{
11471239
Short: `List Instance images`,

0 commit comments

Comments
 (0)