Skip to content
Snippets Groups Projects

Create new REST endpoints for returning capability versions

Merged Charlotte Hausman requested to merge WS_767 into main
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
27 27 from pyramid.view import view_config
28 28
29 29
30 @view_config(route_name="view_all_versions", renderer="json")
31 def view_all_versions(request: Request):
32
33 capability_request = request.capability_info.lookup_capability_request(request.matchdict["capability_request_id"])
34 if capability_request:
35 if capability_request.versions:
  • 85 URL: capability/request/{capability_request_id}/version/{version_id}
    86
    87 :param request: GET request
    88 :return: 200 OK response with JSON-formatted info of latest version of request with given ID
    89 or 404 response (HTTPNotFound) if capability request with given ID does not exist
    90 or 412 response (HTTPPreconditionFailed) if capability request with given ID has no versions
    91 """
    92
    93 capability_request_id = request.matchdict["capability_request_id"]
    94 version_id = request.matchdict["version_id"]
    95
    96 capability_request = request.capability_info.lookup_capability_request(capability_request_id)
    97 if capability_request:
    98 version = capability_request.versions[int(version_id) - 1]
    99 if version:
    100 version_json = version.__json__()
  • added 1 commit

    Compare with previous version

  • added 4 commits

    • 3e190c3b - 1 commit from branch main
    • 9652da5a - Create new REST endpoints for returning capability versions
    • 215106b4 - uncomplicate the endpoints
    • 11852291 - Merge remote-tracking branch 'origin/WS_767' into WS_767

    Compare with previous version

  • Can you all look at this so I can merge it?

  • Daniel Lyons approved this merge request

    approved this merge request

  • Nathan Hertz approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading