File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/libcloud/container/__pycache__/base.cpython-310.pyc
Back
o ;j6 � @ s� d dl mZmZ d dlmZmZ d dlmZ g d�ZG dd� d�Z G dd� d�Z G d d � d �ZG dd� d�ZG d d� de�Z dS )� )�List�Optional)� BaseDriver�ConnectionUserAndKey)�ContainerState)� Container�ContainerImage�ContainerCluster�ClusterLocation�ContainerDriverc @ sF e Zd ZdZ ddd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dS )r z Container. Nc C sD |rt |�nd| _|| _|| _|| _|| _|| _|pi | _|| _dS )a� :param id: Container id. :type id: ``str`` :param name: The name of the container. :type name: ``str`` :param image: The image this container was deployed using. :type image: :class:`.ContainerImage` :param state: The state of the container, e.g. running :type state: :class:`libcloud.container.types.ContainerState` :param ip_addresses: A list of IP addresses for this container :type ip_addresses: ``list`` of ``str`` :param driver: ContainerDriver instance. :type driver: :class:`.ContainerDriver` :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` N) �str�id�name�image�state�ip_addresses�driver�extra� created_at) �selfr r r r r r r r � r �K/opt/saltstack/salt/lib/python3.10/site-packages/libcloud/container/base.py�__init__$ s ! zContainer.__init__c C � | j j| d�S �N)� container)r �start_container�r r r r �startN � zContainer.startc C r r )r �stop_containerr r r r �stopR r zContainer.stopc C r r )r �restart_containerr r r r �restartV r zContainer.restartc C r r )r �destroy_containerr r r r �destroyZ r zContainer.destroyc C � d| j | j| j| jjf S )Nz5<Container: id=%s, name=%s,state=%s, provider=%s ...>)r r r r r r r r �__repr__^ � �zContainer.__repr__�NN) �__name__� __module__�__qualname__�__doc__r r r! r# r% r'