Tuesday, February 25, 2014

OAM 11g PS2 Rest API Characteristics - Deleting Host Identifiers

This is a short post to capture some useful characteristics of the API when deleting a Host Identifier. Specifically, what if the delete is successful versus what if that Host Identifier can't be found? Using the same setup as before I delete a non-existent Identifier and then one that I know exists having just created it. The traffic for both is captured below:

Host Identifier Not Found

When the host identifier being specified isn't found, the traffic pattern looks like as follows within the WAMulator. I've included two such request and response cycles; one for deleting by name and the other for deleting by id.

Not Found By Name

Elapsed Time (ms): 5360
REQUEST Bytes to SERVER: 473

Canonical Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?name=aab4a168731a342a497ce32e013a3ce34 HTTP/1.1
Rewritten Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?name=aab4a168731a342a497ce32e013a3ce34 HTTP/1.1
Accept: application/json
User-Agent: Java/1.6.0_65
Host: localhost.lds.org:8080
Connection: close
X-Wmltr: handled
X-Forwarded-Scheme: http
cctx: /{/.../*,*}


RESPONSE Bytes to CLIENT: 442
HTTP/1.1 200 OK
Date: Fri, 21 Feb 2014 16:04:20 GMT
Transfer-Encoding: chunked
Content-Type: text/plain
Set-Cookie: JSESSIONID=lSpGTH5G1NS70RbyTnmsM6g4yd2BLM0ksMNG5RwJ85NGpynDMLvQ!-955026361; path=/; HttpOnly
x-oracle-dms-ecid: 32bcdd031430eb16:7e79f4e9:144504ffa11:-8000-000000000001e313
x-powered-by: Servlet/2.5 JSP/2.1
Connection: close
X-ConnId: C-012

003a
HostIdentifier not found:aab4a168731a342a497ce32e013a3ce34
0000


Not Found by Id

Elapsed Time (ms): 51
REQUEST Bytes to SERVER: 466

Canonical Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?id=non-existent-host-identifier HTTP/1.1
Rewritten Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?id=non-existent-host-identifier HTTP/1.1
Accept: application/json
Authorization: Basic d2VibG9naWM6b2FtMTFncjI=
User-Agent: Java/1.6.0_65
Host: localhost.lds.org:8080
Connection: close
X-Wmltr: handled
X-Forwarded-Scheme: http
cctx: /{/.../*,*}

RESPONSE Bytes to CLIENT: 437
HTTP/1.1 200 OK
Date: Tue, 25 Feb 2014 17:12:42 GMT
Transfer-Encoding: chunked
Content-Type: text/plain
Set-Cookie: JSESSIONID=3GTnTMPKYwGhmf8xDzFDg1y92BLZwCcs5fqGKRQ4cJmnK1Jxn2Jv!834987041; path=/; HttpOnly
x-oracle-dms-ecid: 32bcdd031430eb16:-4432c526:14465107ab6:-8000-0000000000014c0c
x-powered-by: Servlet/2.5 JSP/2.1
Connection: close
X-ConnId: C-021

0035
HostIdentifier not found:non-existent-host-identifier
0000

Host Identifier Found and Deleted

In contrast the following request and response cycles portray successfully finding and deleting a host identifier. Again, I've include deleting by name and deleting by id.

Delete by ID

Elapsed Time (ms): 61228
REQUEST Bytes to SERVER: 471

Canonical Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?id=ac8576f6258644a9388f5e692400bca25 HTTP/1.1
Rewritten Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?id=ac8576f6258644a9388f5e692400bca25 HTTP/1.1
Accept: application/json
User-Agent: Java/1.6.0_65
Host: localhost.lds.org:8080
Connection: close
X-Wmltr: handled
X-Forwarded-Scheme: http
cctx: /{/.../*,*}



RESPONSE Bytes to CLIENT: 443
HTTP/1.1 200 OK
Date: Fri, 21 Feb 2014 16:14:11 GMT
Transfer-Encoding: chunked
Content-Type: text/plain
Set-Cookie: JSESSIONID=C2KJTH7TvFnL9bHtnSN1nStbW2cH1Tz1FRY2pJcnQdJQxrWKZYqf!-955026361; path=/; HttpOnly
x-oracle-dms-ecid: 32bcdd031430eb16:7e79f4e9:144504ffa11:-8000-000000000001e6e0
x-powered-by: Servlet/2.5 JSP/2.1
Connection: close
X-ConnId: C-018

003b
HostIdentifier is deleted:ac8576f6258644a9388f5e692400bca25
0000

Delete by Name

Elapsed Time (ms): 10307
REQUEST Bytes to SERVER: 480

Canonical Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?name=it--70a5951b-11af-4b68-9f44-593b82152337 HTTP/1.1
Rewritten Req. Line: DELETE /oam/services/rest/11.1.2.0.0/ssa/policyadmin/hostidentifier?name=it--70a5951b-11af-4b68-9f44-593b82152337 HTTP/1.1
Accept: application/json
Authorization: Basic d2VibG9naWM6b2FtMTFncjI=
User-Agent: Java/1.6.0_65
Host: localhost.lds.org:8080
Connection: close
X-Wmltr: handled
X-Forwarded-Scheme: http
cctx: /{/.../*,*}


RESPONSE Bytes to CLIENT: 450
HTTP/1.1 200 OK
Date: Tue, 25 Feb 2014 17:12:31 GMT
Transfer-Encoding: chunked
Content-Type: text/plain
Set-Cookie: JSESSIONID=1GKXTMTfpPyGn0cxpbrTTvYgcypvJTJ4kYJJTLZGL3CFRvvJBvDM!834987041; path=/; HttpOnly
x-oracle-dms-ecid: 32bcdd031430eb16:-4432c526:14465107ab6:-8000-0000000000014c00
x-powered-by: Servlet/2.5 JSP/2.1
Connection: close
X-ConnId: C-020

0042
HostIdentifier is deleted:it--70a5951b-11af-4b68-9f44-593b82152337
0000

Again, 61 seconds and 10 seconds to delete an item are terribly slow and we have been told that times are supposed be improving at some point. Slowness aside, takeaways from these results are that the response payload must be evaluated to determine if the request was a success or not. Namely, if the payload contains "deleted" it was successful. If it contains "not found" then it was unable to delete the item. Although arguably the request was successful. Wasn't it? The desire was for the object to not be accessible and a "not found" result meets that criteria.



No comments:

Post a Comment