Skip to content
Snippets Groups Projects

WS-31: Viewing and creating capability requests

Merged Nathan Hertz requested to merge WS-31-create-capability-request-view into main
1 unresolved thread

Implemented view_capability_request and create_capability_request REST interfaces as Pyramid views

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
46 Pyramid view that accepts a request to create a capability request
47 URL: capability/{capability_name}/request/create
48
49 :param request: POST request, expecting JSON parameters ["parameters", "versions"]
50 :return: Response with JSON-formatted info of newly created capability request
51 or 400 response (HTTPBadRequest) if expected parameters not given
52 or 412 response (HTTPPreconditionFailed) if capability with given name does not exist and thus cannot be
53 requested
54 """
55 expected_params = ["parameters", "versions"]
56 # TODO: What is the versions parameter going to look like?
57 # We can error check for a well-formatted param once we decide
58 capability_name = request.matchdict["capability_name"]
59 params = request.json_body
60
61 if not all([expected in params for expected in expected_params]):
  • Daniel Lyons approved this merge request

    approved this merge request

  • merged

  • Charlotte Hausman
  • Charlotte Hausman
  • Charlotte Hausman
  • Please register or sign in to reply
    Loading