Teradata Package for Python Function Reference - 17.00 - cleanup_sandbox_env - Teradata Package for Python

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Release Date
April 2021
Content Type
Programming Reference
Publication ID
B700-4008-070K
Language
English (United States)
teradataml.table_operators.sandbox_container_util.cleanup_sandbox_env = cleanup_sandbox_env()
DESCRIPTION:
    Function to clean up sandbox environment setup by teradataml. Function will
    remove the image and/or container used to setup the sandbox environment
    using setup_sandbox_env().
 
PARAMETERS:
    None.
 
RETURNS:
    None.
 
RAISES:
    None.
 
EXAMPLES:
    >>> from teradataml.table_operators.sandbox_container_util import *
    # Example 1: Setup sandbox environment using the setup_sandbox_env()
    #            and clean it up using cleanup_sandbox_env() function.
    #            This cleans up image and container created by
    #            setup_sandbox_env().
    >>> setup_sandbox_env(sandbox_image_location='/tmp/stosandbox.tar.gz',
                          sandbox_image_name='stosandbox:1.0')
        Loading image from /tmp/stosandbox.tar.gz. It may take few minutes.
        Image loaded successfully.
        Container c1dd4d4b722cc54b643ab2bdc57540a3a3e6db98c299defc672227de97d2c345
        started successfully.
    >>> cleanup_sandbox_env()
        Removed container: c1dd4d4b722cc54b643ab2bdc57540a3a3e6db98c299defc672227de97d2c345
        Removed image: stosandbox:1.0
 
    # Example 2: Set configure.sandbox_container_id manually then run
    #            setup_sandbox_env() and clean it up using cleanup_sandbox_env()
    #            function. This only cleans up image and container created
    #            by setup_sandbox_env() and does not cleanup the container
    #            specified in 'configure.sandbox_container_id'.
    >>> configure.sandbox_container_id = 'container_id_set_by_user'
    >>> setup_sandbox_env(sandbox_image_location='/tmp/stosandbox.tar.gz',
                          sandbox_image_name='stosandbox:1.0')
        Loading image from /tmp/stosandbox.tar.gz. It may take few minutes.
        Image loaded successfully.
        Container c1dd4d4b722cc54b643ab2bdc57540a3a3e6db98c299defc672227de97d2c345
        started successfully.
    >>> cleanup_sandbox_env()
        Removed container: c1dd4d4b722cc54b643ab2bdc57540a3a3e6db98c299defc672227de97d2c345
        Removed image: stosandbox:1.0