|
| 1 | +class ContainerDriver(object): |
| 2 | + '''Base class for container drivers.''' |
| 3 | + |
| 4 | + def create(self, context, container, sandbox_name=None): |
| 5 | + """Create a container.""" |
| 6 | + raise NotImplementedError() |
| 7 | + |
| 8 | + def delete(self, container, force): |
| 9 | + """Delete a container.""" |
| 10 | + raise NotImplementedError() |
| 11 | + |
| 12 | + def list(self): |
| 13 | + """List all containers.""" |
| 14 | + raise NotImplementedError() |
| 15 | + |
| 16 | + def show(self, container): |
| 17 | + """Show the details of a container.""" |
| 18 | + raise NotImplementedError() |
| 19 | + |
| 20 | + def reboot(self, container): |
| 21 | + """Reboot a container.""" |
| 22 | + raise NotImplementedError() |
| 23 | + |
| 24 | + def stop(self, container): |
| 25 | + """Stop a container.""" |
| 26 | + raise NotImplementedError() |
| 27 | + |
| 28 | + def start(self, container): |
| 29 | + """Start a container.""" |
| 30 | + raise NotImplementedError() |
| 31 | + |
| 32 | + def pause(self, container): |
| 33 | + """Pause a container.""" |
| 34 | + raise NotImplementedError() |
| 35 | + |
| 36 | + def unpause(self, container): |
| 37 | + """Pause a container.""" |
| 38 | + raise NotImplementedError() |
| 39 | + |
| 40 | + def show_logs(self, container): |
| 41 | + """Show logs of a container.""" |
| 42 | + raise NotImplementedError() |
| 43 | + |
| 44 | + def execute(self, container, command): |
| 45 | + """Execute a command in a running container.""" |
| 46 | + raise NotImplementedError() |
| 47 | + |
| 48 | + def kill(self, container, signal): |
| 49 | + """kill signal to a container.""" |
| 50 | + raise NotImplementedError() |
| 51 | + |
| 52 | + def create_sandbox(self, context, container, **kwargs): |
| 53 | + """Create a sandbox.""" |
| 54 | + raise NotImplementedError() |
| 55 | + |
| 56 | + def delete_sandbox(self, context, sandbox_id): |
| 57 | + """Delete a sandbox.""" |
| 58 | + raise NotImplementedError() |
| 59 | + |
| 60 | + # Note: This is not currently used, but |
| 61 | + # may be used later |
| 62 | + def stop_sandbox(self, context, sandbox_id): |
| 63 | + """Stop a sandbox.""" |
| 64 | + raise NotImplementedError() |
| 65 | + |
| 66 | + def get_sandbox_id(self, container): |
| 67 | + """Retrieve sandbox ID.""" |
| 68 | + raise NotImplementedError() |
| 69 | + |
| 70 | + def set_sandbox_id(self, container, sandbox_id): |
| 71 | + """Set sandbox ID.""" |
| 72 | + raise NotImplementedError() |
| 73 | + |
| 74 | + def get_sandbox_name(self, container): |
| 75 | + """Retrieve sandbox name.""" |
| 76 | + raise NotImplementedError() |
| 77 | + |
| 78 | + def get_container_name(self, container): |
| 79 | + """Retrieve sandbox name.""" |
| 80 | + raise NotImplementedError() |
| 81 | + |
| 82 | + def get_addresses(self, context, container): |
| 83 | + """Retrieve IP addresses of the container.""" |
| 84 | + |
| 85 | + def update(self, container): |
| 86 | + """Update a container.""" |
| 87 | + raise NotImplementedError() |
0 commit comments