Created
October 7, 2015 09:06
-
-
Save andrewroberts/555bda61b69d4a572fd7 to your computer and use it in GitHub Desktop.
GAS OpenStack API Library example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Memset/OpenStack API | |
// -------------------- | |
// Include the GAS OpenStack library - Mo6MqgzKidu5VYzZ7NzIM-tnfWGfgtIUb | |
// Complete these fields appropriately for your storage provider | |
var OPENSTACK_ROOT_URL = '[URL of storage using OpenStack API]' // e.g. 'https://auth.storage.memset.com/v2.0/' | |
var OPENSTACK_USERNAME = '[Enter username here]' | |
var OPENSTACK_PASSWORD = '[Enter password here]' | |
var OPENSTACK_TENANT = '[Enter name of cloud store]' | |
var FILE_PATH = '[Enter the path of the file within the cloud store]' // e.g. /root/file1.csv | |
function testOpenStackLibrary() { | |
var authToken = OpenStack.connect( | |
OPENSTACK_ROOT_URL, | |
OPENSTACK_TENANT, | |
OPENSTACK_USERNAME, | |
OPENSTACK_PASSWORD) | |
var fileContents = OpenStack.get(authToken, FILE_PATH) | |
Logger.log(fileContents) | |
} // testOpenStackLibrary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment