Re: adding repository through web API
Case solved. It seems I incorrectly assumed that passing content-type application/json and json encoded repository information will work. Anyway, once I passed url encoded repository it worked flawlessy (well it does read that payload needs to be multi-part form data in the documentation). -- Maciek Borzecki On Fri, Jul 15, 2011 at 11:20 AM, Maciek Borzecki wrote: > Uhh went too fast, disregard the GET part, forgot to encode that in > url, anyway the POST problem still holds, > -- > Maciek Borzecki > > > > On Fri, Jul 15, 2011 at 10:29 AM, Maciek Borzecki > wrote: >> After upgrading to 1.5.5 I still have problems adding repositories >> remotely. The request body is as follows (content-type is set to >> application/json): >> {"path": "http://10.10.16.117/scm/git/wifi.git";, "tool": "Git", "name": >> "wifi"} >> While the response is 400 Bad Request with data: >> {"fields": {"path": ["This field is required"], "tool": ["This field >> is required"], "{\"path\": \"http://10.10.16.117/scm/git/wifi.git\";, >> \"tool\": \"Git\", \"name\": \"wifi\"}": ["Field is not supported"], >> "name": ["This field is required"]}, "stat": "fail", "err": {"msg": >> "One or more fields had errors", "code": 105}} >> >> Then I tried with simple GET to api/repostories passing >> {"counts-only": true} as data, but got the list of all repositories >> instead of repository count. >> >> I'm not sure if there's something wrong with how simplejson encodes >> data or httplib passing data in request. But checking the request with >> wireshark it does seem to be valid. >> >> -- >> Maciek Borzecki >> >> >> >> On Wed, Jul 13, 2011 at 8:10 PM, Christian Hammond >> wrote: >>> What version are you using, and are you logged into the API as an >>> administrator? >>> >>> Christian >>> >>> -- >>> Christian Hammond - chip...@chipx86.com >>> Review Board - http://www.reviewboard.org >>> VMware, Inc. - http://www.vmware.com >>> >>> >>> On Wed, Jul 13, 2011 at 9:54 AM, maciek borzecki >>> wrote: I'm trying to add ~50 repositories programmatically using web API. However, for some reason, even if I pass a valid rbsessionid in cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ repositories with repository described as follows: {"path": "http:// 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. When listing links property as got in GET on /review/api/repositories, I see: {'self': {'href': 'http://10.10.16.117/review/api/repositories/', 'method': 'GET'}}. I think that as "create" is missing, I won't be able to do the actual POST. Is there something I'm missing from rb configuration? Thanks, Maciek -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en >>> >>> -- >>> Want to help the Review Board project? Donate today at >>> http://www.reviewboard.org/donate/ >>> Happy user? Let us know at http://www.reviewboard.org/users/ >>> -~--~~~~--~~--~--~--- >>> To unsubscribe from this group, send email to >>> reviewboard+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/reviewboard?hl=en >> > -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
Re: adding repository through web API
Uhh went too fast, disregard the GET part, forgot to encode that in url, anyway the POST problem still holds, -- Maciek Borzecki On Fri, Jul 15, 2011 at 10:29 AM, Maciek Borzecki wrote: > After upgrading to 1.5.5 I still have problems adding repositories > remotely. The request body is as follows (content-type is set to > application/json): > {"path": "http://10.10.16.117/scm/git/wifi.git";, "tool": "Git", "name": > "wifi"} > While the response is 400 Bad Request with data: > {"fields": {"path": ["This field is required"], "tool": ["This field > is required"], "{\"path\": \"http://10.10.16.117/scm/git/wifi.git\";, > \"tool\": \"Git\", \"name\": \"wifi\"}": ["Field is not supported"], > "name": ["This field is required"]}, "stat": "fail", "err": {"msg": > "One or more fields had errors", "code": 105}} > > Then I tried with simple GET to api/repostories passing > {"counts-only": true} as data, but got the list of all repositories > instead of repository count. > > I'm not sure if there's something wrong with how simplejson encodes > data or httplib passing data in request. But checking the request with > wireshark it does seem to be valid. > > -- > Maciek Borzecki > > > > On Wed, Jul 13, 2011 at 8:10 PM, Christian Hammond > wrote: >> What version are you using, and are you logged into the API as an >> administrator? >> >> Christian >> >> -- >> Christian Hammond - chip...@chipx86.com >> Review Board - http://www.reviewboard.org >> VMware, Inc. - http://www.vmware.com >> >> >> On Wed, Jul 13, 2011 at 9:54 AM, maciek borzecki >> wrote: >>> >>> I'm trying to add ~50 repositories programmatically using web API. >>> However, for some reason, even if I pass a valid rbsessionid in >>> cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ >>> repositories with repository described as follows: {"path": "http:// >>> 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. >>> >>> When listing links property as got in GET on /review/api/repositories, >>> I see: >>> {'self': {'href': 'http://10.10.16.117/review/api/repositories/', >>> 'method': 'GET'}}. >>> I think that as "create" is missing, I won't be able to do the actual >>> POST. >>> Is there something I'm missing from rb configuration? >>> >>> Thanks, >>> Maciek >>> >>> -- >>> Want to help the Review Board project? Donate today at >>> http://www.reviewboard.org/donate/ >>> Happy user? Let us know at http://www.reviewboard.org/users/ >>> -~--~~~~--~~--~--~--- >>> To unsubscribe from this group, send email to >>> reviewboard+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/reviewboard?hl=en >> >> -- >> Want to help the Review Board project? Donate today at >> http://www.reviewboard.org/donate/ >> Happy user? Let us know at http://www.reviewboard.org/users/ >> -~--~~~~--~~--~--~--- >> To unsubscribe from this group, send email to >> reviewboard+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/reviewboard?hl=en > -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
Re: adding repository through web API
After upgrading to 1.5.5 I still have problems adding repositories remotely. The request body is as follows (content-type is set to application/json): {"path": "http://10.10.16.117/scm/git/wifi.git";, "tool": "Git", "name": "wifi"} While the response is 400 Bad Request with data: {"fields": {"path": ["This field is required"], "tool": ["This field is required"], "{\"path\": \"http://10.10.16.117/scm/git/wifi.git\";, \"tool\": \"Git\", \"name\": \"wifi\"}": ["Field is not supported"], "name": ["This field is required"]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}} Then I tried with simple GET to api/repostories passing {"counts-only": true} as data, but got the list of all repositories instead of repository count. I'm not sure if there's something wrong with how simplejson encodes data or httplib passing data in request. But checking the request with wireshark it does seem to be valid. -- Maciek Borzecki On Wed, Jul 13, 2011 at 8:10 PM, Christian Hammond wrote: > What version are you using, and are you logged into the API as an > administrator? > > Christian > > -- > Christian Hammond - chip...@chipx86.com > Review Board - http://www.reviewboard.org > VMware, Inc. - http://www.vmware.com > > > On Wed, Jul 13, 2011 at 9:54 AM, maciek borzecki > wrote: >> >> I'm trying to add ~50 repositories programmatically using web API. >> However, for some reason, even if I pass a valid rbsessionid in >> cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ >> repositories with repository described as follows: {"path": "http:// >> 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. >> >> When listing links property as got in GET on /review/api/repositories, >> I see: >> {'self': {'href': 'http://10.10.16.117/review/api/repositories/', >> 'method': 'GET'}}. >> I think that as "create" is missing, I won't be able to do the actual >> POST. >> Is there something I'm missing from rb configuration? >> >> Thanks, >> Maciek >> >> -- >> Want to help the Review Board project? Donate today at >> http://www.reviewboard.org/donate/ >> Happy user? Let us know at http://www.reviewboard.org/users/ >> -~--~~~~--~~--~--~--- >> To unsubscribe from this group, send email to >> reviewboard+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/reviewboard?hl=en > > -- > Want to help the Review Board project? Donate today at > http://www.reviewboard.org/donate/ > Happy user? Let us know at http://www.reviewboard.org/users/ > -~--~~~~--~~--~--~--- > To unsubscribe from this group, send email to > reviewboard+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/reviewboard?hl=en -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
Re: adding repository through web API
Uhh, my bad. I'm using 1.5, just noticed that adding repositories through web API came in 1.5.4. -- Maciek Borzecki On Wed, Jul 13, 2011 at 8:10 PM, Christian Hammond wrote: > What version are you using, and are you logged into the API as an > administrator? > > Christian > > -- > Christian Hammond - chip...@chipx86.com > Review Board - http://www.reviewboard.org > VMware, Inc. - http://www.vmware.com > > > On Wed, Jul 13, 2011 at 9:54 AM, maciek borzecki > wrote: >> >> I'm trying to add ~50 repositories programmatically using web API. >> However, for some reason, even if I pass a valid rbsessionid in >> cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ >> repositories with repository described as follows: {"path": "http:// >> 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. >> >> When listing links property as got in GET on /review/api/repositories, >> I see: >> {'self': {'href': 'http://10.10.16.117/review/api/repositories/', >> 'method': 'GET'}}. >> I think that as "create" is missing, I won't be able to do the actual >> POST. >> Is there something I'm missing from rb configuration? >> >> Thanks, >> Maciek >> >> -- >> Want to help the Review Board project? Donate today at >> http://www.reviewboard.org/donate/ >> Happy user? Let us know at http://www.reviewboard.org/users/ >> -~--~~~~--~~--~--~--- >> To unsubscribe from this group, send email to >> reviewboard+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/reviewboard?hl=en > > -- > Want to help the Review Board project? Donate today at > http://www.reviewboard.org/donate/ > Happy user? Let us know at http://www.reviewboard.org/users/ > -~--~~~~--~~--~--~--- > To unsubscribe from this group, send email to > reviewboard+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/reviewboard?hl=en -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
Re: adding repository through web API
What version are you using, and are you logged into the API as an administrator? Christian -- Christian Hammond - chip...@chipx86.com Review Board - http://www.reviewboard.org VMware, Inc. - http://www.vmware.com On Wed, Jul 13, 2011 at 9:54 AM, maciek borzecki wrote: > I'm trying to add ~50 repositories programmatically using web API. > However, for some reason, even if I pass a valid rbsessionid in > cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ > repositories with repository described as follows: {"path": "http:// > 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. > > When listing links property as got in GET on /review/api/repositories, > I see: > {'self': {'href': 'http://10.10.16.117/review/api/repositories/', > 'method': 'GET'}}. > I think that as "create" is missing, I won't be able to do the actual > POST. > Is there something I'm missing from rb configuration? > > Thanks, > Maciek > > -- > Want to help the Review Board project? Donate today at > http://www.reviewboard.org/donate/ > Happy user? Let us know at http://www.reviewboard.org/users/ > -~--~~~~--~~--~--~--- > To unsubscribe from this group, send email to > reviewboard+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/reviewboard?hl=en -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
adding repository through web API
I'm trying to add ~50 repositories programmatically using web API. However, for some reason, even if I pass a valid rbsessionid in cookie, I get 405 Method Not Allowed. I'm doing POST on /review/api/ repositories with repository described as follows: {"path": "http:// 10.10.16.11/scm/git/wific.git", "tool": "Git", "name": "wific"}. When listing links property as got in GET on /review/api/repositories, I see: {'self': {'href': 'http://10.10.16.117/review/api/repositories/', 'method': 'GET'}}. I think that as "create" is missing, I won't be able to do the actual POST. Is there something I'm missing from rb configuration? Thanks, Maciek -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~--~~~~--~~--~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en