File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/libcloud/storage/drivers/__pycache__/ovh.cpython-310.pyc
Back
o ;j� � @ sT d dl mZ d dlmZmZmZmZ dgZdZdZ ee d�Z dZG dd� de�Zd S ) � )�Literal)�S3_CDN_URL_EXPIRY_HOURS�S3StorageDriver�BaseS3StorageDriver�S3SignatureV4Connection�OvhStorageDriverzs3.sbg.perf.cloud.ovh.netzs3.gra.perf.cloud.ovh.net)�sbgZgrazCDN feature not implementedc s^ e Zd ZdZdZeZdZ d� fdd� Ze dd � �Z ed fded fd d�Z � ZS )r zOvh Storage Driverz8https://www.ovhcloud.com/en/public-cloud/object-storage/r NTc s� t | d�r |s | j}|| _|r|t�� vrtd| ��d| | _|d u r+t| | j_n|| j_t� j d|||||||d�|�� d S )N�region_namez!Invalid or unsupported region: %szOvh Object Storage (%s))�key�secret�secure�host�port�region�url� ) �hasattrr �REGION_TO_HOST_MAP�keys� ValueError�name� connectionClsr �super�__init__) �selfr r r r r r r �kwargs�� __class__r �P/opt/saltstack/salt/lib/python3.10/site-packages/libcloud/storage/drivers/ovh.pyr , s( � �zOvhStorageDriver.__init__c C s t �� S )N)r r )r r r r �list_regionsS s zOvhStorageDriver.list_regions�GET� ex_method)r �PUTZDELETEc C s t j| |||d�S )a� Return a "presigned URL" for read-only access to object :param obj: Object instance. :type obj: :class:`Object` :param ex_expiry: The number of hours after which the URL expires. Defaults to 24 hours or the value of the environment variable "LIBCLOUD_S3_STORAGE_CDN_URL_EXPIRY_HOURS", if set. :type ex_expiry: ``float`` :param ex_method: The HTTP method for which the URL is valid. Defaults to "GET". :type ex_method: ``str`` :return: Presigned URL for the object. :rtype: ``str`` )� ex_expiryr! )r �get_object_cdn_url)r �objr# r! r r r r$ W s �z#OvhStorageDriver.get_object_cdn_url)NTNNr N)�__name__� __module__�__qualname__r Zwebsiter r r r �classmethodr r r r$ � __classcell__r r r r r &