File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/vultr/__pycache__/v1_server.cpython-310.pyc
Back
o ;j�# � @ s@ d Z ddlmZmZ ddlmZ ddlmZ G dd� de�ZdS )z.Partial class to handle Vultr Server API calls� )� VultrBase� update_params)�VultrServerIPv4)�VultrServerIPv6c @ s� e Zd ZdZdd� Zd)dd�Zd)dd�Zd)d d �Zd)dd�Zd)d d�Z d)dd�Z d*dd�Zd)dd�Zd)dd�Z d)dd�Zd)dd�Zd)dd�Zd)dd�Zd)dd �Zd)d!d"�Zd)d#d$�Zd)d%d&�Zd)d'd(�ZdS )+�VultrServerzHandles Vultr Server API callsc C s$ t �| |� t|�| _t|�| _d S �N)r �__init__r Zipv4r Zipv6)�selfZapi_key� r �C/opt/saltstack/salt/lib/python3.10/site-packages/vultr/v1_server.pyr s zVultrServer.__init__Nc C � t |d|i�}| �d|d�S )z� /v1/server/bandwidth GET - account Get the bandwidth used by a virtual machine Link: https://www.vultr.com/api/#server_bandwidth �SUBIDz/v1/server/bandwidth�GET�r �request�r �subid�paramsr r r � bandwidth � zVultrServer.bandwidthc C s t ||||d��}| �d|d�S )a� /v1/server/create POST - account Create a new virtual machine. You will start being billed for this immediately. The response only contains the SUBID for the new machine. You should use v1/server/list to poll and wait for the machine to be created (as this does not happen instantly). Link: https://www.vultr.com/api/#server_create )ZDCID� VPSPLANID�OSIDz/v1/server/create�POSTr )r Zdcid� vpsplanid�osidr r r r �create s �zVultrServer.createc C r )a /v1/server/destroy POST - account Destroy (delete) a virtual machine. All data will be permanently lost, and the IP address will be released. There is no going back from this call. Link: https://www.vultr.com/api/#server_destroy r z/v1/server/destroyr r r r r r �destroy) � zVultrServer.destroyc C r )z� /v1/server/get_user_data GET - account Retrieves the (base64 encoded) user-data for this subscription. Link: https://www.vultr.com/api/#server_get_user_data r z/v1/server/get_user_datar r r r r r � get_user_data5 r zVultrServer.get_user_datac C r )an /v1/server/halt POST - account Halt a virtual machine. This is a hard power off (basically, unplugging the machine). The data on the machine will not be modified, and you will still be billed for the machine. To completely delete a machine, see v1/server/destroy Link: https://www.vultr.com/api/#server_halt r z/v1/server/haltr r r r r r �halt? s zVultrServer.haltc C � t |||d��}| �d|d�S )z� /v1/server/label_set POST - account Set the label of a virtual machine. Link: https://www.vultr.com/api/#server_label_set )r �labelz/v1/server/label_setr r )r r r! r r r r � label_setL s �zVultrServer.label_setc C s&