The trivial-openstack Reference Manual

This is the trivial-openstack Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:56:58 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 trivial-openstack

A simple Common Lisp OpenStack REST client.

Author

Smith Dhumbumroong <>

License

MIT

Dependencies
  • drakma (system).
  • st-json (system).
  • local-time (system).
  • alexandria (system).
Source

trivial-openstack.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 trivial-openstack/trivial-openstack.asd

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

ASDF Systems

trivial-openstack.


3.1.2 trivial-openstack/package.lisp

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

Packages

trivial-openstack.


3.1.3 trivial-openstack/trivial-openstack.lisp

Dependency

package.lisp (file).

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

Public Interface
Internals

3.1.4 trivial-openstack/identity-api.lisp

Dependency

trivial-openstack.lisp (file).

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

Public Interface
Internals

3.1.5 trivial-openstack/image-api.lisp

Dependency

identity-api.lisp (file).

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

Public Interface

list-images (function).


3.1.6 trivial-openstack/compute-api.lisp

Dependency

image-api.lisp (file).

Source

trivial-openstack.asd.

Parent Component

trivial-openstack (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 trivial-openstack

Source

package.lisp.

Use List
  • alexandria.
  • common-lisp.
Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *openstack-keystone*

The default global OpenStack Keystone object.

Package

trivial-openstack.

Source

identity-api.lisp.


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.


5.1.3 Ordinary 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.

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.

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.

Function: associate-floating-ip (server-id floating-ip)

Associates a floating IP with an active server.

Package

trivial-openstack.

Source

compute-api.lisp.

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.

Function: create-default-security-group-rule (rule)

Creates a new security rule in the default security group.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: create-floating-ip (&key pool)

Creates/allocates a new floating IP.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: create-server (server-name image-id flavor-id)

Creates a new server.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: delete-server (server-id)

Deletes a server.

Package

trivial-openstack.

Source

compute-api.lisp.

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.

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.

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.

Function: list-flavor-details (flavor-id)

List a flavor details.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: list-flavors ()

Lists all of the currently available flavors.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: list-floating-ips ()

Lists all of the currently allocated floating IPs.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: list-images ()

Retrieves the list of currently available images.

Package

trivial-openstack.

Source

image-api.lisp.

Function: list-servers ()

Lists all of the currently active servers.

Package

trivial-openstack.

Source

compute-api.lisp.

Function: list-servers-details ()

Lists all of the currently active servers in details.

Package

trivial-openstack.

Source

compute-api.lisp.


5.1.4 Generic functions

Generic Reader: service-catalog (object)
Package

trivial-openstack.

Methods
Reader Method: service-catalog ((openstack-keystone openstack-keystone))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

service-catalog.

Generic Writer: (setf service-catalog) (object)
Package

trivial-openstack.

Methods
Writer Method: (setf service-catalog) ((openstack-keystone openstack-keystone))

automatically generated writer method

Source

identity-api.lisp.

Target Slot

service-catalog.

Generic Function: token (object)
Package

trivial-openstack.

Methods
Reader Method: token :before ((os-keystone openstack-keystone))

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.

Target Slot

token.

Method: token ((openstack-keystone openstack-keystone))

automatically generated reader method

Source

identity-api.lisp.

Generic Writer: (setf token) (object)
Package

trivial-openstack.

Methods
Writer Method: (setf token) ((openstack-keystone openstack-keystone))

automatically generated writer method

Source

identity-api.lisp.

Target Slot

token.

Generic Reader: token-expiration-time (object)
Package

trivial-openstack.

Methods
Reader Method: token-expiration-time ((openstack-keystone openstack-keystone))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

token-expiration-time.

Generic Writer: (setf token-expiration-time) (object)
Package

trivial-openstack.

Methods
Writer Method: (setf token-expiration-time) ((openstack-keystone openstack-keystone))

automatically generated writer method

Source

identity-api.lisp.

Target Slot

token-expiration-time.


5.1.5 Standalone methods

Method: initialize-instance :after ((os-keystone openstack-keystone) &key)

Uses an instant of user credential payload to authenticate and retrieve a token, along with its expiration time, then stores them into their respective slots.

Also retrieves currently active service catalog endpoints, parses them into an alist map, and stores them into their slot.

Source

identity-api.lisp.


5.2 Internals


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.

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.


5.2.2 Ordinary functions

Function: join-strings (&rest strings)

Joins strings.

Package

trivial-openstack.

Source

trivial-openstack.lisp.

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.

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.

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.


5.2.3 Generic functions

Generic Reader: credential (object)
Package

trivial-openstack.

Methods
Reader Method: credential ((openstack-keystone openstack-keystone))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

credential.

Generic Reader: keystone-hostname (object)
Package

trivial-openstack.

Methods
Reader Method: keystone-hostname ((openstack-credential openstack-credential))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

keystone-hostname.

Generic Reader: password (object)
Package

trivial-openstack.

Methods
Reader Method: password ((openstack-credential openstack-credential))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

password.

Generic Reader: tenant-name (object)
Package

trivial-openstack.

Methods
Reader Method: tenant-name ((openstack-credential openstack-credential))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

tenant-name.

Generic Writer: (setf tenant-name) (object)
Package

trivial-openstack.

Methods
Writer Method: (setf tenant-name) ((openstack-credential openstack-credential))

automatically generated writer method

Source

identity-api.lisp.

Target Slot

tenant-name.

Generic Reader: username (object)
Package

trivial-openstack.

Methods
Reader Method: username ((openstack-credential openstack-credential))

automatically generated reader method

Source

identity-api.lisp.

Target Slot

username.


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.

Direct methods
Direct slots
Slot: keystone-hostname
Initargs

:keystone-hostname

Readers

keystone-hostname.

Writers

This slot is read-only.

Slot: username
Initargs

:username

Readers

username.

Writers

This slot is read-only.

Slot: password
Initargs

:password

Readers

password.

Writers

This slot is read-only.

Slot: tenant-name
Initargs

:tenant-name

Readers

tenant-name.

Writers

(setf tenant-name).

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.

Direct methods
Direct slots
Slot: credential
Initargs

:credential

Readers

credential.

Writers

This slot is read-only.

Slot: token
Readers

token.

Writers

(setf token).

Slot: token-expiration-time
Readers

token-expiration-time.

Writers

(setf token-expiration-time).

Slot: service-catalog
Readers

service-catalog.

Writers

(setf service-catalog).


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

(
(setf service-catalog): Public generic functions
(setf service-catalog): Public generic functions
(setf tenant-name): Private generic functions
(setf tenant-name): Private generic functions
(setf token): Public generic functions
(setf token): Public generic functions
(setf token-expiration-time): Public generic functions
(setf token-expiration-time): Public generic functions

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

C
create-default-security-group-rule: Public ordinary functions
create-floating-ip: Public ordinary functions
create-server: Public ordinary functions
credential: Private generic functions
credential: Private generic functions

D
def-openstack-api: Public macros
delete-server: Public ordinary functions

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

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

I
initialize-instance: Public standalone methods

J
join-strings: Private ordinary functions

K
keystone-hostname: Private generic functions
keystone-hostname: Private generic functions

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

M
Macro, def-openstack-api: Public macros
Macro, with-keystone-response: Private macros
Macro, with-openstack-response: Private macros
make-openstack-credential: Private ordinary functions
make-openstack-keystone: Private ordinary functions
Method, (setf service-catalog): Public generic functions
Method, (setf tenant-name): Private generic functions
Method, (setf token): Public generic functions
Method, (setf token-expiration-time): Public generic functions
Method, credential: Private generic functions
Method, initialize-instance: Public standalone methods
Method, keystone-hostname: Private generic functions
Method, password: Private generic functions
Method, service-catalog: Public generic functions
Method, tenant-name: Private generic functions
Method, token: Public generic functions
Method, token: Public generic functions
Method, token-expiration-time: Public generic functions
Method, username: Private generic functions

P
parse-endpoints: Private ordinary functions
password: Private generic functions
password: Private generic functions

S
service-catalog: Public generic functions
service-catalog: Public generic functions

T
tenant-name: Private generic functions
tenant-name: Private generic functions
token: Public generic functions
token: Public generic functions
token: Public generic functions
token-expiration-time: Public generic functions
token-expiration-time: Public generic functions

U
username: Private generic functions
username: Private generic functions

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