File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/__pycache__/packet.cpython-310.pyc
Back
o ;j0? � @ sj d Z ddlZddlZddlZddlmZ ddlZddlm Z m Z mZmZ ddl mZmZ ddlmZ zddlZdZW n eyE dZY nw ee e� �Z ee e� �Z eee� �Zeee� �Ze�e�ZdZd d � Zdd� Zd d� Zd,dd�Zd,dd�Zd,dd�Zd,dd�Z d-dd�Z!dd� Z"dd� Z#d,dd�Z$d,d d!�Z%d,d"d#�Z&d$d%� Z'd,d&d'�Z(d,d(d)�Z)d*d+� Z*dS ).a� Packet Cloud Module Using Packet's Python API Client ==================================================== The Packet cloud module is used to control access to the Packet VPS system. Use of this module only requires the ``token`` parameter. Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/packet.conf``: The Packet profile requires ``size``, ``image``, ``location``, ``project_id`` Optional profile parameters: - ``storage_size`` - min value is 10, defines Gigabytes of storage that will be attached to device. - ``storage_tier`` - storage_1 - Standard Plan, storage_2 - Performance Plan - ``snapshot_count`` - int - ``snapshot_frequency`` - string - possible values: - 1min - 15min - 1hour - 1day - 1week - 1month - 1year This driver requires Packet's client library: https://pypi.python.org/pypi/packet-python .. code-block:: yaml packet-provider: minion: master: 192.168.50.10 driver: packet token: ewr23rdf35wC8oNjJrhmHa87rjSXzJyi private_key: /root/.ssh/id_rsa packet-profile: provider: packet-provider size: baremetal_0 image: ubuntu_16_04_image location: ewr1 project_id: a64d000b-d47c-4d26-9870-46aac43010a6 storage_size: 10 storage_tier: storage_1 storage_snapshot_count: 1 storage_snapshot_frequency: 15min � N)� get_image�get_size�script� show_instance)�SaltCloudException�SaltCloudSystemExit)�namespaced_functionTF�packetc C s t du rdS t� du r dS tS )z# Check for Packet configs. F)Fz*The packet python library is not installed)� HAS_PACKET�get_configured_provider�__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/packet.py�__virtual__S s r c C s"