pS Results Codes

clappingknaveSoftware and s/w Development

Dec 14, 2013 (3 years and 7 months ago)

59 views

pS
Results
Codes

The proposal of result codes is based on the standardized solution of status codes in
HTTP protocol.

HTTP Status Codes



1xx Informational

o

100
Continue

o

101
Switching

Protocols

o

102 Processing

(WebDAV)



2xx Successful

o

200 OK

o

201 Created

o

202
Accepted

o

203 Non
-
Authoritative Information

o

204 No Content

o

205 Reset Content

o

206 Partial Content

o

207 Multi
-
Status (WebDAV)



3xx Redirection

o

300 Multiple Choices

o

301 Moved Permanently

o

302 Found

o

303 See Other

o

304 Not Modified

o

305 Use Proxy

o

307 Temporary Redire
ct



4xx Client Error

o

400 Bad Request

o

401 Unauthorized

o

402 Payment Required

o

403 Forbidden

o

404 Not Found

o

405 Method Not Allowed

o

406 Not Acceptable

o

407 Proxy Authentication Required

o

408 Request Timeout

o

409 Conflict

o

410 Gone

o

411 Length Required

o

412 Precondition

Failed

o

413 Request Entity Too Large

o

414 Request
-
URI Too Long

o

415 Unsapported Media Type

o

416 Requested Range Not Satisfiable

o

417 Expectation Failed



5xx Server Error

o

500 Internal Server Error

o

501 Not Implemented

o

502 Bad Gateway

o

503 Service Unavailable

o

504
Gateway Timeout

o

505 HTTP Version Not Supported

o

530 User Access Denied


More
information

(extended list)

about

HTTP Status Codes:
http://www.w3.org/Protocols/rfc2616/rfc2616
-
sec10.html

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

PerfSONAR

(pS)

structure

of Result Codes

Examples of
possible
pS codes:



http://perfsona
r.net/status
/

o

informational/



too_busy



don't want



backend_service_not_
available



don't want



protocol_
bridge



don't want



--
new
--



protocol_version



data limitation? (if an MA supports data set return of a certain
size or less)

o

successful/



query
/



could be MA, LS, anything?



Don't want



echo/



don't want



registration/



don't want



deregistration/



don't want



keepalive/



don't want



--
new




We don’t need any of these? Do we need the context of
the response


success is success?

o

redirection/



--
new




temp vs pe
rmanent



only reason to care is caching at the clinet?



Would the clients do this?



No real use cases

o

clienterror/



new … bad_message



used to be called …
bad_
request/






bad format .. syntax error?



XML vs semantic error?

o

Not a big deal in the code itself, but there is a
text response.

o

Give the context in the textual format

o

No distinction between the two in this case in
the code



bad_request/



wrong endpoint … on a given node



Unable to authenticate/



Couldn’t tell who you ar
e


auth failed



unauthorized/



cant have a resource



met
h
od_
not
_
allowed/



don't want



not
_
acceptable/



not sure what this means?



Don't want



Server error (by itself)



message_
not
_
allowed/



using an ma message at an ls



event
_
type
_
not
_
allowed/



using an unsupported e
vent type, or using an event type
in the wrong manner



expected
_
response
_
tool
_
arge/



don't know what this means



don't want



use server error by itself …



--
new




413 Request Entity Too Large



message too large … prevent dos?



Request Timeout



Waiting too long for

the request to finish … first n bytes
come in, not the rest



Protocol_not_allowed



Client is sending in a request … using a different
version of namespace or SOAP we don't understand.
Different than event or message mismatch

o

servererror/



internal
_
server
_
er
ror/



do we need?



Just use server error?



…could the client make a different decision based on
this error vs any other?



Don't want … text message will describe



service
_
unavailable/



temporary vs permanent?




Down for maintenance … vs I will never be able
to do

what you want me to do (asking an MP to do the
job of an MA)



yes … we need both…



prot
ocol
_
not
_
supported/



unknown_version/



don't need this, covered in the client



d
ata
_
fetch
_
error/



have a complete valid request, but the backend is
broken …



--
new
--



too_busy
/



the server can’t respond at this time, temporary?



Admin_Down



Service_unsupported



Don't need … bad request in the client message covers
this

Response examples

Echo message response

<nmwg:message id="resp1"


type="EchoResponse"


xmlns
:nmwg=http://ggf.org/ns/nmwg/base/2.0/


xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">



<nmwg:metadata id="result
-
code">


<nmwg:eventType>


http://perfsonar.net/status/successful/echo
/


</nmwg:eventType>


</nmwg:metadata>



<nmwg:data id="result
-
code
-
desc" metadataIdRef="result
-
code">


<nmwgr:datum>


This is the success echo response from the service.


</nmwgr:datum>


</
nmwg:data>


</nmwg:message>

MetadataKeyResponse

<nmwg:message id="resp1"


type="MetadataKeyResponse"


xmlns:nmwg=http://ggf.org/ns/nmwg/base/2.0/


xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">



<nmwg:metadata id="resu
lt
-
code">


<nmwg:eventType>


http://perfsonar.net/status/servererror/data
_
fetch
_
error/


</nmwg:eventType>


</nmwg:metadata>



<nmwg:data id="result
-
code
-
desc" metadataIdRef="result
-
code">


<nmwgr:datum>


Requested metadata items are
not available.


</nmwgr:datum>


</nmwg:data>


</nmwg:message>

Extended response

Use of datum element of a namespaces which depends on a type of result code

(eventType says what type it is)


Example:


<nmwg:message id="resp1"


type="
EchoResponse"


xmlns:nmwg=http://ggf.org/ns/nmwg/base/2.0/


xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">



<nmwg:metadata id="result
-
code">


<nmwg:eventType>


h
ttp://perfsonar.net/status/successful/echo
/


</nmwg:eventType>


</nmwg:metadata>



<nmwg:data id="result
-
code
-
desc" metadataIdRef="result
-
code">


<
echo
:datum xmlns:
echo
="
http://ggf.org/ns/nmwg/result/
echo/
2.0/
">


<!
--

the content depends on the type of this datum element
w
hich is i
n
dicated


by its namespace
--
>


</
echo
:datum>


</nmwg:data>


</nmwg:message>

Addin
g

new result codes

All new result codes requested by pS

service maintainers and developers should be
discussed and agreed within OGF NMC
-
WG group.




Work on 7/16 produced this:





http://perfsonar.net/status
/

o

informational/
-

valid responses for informational request

… the
general use of this top level is ok … here are the subclasses



protocol_version



data limitation? (if an MA supports data set return of a certain
size or less)



contact (email, name, domain, project (community))



return the service block (what would be

sent to the ls)

o

successful/

o

redirection/
-

temporary thing … do not expect clients to cache it, ask
for the url again

o

clienterror/



bad_message



bad format .. syntax error?



XML vs semantic error?

o

Not a big deal in the code itself, but there is a
text respon
se.

o

Give the context in the textual format

o

No distinction between the two in this case in
the code



bad_request/



wrong endpoint … on a given node



authentication_failed/



Couldn’t tell who you are


auth failed



unauthorized/



cant have a resource



message
_not_allowed/



using an ma message at an ls



event_type_not_allowed/



using an unsupported event type, or using an event type
in the wrong manner



request_too_large



message too large … prevent dos?



Too large of an xml message …



Request_timeout



Waiting too lon
g for the request to finish … first n bytes
come in, not the rest



Protocol_not_allowed



Client is sending in a request … using a different
version of namespace or SOAP we don't understand.
Different than event or message mismatch

o

servererror/



data_fetch_er
ror/



have a complete valid request, but the backend is
broken …



too_busy/



the server can’t respond at this time, temporary?



admin_Down