Skip to content

Instantly share code, notes, and snippets.

@uemuraj
Created January 31, 2012 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uemuraj/1710823 to your computer and use it in GitHub Desktop.
Save uemuraj/1710823 to your computer and use it in GitHub Desktop.
さくらのクラウドのAPIを試してみた
#!/usr/bin/env groovy
def apikey = "99999999999999999999999"
def secret = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Authenticator.default = new Authenticator() {
public PasswordAuthentication getPasswordAuthentication () {
return new PasswordAuthentication (apikey, secret.toCharArray());
}
}
def spec = "https://secure.sakura.ad.jp/cloud/api/cloud/0.2/server"
println groovy.json.JsonOutput.prettyPrint(new URL(spec).getText());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment