HDP3.1 Atlas REST API 的正确端点是什么?
What is the proper endpoint for HDP3.1 Atlas REST API?
将 Atlas v1.1 与 HDP 3.1 一起使用,似乎无法访问 api 端点以发出与关系特征相关的请求。从文档(here (for API access) and here(针对特定端点)),我想做一些类似...
[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)经验的人有任何调试建议或修复吗?
通过询问 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/
的信息,但现在无法在 link 此处找到它(只是为了说明这个关键有多难一条信息是要找的)。
将 Atlas v1.1 与 HDP 3.1 一起使用,似乎无法访问 api 端点以发出与关系特征相关的请求。从文档(here (for API access) and here(针对特定端点)),我想做一些类似...
[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)经验的人有任何调试建议或修复吗?
通过询问 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/
的信息,但现在无法在 link 此处找到它(只是为了说明这个关键有多难一条信息是要找的)。