From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7563B1FF15C for ; Fri, 28 Nov 2025 16:39:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 289CC1E3A9; Fri, 28 Nov 2025 16:39:31 +0100 (CET) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Date: Fri, 28 Nov 2025 16:38:51 +0100 Message-ID: <20251128153855.543210-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1764344296941 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager 0/4] clean up return statements tree wide X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" these patches clean up the return section of all api endpoints as much as possible. most of these are either additions of `returns` sections or making the `returns` section match the actual api method it references. the last two commit here are slightly different in that the first one changes the actual return type of an api method. see the third commit for the reasoning there. the last commit fixes up the description of an api endpoint that was noticed along the way. there are some other areas that seem inconsistent, but aren't addressed here, as that would require more in-depth changes/discussion: * `list_network_devices` in server/src/api/nodes/network.rs: this endpoint has an returns sections that specifies a list of `Interface`s, but the endpoint actually returns a `Value`. this `Value` contains almost a list of `Interface`s, but extends them with two field: `digest` and `iface`. ideally we could define these two fields as optional field in `Interface` or similar. * endpoints that upgrade to a websocket don't really have proper returns sections, but i'm not sure what would be the proper definition anyway. * pbs and pve tls probing endpoints: these return `TlsProbeOutcome` which is an enum. this enum has a unit and an unnamed variant, which isn't supported by the api macro. investigated a little bit, but there doesn't seem to be a way to make this work without some refactoring. * `refresh_remote_update_summaries` in server/src/api/remote_updates.rs: this returns a parsed UPID struct instead of its string representation. while this is fine, it is also inconsistent with all other endpoints returning UPIDs afaict (though a lot of endpoints return a `RemoteUpid`) * `ping` in server/src/api/mod.rs: returns the string `"pong"` whereas the equivalent pbs endpoint returns `{ "pong": true }` the following endpoints could probably benefit from an access section: * `get_node_rrddata` in server/src/nodes/rrddata.rs * `list_remotes` in server/src/api/pbs/mod.rs * `trigger_metric_collection` and `get_metric_collection_status` in server/src/api/metric_collection.rs Shannon Sterz (4): tree-wide: add missing `returns` definitions to api macro tree-wide: make `returns` defintion match the return type of api methods api: pve: make to `get_storage_rrd_data` return PveStorageDataPoint api: pbs: fix description of list namespace endpoint server/src/api/access/tfa.rs | 10 ++++++ server/src/api/config/access/ad.rs | 1 - server/src/api/config/access/ldap.rs | 1 - server/src/api/config/access/openid.rs | 1 - server/src/api/config/acme.rs | 9 +++++ server/src/api/config/views.rs | 1 + server/src/api/metric_collection.rs | 10 +++++- server/src/api/mod.rs | 22 ++++++++++++ server/src/api/nodes/certificates.rs | 9 +++++ server/src/api/nodes/network.rs | 3 ++ server/src/api/nodes/rrddata.rs | 7 ++++ server/src/api/nodes/tasks.rs | 50 +++++++++++++++++++++++++- server/src/api/pbs/mod.rs | 9 ++++- server/src/api/pbs/rrddata.rs | 14 ++++++-- server/src/api/pbs/tasks.rs | 8 +++-- server/src/api/pve/firewall.rs | 24 +++---------- server/src/api/pve/lxc.rs | 4 +-- server/src/api/pve/mod.rs | 8 +++++ server/src/api/pve/node.rs | 15 ++++++++ server/src/api/pve/qemu.rs | 1 + server/src/api/pve/rrddata.rs | 32 +++++++++++++++-- server/src/api/pve/storage.rs | 2 +- server/src/api/pve/tasks.rs | 8 ++++- server/src/api/remote_tasks.rs | 8 +++++ server/src/api/remote_updates.rs | 3 ++ server/src/api/remotes.rs | 11 ++++-- server/src/api/resources.rs | 9 ++--- server/src/api/sdn/vnets.rs | 2 +- server/src/api/sdn/zones.rs | 2 +- 29 files changed, 236 insertions(+), 48 deletions(-) -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel