Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos.core
Commits
f416b4b5
Commit
f416b4b5
authored
Oct 03, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
valid RST
parent
965fb37a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
19 deletions
+33
-19
slapos/README.console.txt
slapos/README.console.txt
+33
-19
No files found.
slapos/README.console.txt
View file @
f416b4b5
console
console
=======
-------
The slapconsole tool allows to interact with a SlapOS Master throught the SLAP
The slapconsole tool allows to interact with a SlapOS Master throught the SLAP
library.
library.
For more information about SlapOS or slapconsole usages, please go to
For more information about SlapOS or slapconsole usages, please go to
http://community.slapos.org.
http://community.slapos.org.
The slapconsole tool is only a bare Python console with several global variables
The slapconsole tool is only a bare Python console with several global variables
...
@@ -12,14 +12,16 @@ defined and initialized.
...
@@ -12,14 +12,16 @@ defined and initialized.
Initialization and configuration file
Initialization and configuration file
=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Slapconsole allows to automatically connect to a Master using URL and SSL
Slapconsole allows to automatically connect to a Master using URL and SSL
certificate from given slapos.cfg.
certificate from given slapos.cfg.
Certificate has to be *USER* certificate, manually obtained from SlapOS master
Certificate has to be *USER* certificate, manually obtained from SlapOS master
web interface.
web interface.
Slapconsole tools reads the given slapos.cfg configuration file and use the
Slapconsole tools reads the given slapos.cfg configuration file and use the
following informations :
following informations :
* Master URL is read from [slapos] in the "master_url" parameter.
* Master URL is read from [slapos] in the "master_url" parameter.
* SSL Certificate is read from [slapconsole] in the "cert_file" parameter.
* SSL Certificate is read from [slapconsole] in the "cert_file" parameter.
* SSL Key is read from [slapconsole] in the "key_file" parameter.
* SSL Key is read from [slapconsole] in the "key_file" parameter.
...
@@ -28,7 +30,8 @@ See slapos.cfg.example for examples.
...
@@ -28,7 +30,8 @@ See slapos.cfg.example for examples.
Global functions
Global functions
=====
~~~~~~~~~~~~~~~~
* request() is a shorthand for slap.registerOpenOrder().request() allowing
* request() is a shorthand for slap.registerOpenOrder().request() allowing
to request instances.
to request instances.
* supply() is a shorthand for slap.registerSupply().supply() allowing to
* supply() is a shorthand for slap.registerSupply().supply() allowing to
...
@@ -39,33 +42,44 @@ documentation.
...
@@ -39,33 +42,44 @@ documentation.
Global aliases
Global aliases
=====
~~~~~~~~~~~~~~
"software_list" is a list containing all the Software Release URLs defined in
"software_list" is a list containing all the Software Release URLs defined in
client slapos.cfg configuration file.
client slapos.cfg configuration file.
Also, each Software Release defined in this configuration file is translated
Also, each Software Release defined in this configuration file is translated
into a global variable to ease the request of those Sofware Releases.
into a global variable to ease the request of those Sofware Releases.
This allows to request instances in a few words, i.e
This allows to request instances in a few words, i.e::
request("http://www.url.com/path/to/kvm/software.cfg", "mykvm")
can be simplified into :
request("http://www.url.com/path/to/kvm/software.cfg", "mykvm")
request(kvm, "mykvm")
If the slapos.cfg file contains :
can be simplified into ::
alias =
kvm http://www.url.com/path/to/kvm/software.cfg
request(kvm, "mykvm")
If the slapos.cfg file contains ::
alias =
kvm http://www.url.com/path/to/kvm/software.cfg
Global objects
Global objects
=====
~~~~~~~~~~~~~~
"slap" is an instance of the SLAP library. It is only used for advanced usages.
"slap" is an instance of the SLAP library. It is only used for advanced usages.
"slap" instance is obtained by doing :
"slap" instance is obtained by doing ::
slap = slapos.slap.slap()
slap.initializeConnection(config.master_url,
slap = slapos.slap.slap()
slap.initializeConnection(config.master_url,
key_file=config.key_file, cert_file=config.cert_file)
key_file=config.key_file, cert_file=config.cert_file)
Examples
Examples
=====
~~~~~~~~
::
>>> # Request instance
>>> # Request instance
>>> request(kvm, "myuniquekvm")
>>> request(kvm, "myuniquekvm")
...
@@ -75,7 +89,7 @@ Examples
...
@@ -75,7 +89,7 @@ Examples
>>> # Request instance, specifying parameters (here nbd_ip and nbd_port)
>>> # Request instance, specifying parameters (here nbd_ip and nbd_port)
>>> request(kvm, "mythirduniquekvm",
>>> request(kvm, "mythirduniquekvm",
partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc",
partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc",
"nbd_port":"1024"})
"nbd_port":"1024"})
>>> # Request software installation on owned computer
>>> # Request software installation on owned computer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment