简体   繁体   English

将 LINUX CURL 命令转换为 Cloud PCF CLI 命令

[英]Convert LINUX CURL command to Cloud PCF CLI command

We are able to run the following Curl command from LINUX server putty:我们能够从 LINUX 服务器腻子运行以下 Curl 命令:

curl —cert /path/to/file/XXXX.pem:<PWD> —key /path/to/file/XXXX.pem https://<URL> 

However now we want to move all our applications to cloud servers and need to find a way to run above curl command from PCF Command Line Interface (CLI).然而,现在我们想要将我们所有的应用程序移动到云服务器上,并且需要找到一种方法来运行来自 PCF 命令行界面 (CLI) 的 curl 命令。

I did some research and found there is “cf curl” command, but cannot find a way to pass JKS or PEM file and it's password.我做了一些研究,发现有“cf curl”命令,但找不到传递 JKS 或 PEM 文件及其密码的方法。

Please advise.请指教。

cf curl is intended to be used when writing CF CLI plugins and mainly to interact with the api directly. cf curl 旨在用于编写 CF CLI 插件,主要用于直接与 api 交互。 “cf curl” can execute a request to an API endpoint. “cf curl”可以执行对 API 端点的请求。
For ex: cf curl /v2/apps -- retrieves the information about all of your apps例如:cf curl /v2/apps -- 检索所有应用程序的信息

However It seems you are looking to call the apps deployed on cloud foundry using curl so you do't need cf curl rather need to make sure that you use the URL of the apps the running on PCF within your curl command. However It seems you are looking to call the apps deployed on cloud foundry using curl so you do't need cf curl rather need to make sure that you use the URL of the apps the running on PCF within your curl command. You should ideally be able to run from any server that has curl and doesn't have any Firewall rules to block such URLs..理想情况下,您应该能够从具有 curl 并且没有任何防火墙规则来阻止此类 URL 的任何服务器运行。

It looks like there is no way we can pass JKS/PEM/CRT files directly from cf curl or cf api commands like we do in Linux curl command. It looks like there is no way we can pass JKS/PEM/CRT files directly from cf curl or cf api commands like we do in Linux curl command. I created a spring boot batch application in which I am passing certificate from rest template and then call my rest API.我创建了一个 spring 引导批处理应用程序,其中我从 rest 模板通过证书,然后调用我的 rest1634238DZCE8CA38DZ018CA3 Now I can call this app using cf run-task command.现在我可以使用 cf run-task 命令调用这个应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM