Tech C**P
How to get method name in python? The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame objects, and code objects. For example, it can help you examine…
You can also use
#python #inspect #stack
inspect.stack()[2][3]
instead of getting current frame and then getting its outer frames:inspect.stack
returns a list of frame records for the caller’s stack. The first entry in the returned list represents the caller; the last entry represents the outermost call on the stack.#python #inspect #stack
Some useful
List stacks or apps
Run the specified Compose file
List running services associated with an app
List tasks associated with an app
Inspect task or container
List container IDs
Tear down an application
Take down a single node swarm from the manager
#docker #cheatsheet #inspect #stack #swarm #service
docker
commands:docker stack ls
List stacks or apps
docker stack deploy -c <composefile> <appname>
Run the specified Compose file
docker service ls
List running services associated with an app
docker service ps <service>
List tasks associated with an app
docker inspect <task or container>
Inspect task or container
docker container ls -q
List container IDs
docker stack rm <appname>
Tear down an application
docker swarm leave --force
Take down a single node swarm from the manager
#docker #cheatsheet #inspect #stack #swarm #service