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
Léo-Paul Géneau
slapos.core
Commits
855367e4
Commit
855367e4
authored
Oct 12, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify request interface.
parent
95c7d2f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
46 deletions
+40
-46
slapos/slap/interface/slap.py
slapos/slap/interface/slap.py
+40
-46
No files found.
slapos/slap/interface/slap.py
View file @
855367e4
...
...
@@ -46,6 +46,44 @@ class IUnauthorized(IException):
permissions on the slap server.
"""
class
IRequester
(
Interface
):
"""
Classes which implement IRequester can request software instance to the
slapgrid server.
"""
def
request
(
software_release
,
software_type
,
partition_reference
,
shared
=
False
,
partition_parameter_kw
=
None
,
filter_kw
=
None
):
"""
Request software release instanciation to slapgrid server.
Returns a new computer partition document, where this sofware release will
be installed.
software_release -- uri of the software release
which has to be instanciated
software_type -- type of component provided by software_release
partition_reference -- local reference of the instance used by the recipe
to identify the instances.
shared -- boolean to use a shared service
partition_parameter_kw -- dictionary of parameter used to fill the
parameter dict of newly created partition.
filter_kw -- dictionary of filtering parameter to select the requested
computer partition.
computer_guid - computer of the requested partition
partition_type - virtio, slave, full, limited
port - port provided by the requested partition
Example:
request('http://example.com/toto/titi', 'typeA', 'mysql_1')
"""
class
IBuildoutController
(
Interface
):
"""
Classes which implement IBuildoutController can report the buildout run
...
...
@@ -83,7 +121,7 @@ class ISoftwareRelease(IBuildoutController):
Returns a string representing the uri of the software release.
"""
class
IComputerPartition
(
IBuildoutController
):
class
IComputerPartition
(
IBuildoutController
,
IRequester
):
"""
Computer Partition interface specification
...
...
@@ -92,38 +130,6 @@ class IComputerPartition(IBuildoutController):
creation.
"""
def
request
(
software_release
,
software_type
,
partition_reference
,
shared
=
False
,
partition_parameter_kw
=
None
,
filter_kw
=
None
):
"""
Request software release instanciation to slapgrid server.
Returns a new computer partition document, where this sofware release will
be installed.
software_release -- uri of the software release
which has to be instanciated
software_type -- type of component provided by software_release
partition_reference -- local reference of the instance used by the recipe
to identify the instances.
shared -- boolean to use a shared service
partition_parameter_kw -- dictionary of parameter used to fill the
parameter dict of newly created partition.
filter_kw -- dictionary of filtering parameter to select the requested
computer partition.
computer_guid - computer of the requested partition
partition_type - virtio, slave, full, limited
port - port provided by the requested partition
Example:
request('http://example.com/toto/titi', 'mysql_1')
"""
def
stopped
():
"""
Notify (to the slapgrid server) that the software instance is
...
...
@@ -232,7 +238,7 @@ class IComputer(Interface):
log -- a text explaining why the method was called
"""
class
IOpenOrder
(
I
nterface
):
class
IOpenOrder
(
I
Requester
):
"""
Open Order interface specification
...
...
@@ -240,18 +246,6 @@ class IOpenOrder(Interface):
is requested by a given client.
"""
def
request
(
software_release
):
"""
Request the instanciation of a given software release to the slapgrid
server.
Returns a new computer partition document, where this software release will
be installed.
software_release -- uri of the software release
which has to be instanciated
"""
class
ISupply
(
Interface
):
"""
Supply interface specification
...
...
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