Skip to content

Commit

Permalink
api: add SSLCertificate to TransferEndpoint in content library API
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ericvmw committed Apr 22, 2024
1 parent c385285 commit f2852e3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vapi/library/library_item_updatesession_file.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f2852e3

Please sign in to comment.