Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-04-20 Thread Imesh Gunaratne
Yes, IMO we need to merge successful message and error message formats into one generic response message format: { "status":"successful", "message":"Application A1 created successfully" } { "status":"error", "message":"An application with the id A1 already exists" } On Fri, Apr 17,

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-04-17 Thread Mariangela Hills
Has a final decision been reached regarding the response message format? Regards, Mariangela *--* Mariangela Hills Senior Technical Writer *WSO2, Inc.*lean.enterprise.middleware. m: +94 773 500185 w: http://wso2.com On Thu, Mar 19, 2015 at 6:11 PM, Vishanth Balasubr

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-19 Thread Vishanth Balasubramaniam
Hi Devs, IMO I think it is ok to have the statusCode in the success response. And +1 for using "statusMessage" instead of "successMessage". Regards, Vishanth On Thu, Mar 19, 2015 at 12:42 AM, Imesh Gunaratne wrote: > Hi Devs, > > I'm -1 to following response message format: > > {"statusCode":*

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-18 Thread Imesh Gunaratne
Hi Devs, I'm -1 to following response message format: {"statusCode":*200*,"successMessage":"Tenant added successfully: [tenant] frank.com"} 1. We might not need to repeat HTTP status code again in the message body. Instead we could have an attribute called "status" and say whether the message wa

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-17 Thread Mariangela Hills
Thanks, Udara! This same issue occurs when adding the following: - user - https://issues.apache.org/jira/browse/STRATOS-1266 - network partition - https://issues.apache.org/jira/browse/STRATOS-1260 I have created JIRAs to track these tasks. Regards, Mariangela *--* Mariangela Hills Se

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-17 Thread Udara Liyanage
Hi Mari, Tenant addition is fixed now with cd182f21ef31a6a94d71f72f62759a64b29450ce udara@puppet:~/projects/stratos [master]$ curl -X POST -H "Content-Type: application/json" -d @'tenant.json' -k -v -u admin:admin https://localhost:9443/api/tenants * Hostname was NOT found in DNS cache * Tryin

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-17 Thread Mariangela Hills
I just added a user and I faced the same issue! > POST /api/users HTTP/1.1 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8| zlib/1.2.5 > Host: localhost:9443 > Accept: */* > Content-Type: application/json > Content-Length: 14

Re: [Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-17 Thread Udara Liyanage
Hi Mari, The reason is it returns a CREATED response (201) with a message code OK (200). This is a bug, thanks for reporting return Response.created(url).entity( new SuccessResponseBean(Response.Status.OK.getStatusCode(), String.format("Tenant added successfully: [tena

[Question] Is is correct for two different status codes appear when adding a tenant?

2015-03-17 Thread Mariangela Hills
Is it correct that two different status codes appear when adding a tenant? curl -X POST -H "Content-Type: application/json" -d @'tenant.json' -k -v -u admin:admin https://localhost:9443/api/tenants * About to connect() to localhost port 9443 (#0) * Trying ::1... * connected * Connected to localh