Commit 5822b566 authored by OLIVO Romain's avatar OLIVO Romain

start doc

parent b236d5b6
......@@ -15,9 +15,10 @@ class Distem:
Args:
name(str) The name of the virtual network (unique)
address(str) The address (CIDR format: 10.0.8.0/24) the virtual network will work with
options(dict) used to store vxlan_id and number of PNODES (should not be used directly)
name(str) The name of the virtual network (unique) address(str) The
address (CIDR format: 10.0.8.0/24) the virtual network will work
with options(dict) used to store vxlan_id and number of PNODES
(should not be used directly)
Returns:
{dict} The virtual network description
......@@ -85,12 +86,12 @@ class Distem:
desc(dict): Hash structured as described in
:desc:`resources description<>`
ssh_key(dict): SSH key pair to be copied on the virtual node (also
adding the public key to .ssh/authorized_keys). Note that every SSH
keys located on the physical node which hosts this virtual node are
also copied in .ssh/ directory of the node (copied key have a
specific filename prefix). The key are copied in .ssh/ directory of
SSH user (see {Distem::Daemon::Admin#SSH_USER} and
Distem::Node::Container::SSH_KEY_FILENAME)
adding the public key to .ssh/authorized_keys). Note that every SSH
keys located on the physical node which hosts this virtual node are
also copied in .ssh/ directory of the node (copied key have a
specific filename prefix). The key are copied in .ssh/ directory of
SSH user (see {Distem::Daemon::Admin#SSH_USER} and
Distem::Node::Container::SSH_KEY_FILENAME)
_Format_: dict.
......@@ -123,16 +124,16 @@ class Distem:
Start a virtual node.
A physical node (that have enought physical resources (CPU,...))
will be automatically allocated if there is none set as +host+ at the moment
The filesystem archive will be copied on the hosting physical node.
A filesystem image *must* have been set (see {#vnode_create}
or {#vfilesystem_create}/{#vfilesystem_update}).
will be automatically allocated if there is none set as +host+ at
the moment The filesystem archive will be copied on the hosting
physical node. A filesystem image *must* have been set (see
{#vnode_create} or {#vfilesystem_create}/{#vfilesystem_update}).
Args:
vnodename(str) The name of the virtual node
async(Boolean) Asynchronious mode, check virtual node status
to know when node is configured (see {#vnode_info})
async(Boolean) Asynchronious mode, check virtual node status to know
when node is configured (see {#vnode_info})
Returns:
{dict} The virtual node description
......@@ -149,17 +150,17 @@ class Distem:
def vnode_stop(self, vnodename):
"""
Stopping a virtual node, deleting it's data from the hosting physical node.
The +host+ association for this virtual node will be cancelled,
if you start the virtual node directcly after stopping it,
the hosting physical node will be chosen randomly
(to set it manually, see host field, {#vnode_update})
Stopping a virtual node, deleting it's data from the hosting physical
node. The +host+ association for this virtual node will be cancelled,
if you start the virtual node directcly after stopping it, the hosting
physical node will be chosen randomly (to set it manually, see host
field, {#vnode_update})
Args:
vnodename(str) The name of the virtual node
async(Boolean) Asynchronious mode, check virtual node status
to know when node is configured (see {#vnode_info})
to know when node is configured (see {#vnode_info})
Returns:
{dict} The virtual node description
......@@ -174,7 +175,8 @@ class Distem:
"""
Remove the virtual node
"Cascade" removing: remove all the vroutes in which this virtual node apears as gateway
"Cascade" removing: remove all the vroutes
in which this virtual node apears as gateway
Args:
......@@ -248,7 +250,8 @@ class Distem:
def vnodes_info(self):
"""
Retrieve informations about every virtual nodes currently set on the platform
Retrieve informations about every virtual
nodes currently set on the platform
Returns:
......@@ -264,18 +267,18 @@ class Distem:
Create new virtual nodes
Args:
names(Array) The names of the virtual nodes which should be unique
desc(dict) Hash structured as described in
:desc:`resources description<>`
ssh_key(dict) SSH key pair to be copied on the virtual node
(also adding the public key to .ssh/authorized_keys).
Note that every SSH keys located on the physical node
which hosts this virtual node are also copied in .ssh/ directory of the node
(copied key have a specific filename prefix).
The key are copied in .ssh/ directory of SSH user
(see {Distem::Daemon::Admin#SSH_USER} and Distem::Node::Container::SSH_KEY_FILENAME)
names(Array) The names of the virtual nodes which should be
unique desc(dict) Hash structured as described in
:desc:`resources description<>` ssh_key(dict) SSH key pair
to be copied on the virtual node (also adding the public key
to .ssh/authorized_keys). Note that every SSH keys located
on the physical node which hosts this virtual node are also
copied in .ssh/ directory of the node (copied key have a
specific filename prefix). The key are copied in .ssh/
directory of SSH user (see {Distem::Daemon::Admin#SSH_USER}
and Distem::Node::Container::SSH_KEY_FILENAME)
async(Boolean) Asynchronious mode, check virtual node status
to know when node is configured (see {#vnode_info})
to know when node is configured (see {#vnode_info})
Returns:
[Array] The virtual nodes description
......@@ -315,16 +318,16 @@ class Distem:
Start several virtual nodes
A physical node (that have enought physical resources (CPU,...))
will be automatically allocated if there is none set as +host+ at the moment
The filesystem archive will be copied on the hosting physical node.
A filesystem image *must* have been set
(see {#vnode_create} or {#vfilesystem_create}/{#vfilesystem_update}).
will be automatically allocated if there is none set as +host+ at
the moment The filesystem archive will be copied on the hosting
physical node. A filesystem image *must* have been set (see
{#vnode_create} or {#vfilesystem_create}/{#vfilesystem_update}).
Args:
names(Array) The names of the virtual nodes
async(Boolean) Asynchronious mode, check virtual nodes status
to know when node is configured (see {#vnode_info})
to know when node is configured (see {#vnode_info})
Returns:
{dict} The virtual nodes description
......@@ -475,7 +478,8 @@ class Distem:
def viface_info(self, vnodename, vifacename):
"""
Retrieve informations about a virtual network interface associated to a virtual node
Retrieve informations about a virtual
network interface associated to a virtual node
Args:
......@@ -534,19 +538,17 @@ class Distem:
"""
Update a virtual network interface
Disconnect (detach): the virtual network interface from
any virtual network it's connected on if +desc+ is empty
Disconnect (detach): the virtual network interface from
any virtual network it's connected on if +desc+ is empty
Args:
vnodename(str): The name of the virtual node
vifacename(str): The name of the virtual network interface
desc(dict): Hash structured as described in
desc(dict): Hash structured as described in
:desc:`resources description<>`
Returns:
{dict} The virtual network interface description
{dict} The virtual network interface description
see :desc:`resources description<>`
"""
......@@ -564,12 +566,13 @@ class Distem:
Args:
vnodename(str): The name of the virtual node
val(Float): The frequency defined as a value in MHz
or as a ratio (percentage of the physical core frequency).
unit(str): Tell if val is a frequency or a ratio (allowed values are mhz and ration)
vnodename(str): The name of the virtual node val(Float): The
frequency defined as a value in MHz or as a ratio
(percentage of the physical core frequency).
unit(str): Tell if val is a frequency or a ratio (allowed
values are mhz and ration)
corenb(Integer): The number of cores to allocate
(need to have enough free ones on the physical node)
(need to have enough free ones on the physical node)
Returns:
{dict} The virtual CPU description
......@@ -583,13 +586,15 @@ class Distem:
"""
Update a virtual CPU on the virtual node
@note This setting works on-the-fly (i.e. even if the virtual node is already running)
This setting works on-the-fly (i.e. even
if the virtual node is already running)
Args:
vnodename(str) The name of the virtual node
val(Float) The frequency defined as a value in MHz
or as a ratio (percentage of the physical core frequency).
unit(str) Tell if val is a frequency or a ratio (allowed values are mhz and ration)
unit(str) Tell if val is a frequency or
a ratio (allowed values are mhz and ration)
Returns:
{dict} The virtual CPU description
......@@ -631,16 +636,17 @@ class Distem:
def vinput_update(self, vnodename, vifacename, desc=None):
"""
Update the traffic description on the input of a specified virtual network interface
The vtraffic description is updated on-the-fly (even if the virtual node is running)
Reset the vtraffic description if +desc+ is empty
Update the traffic description on the input of a specified
virtual network interface The vtraffic description is updated
on-the-fly (even if the virtual node is running) Reset the
vtraffic description if +desc+ is empty
Args:
vnodename(str) The name of the virtual node
vifacename(str) The name of the virtual network interface
desc(dict) Hash structured as described in
:desc:`resources description<>`
:desc:`resources description<>`
Returns:
{dict} The virtual traffic description
......@@ -657,7 +663,8 @@ class Distem:
def vinput_info(self, vnodename, vifacename):
"""
Retrive the traffic description on the input of a specified virtual network interface
Retrive the traffic description on
the input of a specified virtual network interface
Args:
......@@ -674,9 +681,10 @@ class Distem:
def voutput_update(self, vnodename, vifacename, desc=None):
"""
Update the traffic description on the output of a specified virtual network interface
The vtraffic description is updated on-the-fly (even if the virtual node is running)
Reset the vtraffic description if +desc+ is empty
Update the traffic description on the output of a specified
virtual network interface The vtraffic description is updated
on-the-fly (even if the virtual node is running) Reset the
vtraffic description if +desc+ is empty
Args:
......@@ -700,7 +708,8 @@ class Distem:
def voutput_info(self, vnodename, vifacename):
"""
Retrive the traffic description on the output of a specified virtual network interface
Retrive the traffic description on
the output of a specified virtual network interface
Args:
......@@ -723,7 +732,8 @@ class Distem:
vnodename(str) The vnode's name to create
mem(str) The required amount of RAM
swap(str) The required amount of swap
hierarchy(str) The hierarchy where memory controller is mounted (default to v1)
hierarchy(str) The hierarchy where memory controller
is mounted (default to v1)
Returns:
{dict} The memory limitation
......@@ -789,7 +799,7 @@ class Distem:
if 200 <= response.status_code < 300:
try:
result = response.json()
except:
except ValueError:
result = response.text
return result
else:
......
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