0

将 Atlas v1.1 与 HDP 3.1 一起使用,似乎无法访问 api 端点以发出与关系特征相关的请求。从文档(此处(用于 API 访问)和此处(用于特定端点)),我想做一些类似...

[hph_etl@HW03 ~]$ curl -v -u admin:admin -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' "http://hw03.co.local:21000/api/atlas/v2/relationship"


* About to connect() to hw03.co.local port 21000 (#0)
*   Trying 172.18.4.48...
* Connected to hw03.co.local (172.18.4.48) port 21000 (#0)
* Server auth using Basic with user 'admin'
> GET /api/atlas/v2/relationship HTTP/1.1
> Authorization: Basic xxxxxx
> User-Agent: curl/7.29.0
> Host: hw03.co.local:21000
> Content-Type: application/json
> Accept: application/json
>
< HTTP/1.1 500 Internal Server Error
< Date: Wed, 07 Aug 2019 01:55:43 GMT
< Set-Cookie: ATLASSESSIONID=xxxxxx;Path=/;HttpOnly
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: Jetty(9.3.14.v20161028)
<
* Connection #0 to host hw03.co.local left intact
There was an error processing your request. It has been logged (ID bfb6e6b45490d83a).[

测试端点,但它会产生上面显示的错误。然而,这不是types端点的情况,例如。

[hph_etl@HW03 ~]$ curl -u admin:admin -X GET -H 'Content-Type: application/json' -H 'pplication/json' "http://hw03.co.local:21000/api/atlas/v2/types/typedefs"

<whole bunch of output>

这似乎工作正常。不知道这里发生了什么。有更多 Atlas(或 REST)经验的人有任何调试建议或修复吗?

4

1 回答 1

0

通过询问 apache-atlas 用户邮件列表以及查看更多文档,发现正确的端点不仅仅是

http://atlas-host-server/v2/<specific/api/endpoint>

反而

http://atlas-host-server/api/atlas/v2/<specific/api/endpoint>

因此,为了创建实体之间的关系,您可以执行类似...

curl -vv -u admin:admin -X POST --header 'Content-Type: application/json;charset=UTF-8' --header 'Accept: application/json' -d '{ \
   "end1": { \
     "guid": "2ddcda5b-2489-4636-a9ab-12b199c02422" \
   }, \
   "end2": { \
     "guid": "a33f45de-13d0-4a30-9df7-b0e02eb0dfd5" \
   }, \
   "typeName": "<some AtlasRelationshipDef>" \
 }' 'http://HW03.co.local:21000/api/atlas/v2/relationship'

从可从 apache-atlas 官方网站下载的 pdf 文件中获取了要使用的信息/api/atlas/,但现在无法在此处找到链接(只是表明要找到该关键信息有多么奇怪)。

于 2019-08-12T20:58:24.810 回答