Teradata Package for Python Function Reference | 17.10 - cleanup_sandbox_env - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.10
Published
April 2022
Language
English (United States)
Last Update
2022-08-19
lifecycle
previous
Product Category
Teradata Vantage
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