Kaaのダウンロードページで提供されているAMIを使用してAWSに展開されたKaa Sandbox v0.10.0に取り組んでいます。Kaa REST APIが "404 not found"を呼び出す
http://docs.kaaproject.org/display/KAA/Admin+REST+APIここで説明するサンプルコールのいくつかを試していますが、アプリケーションIDまたはアプリケーショントークンのGETリクエストでエラーが発生します。
私はこの要求にトークンとIDを取得することができます:
curl -v -S -u devuser:devuser123 -X GET "http://my-sandbox:8080/kaaAdmin/rest/api/applications" | python -mjson.tool
応答(OK):
* Hostname was NOT found in DNS cache % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0* Trying ***.***.***.***...
* Connected to my-sandbox (***.***.***.***) port 8080 (#0)
* Server auth using Basic with user 'devuser'
> GET /kaaAdmin/rest/api/applications HTTP/1.1
> Authorization: Basic ZGV2dXNlcjpkZXZ1c2VyMTIz
> User-Agent: curl/7.35.0
> Host: my-sandbox:8080
> Accept: */*
> < HTTP/1.1 200 OK < Date: Tue, 22 Nov 2016 15:27:06 GMT < Set-Cookie: JSESSIONID=cm5f9odz7iucto5kns8o8qmd;Path=/ < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: application/json;charset=UTF-8 < Transfer-Encoding: chunked
* Server Jetty(9.2.2.v20140723) is not blacklisted < Server: Jetty(9.2.2.v20140723) < { [data not shown] 100 3147 0 3147 0 0 4542 0 --:--:-- --:--:-- --:--:-- 4541
* Connection #0 to host my-sandbox left intact [
{
"applicationToken": "25594577458910686729",
"credentialsServiceName": "Trustful",
"id": "1",
"name": "Endpoint profiles and grouping demo",
"sequenceNumber": 10,
"tenantId": "1"
},
{
"applicationToken": "73690609119489701916",
"credentialsServiceName": "Trustful",
"id": "2",
"name": "Configuration demo",
"sequenceNumber": 3,
"tenantId": "1"
},
{
"applicationToken": "59655266968010281243",
"credentialsServiceName": "Trustful",
"id": "3",
"name": "Notification demo",
"sequenceNumber": 3,
"tenantId": "1"
},
{
"applicationToken": "74360883947464962688",
"credentialsServiceName": "Internal",
"id": "4",
"name": "Credentials demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "09804246192781707713",
"credentialsServiceName": "Trustful",
"id": "5",
"name": "Data collection demo",
"sequenceNumber": 2,
"tenantId": "1"
},
{
"applicationToken": "48703828557071439020",
"credentialsServiceName": "Trustful",
"id": "6",
"name": "Event demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "23961666823127162504",
"credentialsServiceName": "Trustful",
"id": "7",
"name": "User verifiers demo",
"sequenceNumber": 3,
"tenantId": "1"
},
{
"applicationToken": "24510582477967418632",
"credentialsServiceName": "Trustful",
"id": "8",
"name": "Zeppelin data analytics demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "69723522420999062824",
"credentialsServiceName": "Trustful",
"id": "9",
"name": "Storm data analytics demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "68275681743382249643",
"credentialsServiceName": "Trustful",
"id": "10",
"name": "Cassandra data analytics demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "49633755999810794988",
"credentialsServiceName": "Trustful",
"id": "11",
"name": "Spark data analytics demo",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "25016131899946649961",
"credentialsServiceName": "Trustful",
"id": "12",
"name": "GPIO control master",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "41988108505666436316",
"credentialsServiceName": "Trustful",
"id": "13",
"name": "GPIO control slave",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "85870645700025909809",
"credentialsServiceName": "Trustful",
"id": "14",
"name": "Cell monitor",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "47750979047259772609",
"credentialsServiceName": "Trustful",
"id": "15",
"name": "City guide",
"sequenceNumber": 7,
"tenantId": "1"
},
{
"applicationToken": "83795629594970241248",
"credentialsServiceName": "Trustful",
"id": "16",
"name": "Photo frame",
"sequenceNumber": 1,
"tenantId": "1"
},
{
"applicationToken": "48284436316351850395",
"credentialsServiceName": "Trustful",
"id": "32768",
"name": "Application 1 v2",
"sequenceNumber": 0,
"tenantId": "1"
} ]
しかし、私はそのトークンによってアプリケーションを取得しようとすると、それは動作しません。 。
要求:
curl -v -S -u devuser:devuser123 -X GET "http://my-sandbox:8080/kaaAdmin/rest/api/application/token/25594577458910686729" | python -mjson.tool
応答(ERROR):同じエラー(404)と
** Hostname was NOT found in DNS cache
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ***.***.***.***...
* Connected to my-sandbox (***.***.***.***) port 8080 (#0)
* Server auth using Basic with user 'devuser'
> GET /kaaAdmin/rest/api/application/token/25594577458910686729 HTTP/1.1
> Authorization: Basic ZGV2dXNlcjpkZXZ1c2VyMTIz
> User-Agent: curl/7.35.0
> Host: my-sandbox:8080
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Tue, 22 Nov 2016 15:28:40 GMT
< Set-Cookie: JSESSIONID=1rb4gm0qf42jf2sjfi4dikqu6;Path=/
< Content-Type: text/html; charset=ISO-8859-1
< Cache-Control: must-revalidate,no-cache,no-store
< Content-Length: 340
* Server Jetty(9.2.2.v20140723) is not blacklisted
< Server: Jetty(9.2.2.v20140723)
<
{ [data not shown]
100 340 100 340 0 0 1840 0 --:--:-- --:--:-- --:--:-- 1847
* Connection #0 to host my-sandbox left intact
No JSON object could be decoded*
同様の要求:
curl -v -S -u devuser:devuser123 -X GET "http://my-sandbox:8080/kaaAdmin/rest/api/application/1" | python -mjson.tool
curl -v -S -u devuser:devuser123 -X GET "http://my-sandbox:8080/kaaAdmin/rest/api/serverProfileSchemasByAppToken/48703828557071439020" | python -mjson.tool
curl -v -S -u devuser:devuser123 -X GET "http://my-sandbox:8080/kaaAdmin/rest/api/profileSchemasByAppToken/48703828557071439020" | python -mjson.tool
すべてのヘルプははるかに高く評価されるだろう!