PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/initiate/__pycache__

Просмотр файла: v1.cpython-310.pyc

o

UٵgT
�@s�ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZGdd	�d	e
e�Zd
efdd�Zd
e	d
efdd�Zeddedd�Zdddeejdfejdfejdfgddd�ZdS)�)�secret_manager)�
exceptions)�APIEndpoint)�AdditionalInfo)�UAConfig)�UAContractClient)�
DataObject�Field�IntDataValue�StringDataValuec@sZeZdZededd�ededd�ededd�eded	d�gZdedededefd
d�Z	dS)
�MagicAttachInitiateResult�	user_codezACode the user will see in the UI when confirming the Magic Attach)�doc�tokenzgMagic Token that can be used in either `u.pro.attach.magic.revoke.v1`_ or `u.pro.attach.magic.wait.v1`_�expiresz0Timestamp of the Magic Attach process expiration�
expires_inz/Seconds before the Magic Attach process expirescCs||_||_||_||_dS�N�r
rrr)�selfr
rrr�r�M/usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/initiate/v1.py�__init__.s
z"MagicAttachInitiateResult.__init__N)
�__name__�
__module__�__qualname__r	rr
�fields�str�intrrrrrrs>��	�������r�returncCs
tt��Sr)�	_initiaterrrrr�initiate;s
r �cfgcCsTt|�}|��}tj�|d�tj�|d�t|d|d|dt|d�d�S)z�
    This endpoint initiates the Magic Attach flow, retrieving the User Code to
    confirm the operation and the Token used to proceed.
    r�userCoder�	expiresInr)r�new_magic_attach_tokenr�secrets�
add_secretrr)r!�contract�
initiate_resprrrr?s
�r�v1�MagicAttachInitiateN)�version�name�fn�options_clsz27.11TzW
from uaclient.api.u.pro.attach.magic.initiate.v1 import initiate

result = initiate()
zARaised if it is not possible to connect to the contracts service.zLRaised if there is an unexpected error in the contracts service interaction.zHRaised if the Magic Attach service is busy or unavailable at the moment.z&pro api u.pro.attach.magic.initiate.v1z�
{
    "user_code":"<UI_code>",
    "token":"<magic_token>",
    "expires": "<yyyy-MM-dd>T<HH:mm:ss>.<TZ>",
    "expires_in": 600
}
)�
introduced_in�requires_network�example_python�result_classr�example_cli�example_json)�uaclientr�uaclient.apir�uaclient.api.apir�uaclient.api.data_typesr�uaclient.configr�uaclient.contractr�uaclient.data_typesrr	r
rrr r�endpoint�ConnectivityError�ContractAPIError�MagicAttachUnavailable�_docrrrr�<module>sB,�����
�

Выполнить команду


Для локальной разработки. Не используйте в интернете!