Hi all,
I have met same problem.
I want to use default "admin" user to manage ceph user
through "Admin Ops API" which is a REST API.
The document say that it should be used as S3 API.
However, i tried AWS java API and compose a program, the
program can't work. Even i use normal user created by me, it
Still can't work. Here's the program and error information:
public static void main(String[] args) {
// TODO Auto-generated method stub
String accessKey = "V6HI8L8AQFTX6KZGUWRJ";
String secretKey = "oNIvuCYBLegYH198ER9vBM8AxpElz1KMPg8iN05y";
AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProtocol(Protocol.HTTP);
AmazonS3 conn = new AmazonS3Client(credentials, clientConfig);
conn.setEndpoint("ceph-server");
List<Bucket> buckets = conn.listBuckets();
//Bucket bucket = conn.createBucket("my-new-bucket");
}
[Fatal Error] :1:50: There should have white space between publicId and systemId.
Exception in thread "main" com.amazonaws.AmazonClientException: Unable to unmarshall error response (在 publicId 和 systemId 之间需要有空格。)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:653)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:347)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2994)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2965)
at com.amazonaws.services.s3.AmazonS3Client.listBuckets(AmazonS3Client.java:528)
at com.amazonaws.services.s3.AmazonS3Client.listBuckets(AmazonS3Client.java:536)
at org.blaye.TestS3.main(TestS3.java:32)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 50; There should have white space between publicId and systemId.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at com.amazonaws.util.XpathUtils.documentFrom(XpathUtils.java:67)
at com.amazonaws.services.s3.internal.S3ErrorResponseHandler.handle(S3ErrorResponseHandler.java:63)
at com.amazonaws.services.s3.internal.S3ErrorResponseHandler.handle(S3ErrorResponseHandler.java:38)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:634)
... 7 more
------------------
Hui Jiang
East China University of Science and Technology
130 MeiLong Rd. Shanghai, China 200237
Mobile +86 13774493120
E-mail hjiang@xxxxxxxxxxx
------------------ Original ------------------
From: "Alvaro Izquierdo Jimeno"<aizquierdo@xxxxxxxx>;
Date: Wed, Jul 10, 2013 04:07 PM
To: "Yehuda Sadeh"<yehuda@xxxxxxxxxxx>; "Bright"<hjiang@xxxxxxxxxxx>;
Cc: "ceph-users"<ceph-users@xxxxxxxx>;
Subject: RE: [ceph-users] How to use Admin Ops API in Ceph Object Storage
I have been able to create an user with --caps="usage=read, write" and bring its usages with
GET /admin/usage?format=json HTTP/1.1
Host: ceph-server
Authorization: AWS {access-key}:{hash-of-header-and-secret}
After of this, I have created an user with --caps="user=read, write", but I can't bring its user info with
GET /admin/user?format=json HTTP/1.1
Host: ceph-server
Authorization: AWS {access-key}:{hash-of-header-and-secret}
403 forbidden is responsed.
And just another comment. When I try to modify an user, I can't change the caps field. The command
radosgw-admin user modify --uid="user" --caps="usage=read, write"
doesn't fail, but doesn't update the user.
Many thanks and best regards,
Álvaro.
-----Mensaje original-----
De: ceph-users-bounces@xxxxxxxxxxxxxx [mailto:ceph-users-bounces@xxxxxxxxxxxxxxx] En nombre de Yehuda Sadeh
Enviado el: martes, 09 de julio de 2013 18:27
Para: Bright
CC: ceph-users
Asunto: Re: [ceph-users] How to use Admin Ops API in Ceph Object Storage
On Mon, Jul 8, 2013 at 8:51 AM, Bright <hjiang@xxxxxxxxxxx> wrote:
> Hello Guys:
>
> I am working with ceph nowadys and i want to setup a system which
>
> includes a web page to create the ceph object storage user.
>
> So, i tried to use Admin Ops API to fulfill my needs. However, if
> i use
>
> GET /admin/usage?format=json HTTP/1.1
>
> Host: ceph-server
>
> it will return 403 access denied.
>
> Than, i tried to use
>
> GET /admin/usage?format=json HTTP/1.1
> Host: ceph-server
> Authorization: AWS {access-key}:{hash-of-header-and-secret}
>
> I used the key of client.user to represent access-key
You need to create rgw user for that (radosgw-admin user create) and use it.. The user itself should have the 'usage' caps set ( --caps="usage=read, write").
>
> and get the hash-of-header-and-secret accordingly.
>
> However, it still returns 403 access denied.
>
> Can anyone explain the method to deal with Admin Ops API, thanks!
>
>
> ------------------
> Hui Jiang
> East China University of Science and Technology
> 130 MeiLong Rd. Shanghai, China 200237 Mobile +86 13774493120 E-mail
> hjiang@xxxxxxxxxxx
>
>
>
> _______________________________________________
> ceph-users mailing list
> ceph-users@xxxxxxxxxxxxxx
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
____________
Verificada la ausencia de virus por G Data AntiVirus
Versión: AVA 22.10857 del 10.07.2013
Noticias de virus: www.antiviruslab.c
_______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com