From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BE3031FF17E for ; Thu, 16 Oct 2025 10:50:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C5701D023; Thu, 16 Oct 2025 10:50:44 +0200 (CEST) Message-ID: Date: Thu, 16 Oct 2025 10:50:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Wolfgang Bumiller References: Content-Language: en-US From: Dominik Csapak In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760604638831 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] Howto access raw response data with pdm-client 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 Cc: Proxmox Datacenter Manager development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On 10/16/25 10:27 AM, Wolfgang Bumiller wrote: > On Thu, Oct 16, 2025 at 10:10:58AM +0200, Dominik Csapak wrote: >> >> >> On 10/15/25 6:06 PM, Dietmar Maurer wrote: >>> We currently use proxmox-yew-comp::ApiLoadCallback for many widgets. >>> >>> This callback returns Result, Error>, and >>> we use it most times with Result, Error> to access >>> raw response data. >>> >>> Is there a way to get that data using pdm-client? > > I'm a bit confused as to what "that data" is referring to. The client > does give you the above types, and they come from the intermediate > `HttpApiResponse` which has all-public fields including the `body: > Vec` if for some reason the `ApiResponseData` is not enough, but why > wouldn't it? ApiResponseData would be enough, but the client (at least the api calls we implemented at the moment) does not return that but rather the inner type, for example: --- pub async fn get_metric_collection_status( &self, ) -> Result, Error> { let path: &str = "/api2/extjs/metric-collection/status"; Ok(self.0.get(path_and_query: path).await?.expect_json()?.data) } --- which is the pattern i see for (nearly?) all methods of the PdmClient > >>> >> >> after talking a bit off-list with dietmar, one solution to the problem >> could be to not use the statically typed methods but instead provide a >> method to generate the url and we use that + e.g. http_post/get/etc. to >> make api calls (which can convert the parameter with Serialize and the >> return type with Deserialize) >> >> with that we can also use `Value` if needed and can extract the auxiliary >> data from the api call too? > > Which auxiliary data ends up neither in `data` nor in `attribs`, and > more importantly: why? Sounds like something is circumventing the > response format we normally get from the formatter? > (And then we could just extend `ApiResponseData` to optionally include > it, or better yet, fix the API call?) see above, the question is basically: should we return ApiResponseData everywhere, or should we decide case by case, or ... _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel