Commit 855367e4 authored by Romain Courteaud's avatar Romain Courteaud

Unify request interface.

parent 95c7d2f0
......@@ -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(Interface):
class IOpenOrder(IRequester):
"""
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment