Re: [Openstack] Fwd: Documentation for openstack-java-sdk

2013-07-11 Thread Gui Maluf
Surely Luis can help you, I've used openstack-java-sdk in one of my
projects, and this is the example Luis gave to me


private static final File TEST_FILE = new File(pom.xml);

 private static final String KEYSTONE_AUTH_URL = 
https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0;;

 private static final String KEYSTONE_USERNAME = ;

 private static final String KEYSTONE_PASSWORD = ;


 /**

 * @param args

 */

public static void main(String[] args) throws Exception {

 KeystoneClient keystone = new KeystoneClient(KEYSTONE_AUTH_URL);

 //access with unscoped token

 Access access = keystone.execute(Authenticate.withPasswordCredentials(
KEYSTONE_USERNAME, KEYSTONE_PASSWORD));

  //use the token in the following requests

 keystone.setToken(access.getToken().getId());

  Tenants tenants = keystone.execute(new ListTenants());

  //try to exchange token using the first tenant

 if(tenants.getList().size()  0) {

   access =
keystone.execute(Authenticate.withToken(access.getToken().getId()).withTenantId(tenants.getList().get(0).getId()));

   SwiftClient swiftClient =
newSwiftClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(),
object-store, null, public), access.getToken().getId());

   //swiftClient.execute(new DeleteContainer(navidad2));

   swiftClient.execute(new CreateContainer(navidad2));

   System.out.println(swiftClient.execute(new ListContainers()));

   ObjectForUpload upload = new ObjectForUpload();

 upload.setContainer(navidad2);

 upload.setName(example2);

 upload.setInputStream(new FileInputStream(TEST_FILE));

 swiftClient.execute(new UploadObject(upload));

   System.out.println(swiftClient.execute(new ListObjects(navidad2,
new HashMapString,
String() {{

  put(path, );

 }})).get(0).getContentType());

   }


 }



On Thu, Jul 11, 2013 at 11:31 AM, Endre Karlson endre.karl...@gmail.comwrote:

 I think Luis can answer that?
 -- Videresendt melding --
 Fra: Jobin Raju George jobin...@gmail.com
 Dato: 11. juli 2013 14:38
 Emne: [Openstack] Documentation for openstack-java-sdk
 Til: openstack lista openstack@lists.launchpad.net
 Kopi:

 I am trying to query ceilometer using 
 openstack-java-sdkhttps://github.com/woorea/openstack-java-sdkfor meters of 
 VM's running on KVM. I am able to get the CPU meters via curl
 on the command line but unfortunately I don't find good documentation for
 the SDK's for ceilometer.

 I have seen this example 
 programhttps://github.com/woorea/openstack-java-sdk/blob/master/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java
  but
 most of it is commented(probably because it is deprecated).

 Where can I find good documentation/examples or java programs/snippets?

 --

  Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




-- 
*guilherme* \n
\t *maluf*
___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Fwd: Documentation for openstack-java-sdk

2013-07-11 Thread Jobin Raju George
Thanks a log, Gui! This helps but would be more useful if you could point
me to some *ceilometer-specific *guides/examples.


On Thu, Jul 11, 2013 at 8:25 PM, Gui Maluf guimal...@gmail.com wrote:

 Surely Luis can help you, I've used openstack-java-sdk in one of my
 projects, and this is the example Luis gave to me


 private static final File TEST_FILE = new File(pom.xml);

  private static final String KEYSTONE_AUTH_URL = 
 https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0;;

  private static final String KEYSTONE_USERNAME = ;

  private static final String KEYSTONE_PASSWORD = ;


  /**

  * @param args

  */

 public static void main(String[] args) throws Exception {

  KeystoneClient keystone = new KeystoneClient(KEYSTONE_AUTH_URL);

  //access with unscoped token

  Access access = keystone.execute(Authenticate.withPasswordCredentials(
 KEYSTONE_USERNAME, KEYSTONE_PASSWORD));

   //use the token in the following requests

  keystone.setToken(access.getToken().getId());

   Tenants tenants = keystone.execute(new ListTenants());

   //try to exchange token using the first tenant

  if(tenants.getList().size()  0) {

access =
 keystone.execute(Authenticate.withToken(access.getToken().getId()).withTenantId(tenants.getList().get(0).getId()));

SwiftClient swiftClient = 
 newSwiftClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(),
 object-store, null, public), access.getToken().getId());

//swiftClient.execute(new DeleteContainer(navidad2));

swiftClient.execute(new CreateContainer(navidad2));

System.out.println(swiftClient.execute(new ListContainers()));

ObjectForUpload upload = new ObjectForUpload();

  upload.setContainer(navidad2);

  upload.setName(example2);

  upload.setInputStream(new FileInputStream(TEST_FILE));

  swiftClient.execute(new UploadObject(upload));

System.out.println(swiftClient.execute(new ListObjects(navidad2, new 
 HashMapString,
 String() {{

   put(path, );

  }})).get(0).getContentType());

}


  }



 On Thu, Jul 11, 2013 at 11:31 AM, Endre Karlson 
 endre.karl...@gmail.comwrote:

 I think Luis can answer that?
 -- Videresendt melding --
 Fra: Jobin Raju George jobin...@gmail.com
 Dato: 11. juli 2013 14:38
 Emne: [Openstack] Documentation for openstack-java-sdk
 Til: openstack lista openstack@lists.launchpad.net
 Kopi:

 I am trying to query ceilometer using 
 openstack-java-sdkhttps://github.com/woorea/openstack-java-sdkfor meters 
 of VM's running on KVM. I am able to get the CPU meters via curl
 on the command line but unfortunately I don't find good documentation for
 the SDK's for ceilometer.

 I have seen this example 
 programhttps://github.com/woorea/openstack-java-sdk/blob/master/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java
  but
 most of it is commented(probably because it is deprecated).

 Where can I find good documentation/examples or java programs/snippets?

 --

  Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




 --
 *guilherme* \n
 \t *maluf*

 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




-- 

Thanks and regards,

Jobin Raju George

Third Year, Information Technology

College of Engineering Pune

Alternate e-mail: georgejr10...@coep.ac.in
___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Fwd: Documentation for openstack-java-sdk

2013-07-11 Thread Gui Maluf
I know nothing about ceilometer.
I think the best thing is to checkout the classes on github and make a lot
of tests. Probably to functioning of objects and methods are the same in
ceilometer.
CHeckout the methods and try to workout with it.
:)
Good luck!


On Thu, Jul 11, 2013 at 11:59 AM, Jobin Raju George jobin...@gmail.comwrote:

 Thanks a log, Gui! This helps but would be more useful if you could point
 me to some *ceilometer-specific *guides/examples.


 On Thu, Jul 11, 2013 at 8:25 PM, Gui Maluf guimal...@gmail.com wrote:

 Surely Luis can help you, I've used openstack-java-sdk in one of my
 projects, and this is the example Luis gave to me


 private static final File TEST_FILE = new File(pom.xml);

  private static final String KEYSTONE_AUTH_URL = 
 https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0;;

  private static final String KEYSTONE_USERNAME = ;

  private static final String KEYSTONE_PASSWORD = ;


  /**

  * @param args

  */

 public static void main(String[] args) throws Exception {

  KeystoneClient keystone = new KeystoneClient(KEYSTONE_AUTH_URL);

  //access with unscoped token

  Access access = keystone.execute(Authenticate.withPasswordCredentials(
 KEYSTONE_USERNAME, KEYSTONE_PASSWORD));

   //use the token in the following requests

  keystone.setToken(access.getToken().getId());

   Tenants tenants = keystone.execute(new ListTenants());

   //try to exchange token using the first tenant

  if(tenants.getList().size()  0) {

access =
 keystone.execute(Authenticate.withToken(access.getToken().getId()).withTenantId(tenants.getList().get(0).getId()));

SwiftClient swiftClient = 
 newSwiftClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(),
 object-store, null, public), access.getToken().getId());

//swiftClient.execute(new DeleteContainer(navidad2));

swiftClient.execute(new CreateContainer(navidad2));

System.out.println(swiftClient.execute(new ListContainers()));

ObjectForUpload upload = new ObjectForUpload();

  upload.setContainer(navidad2);

  upload.setName(example2);

  upload.setInputStream(new FileInputStream(TEST_FILE));

  swiftClient.execute(new UploadObject(upload));

System.out.println(swiftClient.execute(new ListObjects(navidad2, new 
 HashMapString,
 String() {{

   put(path, );

  }})).get(0).getContentType());

}


  }



 On Thu, Jul 11, 2013 at 11:31 AM, Endre Karlson 
 endre.karl...@gmail.comwrote:

 I think Luis can answer that?
 -- Videresendt melding --
 Fra: Jobin Raju George jobin...@gmail.com
 Dato: 11. juli 2013 14:38
 Emne: [Openstack] Documentation for openstack-java-sdk
 Til: openstack lista openstack@lists.launchpad.net
 Kopi:

 I am trying to query ceilometer using 
 openstack-java-sdkhttps://github.com/woorea/openstack-java-sdkfor meters 
 of VM's running on KVM. I am able to get the CPU meters via curl
 on the command line but unfortunately I don't find good documentation for
 the SDK's for ceilometer.

 I have seen this example 
 programhttps://github.com/woorea/openstack-java-sdk/blob/master/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java
  but
 most of it is commented(probably because it is deprecated).

 Where can I find good documentation/examples or java programs/snippets?

 --

  Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




 --
 *guilherme* \n
 \t *maluf*

 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




 --

 Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in




-- 
*guilherme* \n
\t *maluf*
___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Fwd: Documentation for openstack-java-sdk

2013-07-11 Thread Jobin Raju George
Okay, thanks Gui! Lets see how things go, but still I'm awaiting a little
help with respect to the documentation and examples :/


On Thu, Jul 11, 2013 at 8:31 PM, Gui Maluf guimal...@gmail.com wrote:

 I know nothing about ceilometer.
 I think the best thing is to checkout the classes on github and make a lot
 of tests. Probably to functioning of objects and methods are the same in
 ceilometer.
 CHeckout the methods and try to workout with it.
 :)
 Good luck!


 On Thu, Jul 11, 2013 at 11:59 AM, Jobin Raju George jobin...@gmail.comwrote:

 Thanks a log, Gui! This helps but would be more useful if you could point
 me to some *ceilometer-specific *guides/examples.


 On Thu, Jul 11, 2013 at 8:25 PM, Gui Maluf guimal...@gmail.com wrote:

 Surely Luis can help you, I've used openstack-java-sdk in one of my
 projects, and this is the example Luis gave to me


 private static final File TEST_FILE = new File(pom.xml);

  private static final String KEYSTONE_AUTH_URL = 
 https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0;;

  private static final String KEYSTONE_USERNAME = ;

  private static final String KEYSTONE_PASSWORD = ;


  /**

  * @param args

  */

 public static void main(String[] args) throws Exception {

  KeystoneClient keystone = new KeystoneClient(KEYSTONE_AUTH_URL);

  //access with unscoped token

  Access access = keystone.execute(Authenticate.withPasswordCredentials(
 KEYSTONE_USERNAME, KEYSTONE_PASSWORD));

   //use the token in the following requests

  keystone.setToken(access.getToken().getId());

   Tenants tenants = keystone.execute(new ListTenants());

   //try to exchange token using the first tenant

  if(tenants.getList().size()  0) {

access =
 keystone.execute(Authenticate.withToken(access.getToken().getId()).withTenantId(tenants.getList().get(0).getId()));

SwiftClient swiftClient = 
 newSwiftClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(),
 object-store, null, public), access.getToken().getId());

//swiftClient.execute(new DeleteContainer(navidad2));

swiftClient.execute(new CreateContainer(navidad2));

System.out.println(swiftClient.execute(new ListContainers()));

ObjectForUpload upload = new ObjectForUpload();

  upload.setContainer(navidad2);

  upload.setName(example2);

  upload.setInputStream(new FileInputStream(TEST_FILE));

  swiftClient.execute(new UploadObject(upload));

System.out.println(swiftClient.execute(new ListObjects(navidad2,
 new HashMapString, String() {{

   put(path, );

  }})).get(0).getContentType());

}


  }



 On Thu, Jul 11, 2013 at 11:31 AM, Endre Karlson endre.karl...@gmail.com
  wrote:

 I think Luis can answer that?
 -- Videresendt melding --
 Fra: Jobin Raju George jobin...@gmail.com
 Dato: 11. juli 2013 14:38
 Emne: [Openstack] Documentation for openstack-java-sdk
 Til: openstack lista openstack@lists.launchpad.net
 Kopi:

 I am trying to query ceilometer using 
 openstack-java-sdkhttps://github.com/woorea/openstack-java-sdkfor meters 
 of VM's running on KVM. I am able to get the CPU meters via curl
 on the command line but unfortunately I don't find good documentation for
 the SDK's for ceilometer.

 I have seen this example 
 programhttps://github.com/woorea/openstack-java-sdk/blob/master/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java
  but
 most of it is commented(probably because it is deprecated).

 Where can I find good documentation/examples or java programs/snippets?

 --

  Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




 --
 *guilherme* \n
 \t *maluf*

 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp




 --

 Thanks and regards,

 Jobin Raju George

 Third Year, Information Technology

 College of Engineering Pune

 Alternate e-mail: georgejr10...@coep.ac.in




 --
 *guilherme* \n
 \t *maluf*




-- 

Thanks and regards,

Jobin Raju George

Third Year, Information Technology

College of Engineering Pune

Alternate e-mail: georgejr10...@coep.ac.in
___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   :