summaryrefslogtreecommitdiff
path: root/op-mode-definitions/containers.xml.in
blob: 94dd24369acc7ca0f48b6719b221a353e0730bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0"?>
<interfaceDefinition>
  <node name="add">
    <children>
      <node name="container">
        <properties>
          <help>Add container image</help>
        </properties>
        <children>
          <tagNode name="image">
            <properties>
              <help>Pull a new image for container</help>
            </properties>
            <command>sudo ${vyos_op_scripts_dir}/containers_op.py --pull "${4}"</command>
          </tagNode>
        </children>
      </node>
    </children>
  </node>
  <node name="connect">
    <children>
      <tagNode name="container">
        <properties>
          <help>Attach to a running container</help>
          <completionHelp>
            <path>container name</path>
          </completionHelp>
        </properties>
        <command>echo "Use Ctrl+p and Ctrl+q to detach"; sudo podman attach "$3"</command>
      </tagNode>
    </children>
  </node>
  <node name="delete">
    <children>
      <node name="container">
        <properties>
          <help>Delete container image</help>
        </properties>
        <children>
          <tagNode name="image">
            <properties>
              <help>Delete container image</help>
            </properties>
            <command>sudo ${vyos_op_scripts_dir}/containers_op.py --remove "${4}"</command>
          </tagNode>
        </children>
      </node>
    </children>
  </node>
  <node name="show">
    <children>
      <node name="container">
        <properties>
          <help>Show containers</help>
        </properties>
        <command>sudo ${vyos_op_scripts_dir}/containers_op.py --all</command>
        <children>
          <leafNode name="image">
            <properties>
              <help>Delete container image</help>
            </properties>
            <command>sudo ${vyos_op_scripts_dir}/containers_op.py --image</command>
          </leafNode>
          <leafNode name="network">
            <properties>
              <help>Show available container networks</help>
            </properties>
            <command>sudo ${vyos_op_scripts_dir}/containers_op.py --networks</command>
          </leafNode>
        </children>
      </node>
    </children>
  </node>
  <node name="restart">
    <children>
      <tagNode name="container">
        <properties>
          <help>Restart a given container</help>
          <completionHelp>
            <path>container name</path>
          </completionHelp>
        </properties>
        <command>sudo podman restart "$3"</command>
      </tagNode>
    </children>
  </node>
</interfaceDefinition>