Revision d9fca80b

b/astakosclient/astakosclient/__init__.py
861 861
                                  method="POST")
862 862

  
863 863
    # ------------------------------------------
864
    # do a POST to ``API_PROJECTS``/<project_id>
864
    # do a PUT to ``API_PROJECTS``/<project_id>
865 865
    def modify_project(self, project_id, specs):
866 866
        """Submit application to modify an existing project
867 867

  
......
875 875
        req_headers = {'content-type': 'application/json'}
876 876
        req_body = parse_request(specs, self.logger)
877 877
        return self._call_astakos(path, headers=req_headers,
878
                                  body=req_body, method="POST")
878
                                  body=req_body, method="PUT")
879 879

  
880 880
    # -------------------------------------------------
881 881
    # do a POST to ``API_PROJECTS``/<project_id>/action
b/docs/design/resource-pool-projects.rst
379 379
Changes in the projects API
380 380
```````````````````````````
381 381

  
382
``PUT /projects`` will be used to make a new project replacing ``POST``.
383

  
384
``POST /projects/<proj_id>`` now expects a dictionary with just the desired
382
``PUT /projects/<proj_id>`` will be used to mod a new project replacing
383
``POST``. It now expects a dictionary with just the desired
385 384
changes, not a complete project definition. It is only allowed if the
386 385
project is already activated.
387 386

  
b/docs/project-api-guide.rst
155 155
Modify a Project
156 156
................
157 157

  
158
**POST** /account/v1.0/projects/<proj_id>
158
**PUT** /account/v1.0/projects/<proj_id>
159 159

  
160 160
====================  =========================
161 161
Request Header Name   Value
b/snf-astakos-app/astakos/api/projects.py
329 329
    method = request.method
330 330
    if method == "GET":
331 331
        return get_project(request, project_id)
332
    if method == "POST":
332
    if method == "PUT":
333 333
        return modify_project(request, project_id)
334
    return api.api_method_not_allowed(request, allowed_methods=['GET', 'POST'])
334
    return api.api_method_not_allowed(request, allowed_methods=['GET', 'PUT'])
335 335

  
336 336

  
337 337
@api.api_method(http_method="GET", token_required=True, user_required=False)
......
352 352
    return project
353 353

  
354 354

  
355
@api.api_method(http_method="POST", token_required=True, user_required=False)
355
@api.api_method(http_method="PUT", token_required=True, user_required=False)
356 356
@user_from_token
357 357
@transaction.commit_on_success
358 358
def modify_project(request, project_id):
b/snf-astakos-app/astakos/im/tests/projects.py
98 98
    def modify(self, app, project_id, headers):
99 99
        dump = json.dumps(app)
100 100
        kwargs = {"project_id": project_id}
101
        r = self.client.post(reverse("api_project", kwargs=kwargs), dump,
101
        r = self.client.put(reverse("api_project", kwargs=kwargs), dump,
102 102
                             content_type="application/json", **headers)
103 103
        body = json.loads(r.content)
104 104
        return r.status_code, body

Also available in: Unified diff