Praveen,
Thanks for reaching us. You can refer the latest swaager API doc : https://github.com/goharbor/harbor/blob/master/docs/swagger.yaml.
Please help Praveen if necessary. Thanks!
thanks®ards
--
Steven (邹佳)
Engineer, CNA, VMware R&D
Mail: sz...@vmware.com
Cell: +8618600021252
Addr: 9F Tower C, Raycom Info Tech Park, No. 2 Kexueyuan South Road Haidian District, Beijing 100738 China
--
You received this message because you are subscribed to the Google Groups "harbor-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
harbor-dev+...@googlegroups.com.
To post to this group, send email to
harbo...@googlegroups.com.
Visit this group at
https://groups.google.com/group/harbor-dev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/harbor-dev/553a5e01-5258-4123-affd-95e3293c5700%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
Hi Praveen,
You can just refer to the swagger document in the goharbor repo.
https://github.com/goharbor/harbor/blob/master/docs/swagger.yaml
Thanks,
Yan
From: <harbo...@googlegroups.com> on behalf of praveen mummasani <mummasan...@gmail.com>
Date: Friday, 14 December 2018 at 5:15 AM
To: harbor-dev <harbo...@googlegroups.com>
Subject: [harbor-dev] Rest API for User Management
Hello Team,
--
To view this discussion on the web visit https://groups.google.com/d/msgid/harbor-dev/CAMOQk7Gmh2RpX2LGRqnfE%2B70Sf2h4sBZrQDQLoyM1u%3D2mJAMNg%40mail.gmail.com.
Just try with POST /projects/{project_id}/members
curl -v -u admin:Harbor12345 -d ‘{“project_id”:”7”,”user_id”:”11”,"roles":"1"}’ -H "Content-Type: application/json" -X POST https://<go-harbor-server-url>/api/projects/7/members
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: ‘”user_id”:”11”’/
* Port number ended with '?'
* Closing connection -1
curl: (3) Port number ended with '?'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: ‘roles:1’/
* Port number ended with '?'
* Closing connection -1
curl: (3) Port number ended with '?'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying <go-harbor-server>...
* TCP_NODELAY set
* Connected to <go-harbor-server> port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=US; ST=New York; L=Armonk; O=International Business Machines Corporation; CN=*.<go-harbor-server>
* start date: Feb 2 00:00:00 2018 GMT
* expire date: Apr 5 12:00:00 2021 GMT
* subjectAltName: host "<go-harbor-server>
" matched cert's "*.<go-harbor-server>
t"
* issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
* SSL certificate verify ok.
* Server auth using Basic with user 'admin'
> POST /api/projects/7/members/ HTTP/1.
> Authorization: Basic YWRtaW46SGFyYm9yMTIzNDU=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 30
>
* upload completely sent off: 30 out of 30 bytes
< HTTP/1.1 400 Bad Request
< X-Backside-Transport: FAIL FAIL
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 14 Dec 2018 06:33:21 GMT
< Server: nginx
< Set-Cookie: beegosessionID=cbf09900d634127f8ad6a0ac956fbc31; Path=/; secure; HttpOnly
< X-Global-Transaction-ID: 78ff105c5c134eb10e69d513
Praveen
To post to this group, send email to harb...@googlegroups.com.
To post to this group, send email to harbo...@googlegroups.com.
Visit this group at https://groups.google.com/group/harbor-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbor-dev/2a880766-565c-4015-9721-1263a2c5dc05%40googlegroups.com.
Yes, you should correct the request data, one example for you: add user2 as a Developer into library
POST /api/projects/1/members
{ "role_id": 2, "member_user": { "username": "user2" } }
Thanks,
Yan
From: <harbo...@googlegroups.com> on behalf of Atlas Kerr <atla...@gmail.com>
Date: Friday, 14 December 2018 at 2:49 PM
To: praveen mummasani <mummasan...@gmail.com>
Cc: harbor-dev <harbo...@googlegroups.com>
Subject: Re: [harbor-dev] Rest API for User Management
You're json structure is incorrect. Please refer to the screenshot Yan provided you.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbor-dev/CABK4ZRgOtgGrXFTyw3Pe-yTxe%3DxLi3nQVrdUJrhiqHG3He%2B0MA%40mail.gmail.com.