Credentials: List, Create, and Delete

Credentials

You can interact with credentials in your account by requesting /api/credentials, we'll leave out the standard headers (token and accept type) for brevity and assume they were assigned to a local variable called headers, see Fundamentals and Authentication on how to specify them

RestClient.get("https://manage.scalarium.com/api/credentials', headers)

Please be aware that only Account Admins can interact with credentials.

List All

When you request /api/credentials you get a list of all credentials in your account.

RestClient.get("https://manage.scalarium.com/api/credentials", headers)

Show Details on Credential

When you request /api/credentials/ID you get detailed information on that credential:

RestClient.get("https://manage.scalarium.com/api/credentials/ID', headers)

A response would look like this:

{
  "id": "a9a9a83aka954297", 
  "name": "My credential", 
  "aws_access_key_id": "AKIA111111111111111", 
  "created_at"=>"2010/04/15 14:06:54 +0000", 
  "updated_at"=>"2010/11/03 10:18:08 +0000", 
  "account_id"=>"12121212121212121212121212aavkhg",   
}

Please be aware that the Scalarium API will never return the secret key.

Create Credential

You can create a credential by POSTing to /api/credentials:

headers = {"X-Scalarium-Token" => "XXXXX",
  "Accept" => "application/vnd.scalarium-v1+json",
  "Content-Type"=>"application/json"}

RestClient.post("https://manage.scalarium.com/api/credentials',

 JSON.dump(:name => 'My credential',
           :aws_access_key_id => 'myKEY',
           :aws_secret_access_key => 'SECRET')
 headers)

Delete Credential

You can delete a credential by DELETEing to /api/credentials/ID:

RestClient.delete("https://manage.scalarium.com/api/credentials/ID', headers)

This will return an error if the credential is still in use. Only credentials that are not in use by any clouds, SSH keys, volumes, etc. can be deleted. Please delete the other items first.