From ce7ef70ac7adaa86af266295436c7931da0d6818 Mon Sep 17 00:00:00 2001 From: Eric Cao Date: Mon, 22 Apr 2024 11:24:23 -0700 Subject: [PATCH] api: add SSLCertificate to TransferEndpoint in content library API Add the optional SSLCertificate field to TransferEndpoint in content library API so it can be specified to probe remote transfer endpoint or upload file from remote endpoint by pull. The field is already in the ProbeResult as an optional field. Closes: #3420 --- vapi/library/library_item_updatesession_file.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vapi/library/library_item_updatesession_file.go b/vapi/library/library_item_updatesession_file.go index c571d3273..a38a763c1 100644 --- a/vapi/library/library_item_updatesession_file.go +++ b/vapi/library/library_item_updatesession_file.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2019-2023 VMware, Inc. All Rights Reserved. +Copyright (c) 2019-2024 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import ( // TransferEndpoint provides information on the source of a library item file. type TransferEndpoint struct { URI string `json:"uri,omitempty"` + SSLCertificate string `json:"ssl_certificate,omitempty"` SSLCertificateThumbprint string `json:"ssl_certificate_thumbprint,omitempty"` } @@ -107,7 +108,11 @@ func (c *Manager) AddLibraryItemFileFromURI(ctx context.Context, sessionID, name if err != nil { return nil, err } - source.SSLCertificateThumbprint = res.SSLThumbprint + if res.SSLCertificate != "" { + source.SSLCertificate = res.SSLCertificate + } else { + source.SSLCertificateThumbprint = res.SSLThumbprint + } } return c.AddLibraryItemFile(ctx, sessionID, file)