From 5f74f64c28439203d3c68c2b2eba428c25f4a516 Mon Sep 17 00:00:00 2001 From: Szymon Basan Date: Wed, 9 Oct 2024 12:00:27 +0200 Subject: [PATCH] csr generation as task for >=20.16 --- ENDPOINTS.md | 11 ++++++----- .../endpoints/certificate_management_device.py | 8 +++++++- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ENDPOINTS.md b/ENDPOINTS.md index 8c24aa27..31c60ffb 100644 --- a/ENDPOINTS.md +++ b/ENDPOINTS.md @@ -1,6 +1,6 @@ **THIS FILE WAS AUTO-GENERATED DO NOT EDIT** -Generated for: catalystwan-0.35.5 +Generated for: catalystwan-0.35.6 All URIs are relative to */dataservice* HTTP request | Supported Versions | Method | Payload Type | Return Type | Tenancy Mode @@ -26,10 +26,11 @@ PUT /admin/user/profile/password||[**AdministrationUserAndGroup.update_profile_p PUT /admin/user/{username}||[**AdministrationUserAndGroup.update_user**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/administration_user_and_group.py#L331)|[**UserUpdateRequest**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/administration_user_and_group.py#L34)|None| PUT /admin/usergroup/{group_name}||[**AdministrationUserAndGroup.update_user_group**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/administration_user_and_group.py#L335)|[**UserGroup**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/administration_user_and_group.py#L84)|None| DELETE /certificate/{uuid}||[**CertificateManagementDevice.delete_configuration**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L113)||[**DeviceDeletionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L15)| -POST /certificate/generate/csr||[**CertificateManagementDevice.generate_csr**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L117)|[**TargetDevice**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L22)|DataSequence[[**DeviceCsrGenerationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L28)]| -POST /certificate/save/vedge/list||[**CertificateManagementDevice.change_vedge_list_validity**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L121)|list[[**VedgeListValidityPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L100)]|[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| -POST /certificate/vedge/list?action={action}||[**CertificateManagementDevice.send_to_controllers**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L125)||[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| -POST /certificate/vsmart/list||[**CertificateManagementDevice.send_to_vbond**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L129)||[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| +POST /certificate/generate/csr|<20.16|[**CertificateManagementDevice.generate_csr**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L117)|[**TargetDevice**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L22)|DataSequence[[**DeviceCsrGenerationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L28)]| +POST /certificate/generate/csr|>=20.16|[**CertificateManagementDevice.generate_csr_task**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L122)|[**TargetDevice**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L22)|[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| +POST /certificate/save/vedge/list||[**CertificateManagementDevice.change_vedge_list_validity**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L127)|list[[**VedgeListValidityPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L100)]|[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| +POST /certificate/vedge/list?action={action}||[**CertificateManagementDevice.send_to_controllers**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L131)||[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| +POST /certificate/vsmart/list||[**CertificateManagementDevice.send_to_vbond**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L135)||[**CertActionResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_device.py#L108)| GET /setting/configuration/webserver/certificate||[**CertificateManagementVManage.show_info**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_vmanage.py#L46)||[**WebServerCertificateInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/certificate_management_vmanage.py#L11)| GET /client/server||[**Client.server**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/client.py#L86)||[**ServerInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/client.py#L23)| GET /client/server/ready||[**Client.server_ready**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/client.py#L90)||[**ServerReady**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/client.py#L80)| diff --git a/catalystwan/endpoints/certificate_management_device.py b/catalystwan/endpoints/certificate_management_device.py index 5271de6f..932bf78b 100644 --- a/catalystwan/endpoints/certificate_management_device.py +++ b/catalystwan/endpoints/certificate_management_device.py @@ -8,7 +8,7 @@ from pydantic import BaseModel, ConfigDict, Field -from catalystwan.endpoints import APIEndpoints, delete, post +from catalystwan.endpoints import APIEndpoints, delete, post, versions from catalystwan.typed_list import DataSequence @@ -114,10 +114,16 @@ class CertificateManagementDevice(APIEndpoints): def delete_configuration(self, uuid: str) -> DeviceDeletionResponse: ... + @versions("<20.16") @post("/certificate/generate/csr", "data") def generate_csr(self, payload: TargetDevice) -> DataSequence[DeviceCsrGenerationResponse]: ... + @versions(">=20.16") + @post("/certificate/generate/csr") + def generate_csr_task(self, payload: TargetDevice) -> CertActionResponse: + ... + @post("/certificate/save/vedge/list") def change_vedge_list_validity(self, payload: List[VedgeListValidityPayload]) -> CertActionResponse: ... diff --git a/pyproject.toml b/pyproject.toml index b7c66c58..d992969c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "catalystwan" -version = "0.35.5" +version = "0.35.6" description = "Cisco Catalyst WAN SDK for Python" authors = ["kagorski "] readme = "README.md"