Revision f3c1a70c

b/README
1 1
Ganeti 2.5
2 2
==========
3 3

  
4
For installation instructions, read the INSTALL and the doc/install.html
4
For installation instructions, read the INSTALL and the doc/install.rst
5 5
files.
6 6

  
7 7
For a brief introduction, read the ganeti(7) manpage and the other pages
b/doc/rapi.rst
53 53

  
54 54

  
55 55
.. [#pwhash] Using the MD5 hash of username, realm and password is
56
   described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2 and
57
   3.3. The reason for using it over another algorithm is forward
56
   described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2
57
   and 3.3. The reason for using it over another algorithm is forward
58 58
   compatibility. If ``ganeti-rapi`` were to implement HTTP Digest
59 59
   authentication in the future, the same hash could be used.
60 60
   In the current version ``ganeti-rapi``'s realm, ``Ganeti Remote
b/lib/rapi/rlib2.py
19 19
# 02110-1301, USA.
20 20

  
21 21

  
22
"""Remote API version 2 baserlib.library.
23

  
24
  PUT or POST?
25
  ============
26

  
27
  According to RFC2616 the main difference between PUT and POST is that
28
  POST can create new resources but PUT can only create the resource the
29
  URI was pointing to on the PUT request.
30

  
31
  To be in context of this module for instance creation POST on
32
  /2/instances is legitim while PUT would be not, due to it does create a
33
  new entity and not just replace /2/instances with it.
34

  
35
  So when adding new methods, if they are operating on the URI entity itself,
36
  PUT should be prefered over POST.
22
"""Remote API resource implementations.
23

  
24
PUT or POST?
25
============
26

  
27
According to RFC2616 the main difference between PUT and POST is that
28
POST can create new resources but PUT can only create the resource the
29
URI was pointing to on the PUT request.
30

  
31
In the context of this module POST on ``/2/instances`` to chance an existing
32
entity is legitimate, while PUT would not be. PUT creates a new entity (e.g. a
33
new instance) with a name specified in the request.
34

  
35
Quoting from RFC2616, section 9.6:
36

  
37
  The fundamental difference between the POST and PUT requests is reflected in
38
  the different meaning of the Request-URI. The URI in a POST request
39
  identifies the resource that will handle the enclosed entity. That resource
40
  might be a data-accepting process, a gateway to some other protocol, or a
41
  separate entity that accepts annotations. In contrast, the URI in a PUT
42
  request identifies the entity enclosed with the request -- the user agent
43
  knows what URI is intended and the server MUST NOT attempt to apply the
44
  request to some other resource. If the server desires that the request be
45
  applied to a different URI, it MUST send a 301 (Moved Permanently) response;
46
  the user agent MAY then make its own decision regarding whether or not to
47
  redirect the request.
48

  
49
So when adding new methods, if they are operating on the URI entity itself,
50
PUT should be prefered over POST.
37 51

  
38 52
"""
39 53

  

Also available in: Unified diff