@@ -4,12 +4,18 @@ import (
4
4
"github.com/scaleway/scaleway-cli/v2/internal/core"
5
5
)
6
6
7
+ const id = ".ID }}"
8
+
7
9
// createServerAndWait creates a baremetal instance
8
10
// register it in the context Meta at metaKey.
9
11
func createServerAndWait (metaKey string ) core.BeforeFunc {
10
12
return core .ExecStoreBeforeCmd (metaKey , "scw baremetal server create zone=nl-ams-1 type=GP-BM2-S -w" )
11
13
}
12
14
15
+ func createServerAndWaitDefault (metaKey string ) core.BeforeFunc {
16
+ return core .ExecStoreBeforeCmd (metaKey , "scw baremetal server create type=EM-B112X-SSD -w" )
17
+ }
18
+
13
19
func createServer (metaKey string ) core.BeforeFunc {
14
20
return core .ExecStoreBeforeCmd (metaKey , "scw baremetal server create zone=nl-ams-1 type=GP-BM2-S" )
15
21
}
@@ -19,7 +25,11 @@ func createServer(metaKey string) core.BeforeFunc {
19
25
//
20
26
//nolint:unparam
21
27
func deleteServer (metaKey string ) core.AfterFunc {
22
- return core .ExecAfterCmd ("scw baremetal server delete zone=nl-ams-1 {{ ." + metaKey + ".ID }}" )
28
+ return core .ExecAfterCmd ("scw baremetal server delete zone=nl-ams-1 {{ ." + metaKey + id )
29
+ }
30
+
31
+ func deleteServerDefault (metaKey string ) core.AfterFunc {
32
+ return core .ExecAfterCmd ("scw baremetal server delete {{ ." + metaKey + id )
23
33
}
24
34
25
35
// add an ssh key with a given meta key
@@ -34,5 +44,5 @@ func addSSH(metaKey string, key string) core.BeforeFunc {
34
44
35
45
// delete an ssh key with a given meta key
36
46
func deleteSSH (metaKey string ) core.AfterFunc {
37
- return core .ExecAfterCmd ("scw iam ssh-key delete {{ ." + metaKey + ".ID }}" )
47
+ return core .ExecAfterCmd ("scw iam ssh-key delete {{ ." + metaKey + id )
38
48
}
0 commit comments