The trivial-openstack Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The trivial-openstack Reference Manual

This is the trivial-openstack Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 15:55:45 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Trivial-OpenStack

Build Status Coverage Status

Trivial-OpenStack is a simple OpenStack REST client/library implemented in Common Lisp.

Currently, it offers bindings for the following OpenStack services:

Keystone (Identity) Service

Glance (Image) Service

Nova (Compute) Service

Expect full documentation in the near future.

Installation

Since May 1, 2016, Trivial-OpenStack is available via Quicklisp, and can be installed using the following command:

CL-USER> (ql:quickload 'trivial-openstack)

Getting Started

Getting started with Trivial-OpenStack is easy. The first thing we need to do is to authenticate with the OpenStack Keystone (identity) service:

TRIVIAL-OPENSTACK> (authenticate "192.168.1.8" "admin" "swordfish")

And that's it! Now you can invoke any API bindings that you like, for examples:

TRIVIAL-OPENSTACK> (list-images) ; list currently available images
(("cirros-0.3.4-x86_64-uec" . "c4947a88-3b38-44d5-b605-edad3cf1191b")
 ("cirros-0.3.4-x86_64-uec-ramdisk" . "619726e7-b3b1-4d39-8669-cf05fb04981d")
 ("cirros-0.3.4-x86_64-uec-kernel" . "b5afe28f-3ed5-4d4e-8094-fac19d2d7ac3"))
TRIVIAL-OPENSTACK> (list-flavors) ; list currently available flavors
(("m1.tiny" . "1") ("m1.small" . "2") ("m1.medium" . "3")
 ("m1.large" . "4") ("m1.nano" . "42") ("m1.xlarge" . "5")
 ("m1.micro" . "84"))
TRIVIAL-OPENSTACK> (create-server "test-00" "c4947a88-3b38-44d5-b605-edad3cf1191b" "1") ; create a new server
"0a427e44-8d69-4b02-a747-0eb731ba02ad"
TRIVIAL-OPENSTACK> 

Dependencies

License

Copyright (c) 2016 Smith Dhumbumroong

Licensed under the MIT License.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 trivial-openstack

Author

Smith Dhumbumroong <zodmaner@gmail.com>

License

MIT

Description

A simple Common Lisp OpenStack REST client.

Dependencies
Source

trivial-openstack.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 trivial-openstack.asd

Location

trivial-openstack.asd

Systems

trivial-openstack (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 trivial-openstack/package.lisp

Parent

trivial-openstack (system)

Location

package.lisp

Packages

trivial-openstack


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 trivial-openstack/trivial-openstack.lisp

Dependency

package.lisp (file)

Parent

trivial-openstack (system)

Location

trivial-openstack.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 trivial-openstack/identity-api.lisp

Dependency

trivial-openstack.lisp (file)

Parent

trivial-openstack (system)

Location

identity-api.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 trivial-openstack/image-api.lisp

Dependency

identity-api.lisp (file)

Parent

trivial-openstack (system)

Location

image-api.lisp

Exported Definitions

list-images (function)


Previous: , Up: Lisp files   [Contents][Index]

3.1.6 trivial-openstack/compute-api.lisp

Dependency

image-api.lisp (file)

Parent

trivial-openstack (system)

Location

compute-api.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 trivial-openstack

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *openstack-keystone*

The default global OpenStack Keystone object.

Package

trivial-openstack

Source

identity-api.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: def-openstack-api NAME LAMBDA-LIST (STREAM HTTP-METHOD URI-LIST &optional JSON OS-KEYSTONE) &body BODY

Defines a new OpenStack REST API binding.

Package

trivial-openstack

Source

trivial-openstack.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: add-security-rule-accept-all-icmp ()

Adds a security rule that accepts all incoming ICMP connection to the default security group.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: add-security-rule-accept-all-tcp ()

Adds a security rule that accepts all incoming TCP connection to the default security group.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: add-security-rule-accept-all-udp ()

Adds a security rule that accepts all incoming UDP connection to the default security group.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: associate-floating-ip SERVER-ID FLOATING-IP

Associates a floating IP with an active server.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: authenticate KEYSTONE-HOSTNAME USERNAME PASSWORD &optional TENANT-NAME

Authenticates a user, and initializes the default global Keystone special variables.

Package

trivial-openstack

Source

identity-api.lisp (file)

Function: create-default-security-group-rule RULE

Creates a new security rule in the default security group.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: create-floating-ip &key POOL

Creates/allocates a new floating IP.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: create-server SERVER-NAME IMAGE-ID FLAVOR-ID

Creates a new server.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: delete-server SERVER-ID

Deletes a server.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: get-public-url SERVICE &key ENDPOINTS-MAP

Retrieves a public URL of an OpenStack service endpoint either from the default alist map of currently active endpoints or a user-defined one.

Package

trivial-openstack

Source

identity-api.lisp (file)

Function: get-value ALIST &rest KEYS

Retrieves the value of a given key in an alist.

If multiple keys are supplied, then get-value will recursively descend into the nested alist and retrieve the value of the last (or the rightmost) key.

Note that supplying multiple keys only makes sense when the alist has other alists nested inside.

Package

trivial-openstack

Source

trivial-openstack.lisp (file)

Function: list-default-security-group-rules ()

Lists all the currently active security rules in the default security group.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: list-flavor-details FLAVOR-ID

List a flavor details.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: list-flavors ()

Lists all of the currently available flavors.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: list-floating-ips ()

Lists all of the currently allocated floating IPs.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: list-images ()

Retrieves the list of currently available images.

Package

trivial-openstack

Source

image-api.lisp (file)

Function: list-servers ()

Lists all of the currently active servers.

Package

trivial-openstack

Source

compute-api.lisp (file)

Function: list-servers-details ()

Lists all of the currently active servers in details.

Package

trivial-openstack

Source

compute-api.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Generic functions

Generic Function: service-catalog OBJECT
Generic Function: (setf service-catalog) NEW-VALUE OBJECT
Package

trivial-openstack

Methods
Method: service-catalog (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated reader method

Source

identity-api.lisp (file)

Method: (setf service-catalog) NEW-VALUE (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated writer method

Source

identity-api.lisp (file)

Generic Function: token OBJECT
Generic Function: (setf token) NEW-VALUE OBJECT
Package

trivial-openstack

Methods
Method: token (OS-KEYSTONE openstack-keystone) before

Before reading a value of the token’s slot, check if it has already expired. If it does, then uses the credential payload to re-authenticate and reacquire the token.

Source

identity-api.lisp (file)

Method: token (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated reader method

Source

identity-api.lisp (file)

Method: (setf token) NEW-VALUE (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated writer method

Source

identity-api.lisp (file)

Generic Function: token-expiration-time OBJECT
Generic Function: (setf token-expiration-time) NEW-VALUE OBJECT
Package

trivial-openstack

Methods
Method: token-expiration-time (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated reader method

Source

identity-api.lisp (file)

Method: (setf token-expiration-time) NEW-VALUE (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated writer method

Source

identity-api.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: with-keystone-response STREAM (OS-C) &body BODY

Authenticates a user by sending a credential payload to the Keystone identity service endpoint and binds a stream of the response that is returned to a specified stream symbol.

Package

trivial-openstack

Source

identity-api.lisp (file)

Macro: with-openstack-response RESPONSE-STREAM (URI HTTP-METHOD &optional X-AUTH-TOKEN CONTENT) &body BODY

Sends an API request to an OpenStack endpoint at URI and binds a stream of the response body that is returned by an OpenStack service to a user specified response stream symbol.

If the returned stream has zero length, then NIL will be bound to the stream symbol. If an error status code is returned, then the function will throw an error.

The x-auth-token optional argument can be used to send the authentication token to the endpoint, while the content optional argument can be used to send additional content (usually a JSON) along with the request.

Package

trivial-openstack

Source

trivial-openstack.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: join-strings &rest STRINGS

Joins strings.

Package

trivial-openstack

Source

trivial-openstack.lisp (file)

Function: make-openstack-credential HOSTNAME USERNAME PASSWORD &optional TENANT-NAME

Makes and returns a new instant of OpenStack credential class.

Package

trivial-openstack

Source

identity-api.lisp (file)

Function: make-openstack-keystone KEYSTONE-HOSTNAME USERNAME PASSWORD &optional TENANT-NAME

Creates and returns a new instant of the OpenStack Keystone object.

Package

trivial-openstack

Source

identity-api.lisp (file)

Function: parse-endpoints SERVICE-CATALOG-JSO

Parses a JSON containing currently active service endpoints into an alist map.

Package

trivial-openstack

Source

identity-api.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: credential OBJECT
Package

trivial-openstack

Methods
Method: credential (OPENSTACK-KEYSTONE openstack-keystone)

automatically generated reader method

Source

identity-api.lisp (file)

Generic Function: keystone-hostname OBJECT
Package

trivial-openstack

Methods
Method: keystone-hostname (OPENSTACK-CREDENTIAL openstack-credential)

automatically generated reader method

Source

identity-api.lisp (file)

Generic Function: password OBJECT
Package

trivial-openstack

Methods
Method: password (OPENSTACK-CREDENTIAL openstack-credential)

automatically generated reader method

Source

identity-api.lisp (file)

Generic Function: tenant-name OBJECT
Generic Function: (setf tenant-name) NEW-VALUE OBJECT
Package

trivial-openstack

Methods
Method: tenant-name (OPENSTACK-CREDENTIAL openstack-credential)

automatically generated reader method

Source

identity-api.lisp (file)

Method: (setf tenant-name) NEW-VALUE (OPENSTACK-CREDENTIAL openstack-credential)

automatically generated writer method

Source

identity-api.lisp (file)

Generic Function: username OBJECT
Package

trivial-openstack

Methods
Method: username (OPENSTACK-CREDENTIAL openstack-credential)

automatically generated reader method

Source

identity-api.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Classes

Class: openstack-credential ()

An OpenStack credential payload, with all the
necessary information to authenticate a user.

Requires a hostname of the Keystone identity service, a username, and a password. The tenant-name is an optional argument that will default to username if not provided.

Package

trivial-openstack

Source

identity-api.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: keystone-hostname
Initargs

:keystone-hostname

Readers

keystone-hostname (generic function)

Slot: username
Initargs

:username

Readers

username (generic function)

Slot: password
Initargs

:password

Readers

password (generic function)

Slot: tenant-name
Initargs

:tenant-name

Readers

tenant-name (generic function)

Writers

(setf tenant-name) (generic function)

Class: openstack-keystone ()

An OpenStack Keystone object containing an
authentication token, along with all the necessary information to reacquire the token once it expires, and an alist map of service catalog endpoints.

Only requires an instant of user credential payload to instantiate, other slots will be initialized when we instantiate the object.

Package

trivial-openstack

Source

identity-api.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: credential
Initargs

:credential

Readers

credential (generic function)

Slot: token
Readers

token (generic function)

Writers

(setf token) (generic function)

Slot: token-expiration-time
Readers

token-expiration-time (generic function)

Writers

(setf token-expiration-time) (generic function)

Slot: service-catalog
Readers

service-catalog (generic function)

Writers

(setf service-catalog) (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, trivial-openstack.asd: The trivial-openstack<dot>asd file
File, Lisp, trivial-openstack/compute-api.lisp: The trivial-openstack/compute-api<dot>lisp file
File, Lisp, trivial-openstack/identity-api.lisp: The trivial-openstack/identity-api<dot>lisp file
File, Lisp, trivial-openstack/image-api.lisp: The trivial-openstack/image-api<dot>lisp file
File, Lisp, trivial-openstack/package.lisp: The trivial-openstack/package<dot>lisp file
File, Lisp, trivial-openstack/trivial-openstack.lisp: The trivial-openstack/trivial-openstack<dot>lisp file

L
Lisp File, trivial-openstack.asd: The trivial-openstack<dot>asd file
Lisp File, trivial-openstack/compute-api.lisp: The trivial-openstack/compute-api<dot>lisp file
Lisp File, trivial-openstack/identity-api.lisp: The trivial-openstack/identity-api<dot>lisp file
Lisp File, trivial-openstack/image-api.lisp: The trivial-openstack/image-api<dot>lisp file
Lisp File, trivial-openstack/package.lisp: The trivial-openstack/package<dot>lisp file
Lisp File, trivial-openstack/trivial-openstack.lisp: The trivial-openstack/trivial-openstack<dot>lisp file

T
trivial-openstack.asd: The trivial-openstack<dot>asd file
trivial-openstack/compute-api.lisp: The trivial-openstack/compute-api<dot>lisp file
trivial-openstack/identity-api.lisp: The trivial-openstack/identity-api<dot>lisp file
trivial-openstack/image-api.lisp: The trivial-openstack/image-api<dot>lisp file
trivial-openstack/package.lisp: The trivial-openstack/package<dot>lisp file
trivial-openstack/trivial-openstack.lisp: The trivial-openstack/trivial-openstack<dot>lisp file

Jump to:   F   L   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   J   K   L   M   P   S   T   U   W  
Index Entry  Section

(
(setf service-catalog): Exported generic functions
(setf service-catalog): Exported generic functions
(setf tenant-name): Internal generic functions
(setf tenant-name): Internal generic functions
(setf token): Exported generic functions
(setf token): Exported generic functions
(setf token-expiration-time): Exported generic functions
(setf token-expiration-time): Exported generic functions

A
add-security-rule-accept-all-icmp: Exported functions
add-security-rule-accept-all-tcp: Exported functions
add-security-rule-accept-all-udp: Exported functions
associate-floating-ip: Exported functions
authenticate: Exported functions

C
create-default-security-group-rule: Exported functions
create-floating-ip: Exported functions
create-server: Exported functions
credential: Internal generic functions
credential: Internal generic functions

D
def-openstack-api: Exported macros
delete-server: Exported functions

F
Function, add-security-rule-accept-all-icmp: Exported functions
Function, add-security-rule-accept-all-tcp: Exported functions
Function, add-security-rule-accept-all-udp: Exported functions
Function, associate-floating-ip: Exported functions
Function, authenticate: Exported functions
Function, create-default-security-group-rule: Exported functions
Function, create-floating-ip: Exported functions
Function, create-server: Exported functions
Function, delete-server: Exported functions
Function, get-public-url: Exported functions
Function, get-value: Exported functions
Function, join-strings: Internal functions
Function, list-default-security-group-rules: Exported functions
Function, list-flavor-details: Exported functions
Function, list-flavors: Exported functions
Function, list-floating-ips: Exported functions
Function, list-images: Exported functions
Function, list-servers: Exported functions
Function, list-servers-details: Exported functions
Function, make-openstack-credential: Internal functions
Function, make-openstack-keystone: Internal functions
Function, parse-endpoints: Internal functions

G
Generic Function, (setf service-catalog): Exported generic functions
Generic Function, (setf tenant-name): Internal generic functions
Generic Function, (setf token): Exported generic functions
Generic Function, (setf token-expiration-time): Exported generic functions
Generic Function, credential: Internal generic functions
Generic Function, keystone-hostname: Internal generic functions
Generic Function, password: Internal generic functions
Generic Function, service-catalog: Exported generic functions
Generic Function, tenant-name: Internal generic functions
Generic Function, token: Exported generic functions
Generic Function, token-expiration-time: Exported generic functions
Generic Function, username: Internal generic functions
get-public-url: Exported functions
get-value: Exported functions

J
join-strings: Internal functions

K
keystone-hostname: Internal generic functions
keystone-hostname: Internal generic functions

L
list-default-security-group-rules: Exported functions
list-flavor-details: Exported functions
list-flavors: Exported functions
list-floating-ips: Exported functions
list-images: Exported functions
list-servers: Exported functions
list-servers-details: Exported functions

M
Macro, def-openstack-api: Exported macros
Macro, with-keystone-response: Internal macros
Macro, with-openstack-response: Internal macros
make-openstack-credential: Internal functions
make-openstack-keystone: Internal functions
Method, (setf service-catalog): Exported generic functions
Method, (setf tenant-name): Internal generic functions
Method, (setf token): Exported generic functions
Method, (setf token-expiration-time): Exported generic functions
Method, credential: Internal generic functions
Method, keystone-hostname: Internal generic functions
Method, password: Internal generic functions
Method, service-catalog: Exported generic functions
Method, tenant-name: Internal generic functions
Method, token: Exported generic functions
Method, token: Exported generic functions
Method, token-expiration-time: Exported generic functions
Method, username: Internal generic functions

P
parse-endpoints: Internal functions
password: Internal generic functions
password: Internal generic functions

S
service-catalog: Exported generic functions
service-catalog: Exported generic functions

T
tenant-name: Internal generic functions
tenant-name: Internal generic functions
token: Exported generic functions
token: Exported generic functions
token: Exported generic functions
token-expiration-time: Exported generic functions
token-expiration-time: Exported generic functions

U
username: Internal generic functions
username: Internal generic functions

W
with-keystone-response: Internal macros
with-openstack-response: Internal macros

Jump to:   (  
A   C   D   F   G   J   K   L   M   P   S   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
C   K   P   S   T   U  
Index Entry  Section

*
*openstack-keystone*: Exported special variables

C
credential: Internal classes

K
keystone-hostname: Internal classes

P
password: Internal classes

S
service-catalog: Internal classes
Slot, credential: Internal classes
Slot, keystone-hostname: Internal classes
Slot, password: Internal classes
Slot, service-catalog: Internal classes
Slot, tenant-name: Internal classes
Slot, token: Internal classes
Slot, token-expiration-time: Internal classes
Slot, username: Internal classes
Special Variable, *openstack-keystone*: Exported special variables

T
tenant-name: Internal classes
token: Internal classes
token-expiration-time: Internal classes

U
username: Internal classes

Jump to:   *  
C   K   P   S   T   U  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   O   P   S   T  
Index Entry  Section

C
Class, openstack-credential: Internal classes
Class, openstack-keystone: Internal classes

O
openstack-credential: Internal classes
openstack-keystone: Internal classes

P
Package, trivial-openstack: The trivial-openstack package

S
System, trivial-openstack: The trivial-openstack system

T
trivial-openstack: The trivial-openstack system
trivial-openstack: The trivial-openstack package

Jump to:   C   O   P   S   T