Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST /orgs/{id}/services/{id}/search doesn't account for nodes running an IBM service #224

Closed
6 tasks done
sf2ne opened this issue Sep 18, 2019 · 1 comment
Closed
6 tasks done
Assignees
Labels

Comments

@sf2ne
Copy link
Collaborator

sf2ne commented Sep 18, 2019

This fix involves multiple steps:

  • move POST /orgs/{id}/services/{id}/search to NodesRoutes.scala
  • rename route to POST /v1/orgs/{orgid}/search/nodes/service where {orgid} is always the orgid of the user sending the request
  • change the input body to be { "orgid": "string", "serviceURL": "string", "serviceVersion": "string", "serviceArch": "string" }
  • change filter so that nodes are checked to be in org of user not org of service
  • move over the unit tests to NodesSuite.scala and edit them to work with new input body
  • add unit tests to test specifically the case of IBM services running on user-cluster nodes
@sf2ne
Copy link
Collaborator Author

sf2ne commented Sep 19, 2019

Verified on major peacock:

Using this request body:

{
  "orgid": "major-peacock-icp-cluster",
  "serviceURL": "ibm.helloworld",
  "serviceVersion": "1.0.0",
  "serviceArch": "amd64"
}

Test 1: Searching a service running on 1 node

Sadiyahs-MacBook-Pro:~ sadiyahfaruk$ curl -X POST "https://9.30.210.34:8443/ec-exchange/v1/orgs/major-peacock-icp-cluster/search/nodes/service" -H "Authorization:Basic <user-auth>" -H "accept: application/json" -H "Content-Type: application/json" -d "@<path-to-file>/service_search_test.json"

{"nodes":[{"major-peacock-icp-cluster/<node1>":"2019-09-17T19:25:21.454Z[UTC]"}]}

Test 2: Add another node running that service to showcase 2 nodes

Sadiyahs-MacBook-Pro:~ sadiyahfaruk$ curl -X POST "https://9.30.210.34:8443/ec-exchange/v1/orgs/major-peacock-icp-cluster/search/nodes/service" -H "Authorization:Basic <user-auth>" -H "accept: application/json" -H "Content-Type: application/json" -d "@<path-to-file>/service_search_test.json"

{"nodes":[{"major-peacock-icp-cluster/<node1>":"2019-09-17T19:25:21.454Z[UTC]"},{"major-peacock-icp-cluster/<node2>":"2019-09-19T16:16:59.038Z[UTC]"}]}

Using this request body:

{
  "orgid": "major-peacock-icp-cluster",
  "serviceURL": "fake.service",
  "serviceVersion": "1.0.0",
  "serviceArch": "arm"
}

Test 3: Service running no nodes

Sadiyahs-MacBook-Pro:~ sadiyahfaruk$ curl -v -X POST "https://9.30.210.34:8443/ec-exchange/v1/orgs/major-peacock-icp-cluster/search/nodes/service" -H "Authorization:Basic <user-auth>" -H "accept: application/json" -H "Content-Type: application/json" -d "@<path-to-file>/service_search_test.json"

< HTTP/1.1 404 Not Found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant