我们的infra团队在机器中设置ca服务台并共享细节。我需要通过java程序创建其他事件。在这里我想通过提供访问密钥来使用基本认证。为此,我尝试使端点url获得访问密钥,然后创建事件,如下所示。CA服务DESK REST api使用JAVA
http://Host:port/caisd-rest/rest_access http://CAdeskHost:port/caisd-rest/in
String endpoint = "http://host:port/caisd-rest/rest_access";
HttpClient client = new HttpClient();
String encodedCredentials = new String(Base64.encodeBase64(("username" + ":" + "password").getBytes()));
PostMethod post = new PostMethod(endpoint);
post.addRequestHeader("Accept", "application/xml");
post.addRequestHeader("Content-Type", "application/xml; charset=UTF-8");
post.addRequestHeader("Authorization", "Basic " + encodedCredentials);
post.setRequestBody("<rest_access/>");
try {
System.out.println("Execute Basic Authentication request on " + endpoint);
// Execute request
int result = client.executeMethod(post);
但是,当我尝试执行上面的代码,得到404错误
“所请求的资源(/ caisd休息/ rest_access)不可用“。
任何人都可以帮助我如何找到ca服务台的REST URL是否它是所有像/caisd-rest
一样的普通url或者它是不同的。在这里,我的团队刚刚安装了CA服务台。那么我们是否需要采取其他措施来提供休息通道?