End of comments

This commit is contained in:
EoleDev 2016-04-27 14:22:59 +02:00
parent 5263cf00a2
commit 1d42345e07
13 changed files with 491 additions and 264 deletions

View file

@ -7,7 +7,6 @@
*
* @author KABIR Othmane
*
* @todo Complete the functions with errors detection and finish the descriptions
*/
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
@ -17,11 +16,10 @@ use OpenCloud\Common\Error\UserInputError;
/**
* Network Class of the back-end application
*
* ADD CLASS DESCRIPTION
* Management of Networks
*
*/
class network{
class network implements Core{
/** @var App $app protected, contains the main app object */
protected $app;
/** @var OpenStack\Network $libClass protected, contains the library Network object */
@ -29,15 +27,12 @@ class network{
/**
* Image constructor
* Network constructor
*
* @param App $app the main app object
*
* @return Network
* @return network Object
*/
public function __construct($app){
$this->app = $app;
$this->libClass = $app->getLibClass("Network");
@ -49,7 +44,7 @@ class network{
*
* @param String $action name of another function of this class
*
* @return NULL
* @return void
*/
public function action($action){
@ -65,7 +60,7 @@ class network{
* @param String shared Specifies whether the network resource can be accessed by any tenant
* @param String tenantId Owner of network. Only admin users can specify a tenant ID other than their own
*
* @return NULL
* @return void
*/
private function create_network()
{
@ -134,9 +129,7 @@ class network{
* @param BOOLEAN enableDhcp Specifies whether DHCP is enabled for this subnet
* @param String allocationPools Subranges of the CIDR available for dynamic allocation to ports
*
*
*
* @return NULL
* @return void
*/
private function create_subnet()
@ -225,7 +218,7 @@ class network{
/**
* List the ID of the NETWORKS
*
* @return List of Networks ID
* @return void
*/
private function list_network_ids()
@ -276,18 +269,12 @@ class network{
try
{
$ln = $this->libClass->listNetworks();
$list_names = array();
foreach($ln as $n)
{
$list_names[] = $n->name;
}
}
catch(BadResponseError $e)
{
@ -308,10 +295,11 @@ class network{
$this->app->setOutput("ListNetworkNames", $list_names);
}
/**
* List the CIDR of the SUBNETS
*
* @return List of SUBNETS CIDR
* @return void
*/
private function list_cidr()
{
@ -344,10 +332,13 @@ class network{
$this->app->getErrorInstance->NotImplementedHandler($e);
}
}
/**
* retrieve a specific network
*
* @param networkId ID of network which we want to get
* @return Network
*
* @return void
*/
private function getNetwork()
{
@ -383,8 +374,10 @@ class network{
/**
* internal function
*
* @param String netId ID of network which we want to get
* @return Network
*
* @return OpenStack\Network
*/
private function getNetworkP($netId)
{
@ -420,8 +413,10 @@ class network{
/**
* retrieve a specific subnet
*
* @param subnetId ID of subnet which we want to get
* @return subnet
*
* @return void
*/
private function getSubnet()
{
@ -455,8 +450,10 @@ class network{
}
/**
* internal function
*
* @param String subnetId ID of subnet which we want to get
* @return subnet
*
* @return OpenStack\Subnet
*/
private function getSubnetP($subnetId)
{
@ -498,7 +495,7 @@ class network{
* @param String tenantId Owner of network. Only admin users can specify a tenant ID other than their own
*
*
* @return NULL
* @return void
**/
private function updateNetwork()
@ -561,7 +558,7 @@ class network{
* @param String allocationPools Subranges of the CIDR available for dynamic allocation to ports
*
*
* @return NULL
* @return void
**/
private function updateSubnet()
@ -616,8 +613,7 @@ class network{
*
* @param String networkId ID if network which we want to delete
*
*
* @return NULL
* @return void
**/
private function deleteNetwork()
{
@ -650,8 +646,7 @@ class network{
*
* @param String subnetId ID if network which we want to delete
*
*
* @return NULL
* @return void
**/
private function deleteSubnet()
{
@ -692,7 +687,7 @@ class network{
* @param String securityGroups Specifies the IDs of any security groups associated with this port
* @param String tenantId Owner of the port. Only admin users can specify a tenant ID other than their own.
*
* @return NULL
* @return void
*/
private function createPort()
@ -769,7 +764,7 @@ class network{
/**
* List the of ports
*
* @return List of ports
* @return void
*/
private function listPorts()
@ -798,8 +793,10 @@ class network{
/**
* retrieve a specific port given
*
* @param portId ID of port which we want to get
* @return port
*
* @return void
*/
private function getPort()
@ -831,8 +828,11 @@ class network{
/**
* internal function
*
* retrieve a specific port given
*
* @param portId ID of port which we want to get
*
* @return port
*/
@ -876,7 +876,7 @@ class network{
* @param String securityGroups Specifies the IDs of any security groups associated with this port
* @param String tenantId Owner of the port. Only admin users can specify a tenant ID other than their own.
*
* @return NULL
* @return void
*/
private function updatePort()
{
@ -953,7 +953,8 @@ class network{
* Delete a port given
*
* @param String portId id of port which we wante to delete
* @return NULL
*
* @return void
*/
private function deletePort()
{
@ -988,7 +989,7 @@ class network{
* @param String name A human-readable name for the security group. This name might not be unique
* @param String description Description of the security group
*
* @return NULL
* @return void
*/
private function createSecurityGroup()
@ -1032,15 +1033,15 @@ class network{
* Create a new security groupe
*
* @param String securityGroupId The security group ID to associate with this security group rule.
* @param String direction The direction in which the security group rule is applied. For a compute instance, an ingress security group * rule is applied to incoming (ingress) traffic for that instance. An egress rule is applied to traffic leaving the instance.
* @param String direction The direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance. An egress rule is applied to traffic leaving the instance.
* @param String ethertype Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules.
* @param String portRangeMin The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the portRangeMax attribute. If the protocol is ICMP, this value must be an ICMP type
*@param String portRangeMax The maximum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the portRangeMax attribute. If the protocol is ICMP, this value must be an ICMP type.
*@param String protocol The protocol that is matched by the security group rule
*@param String remoteGroupId The remote group ID to be associated with this security group rule. You can specify either remoteGroupId or remoteGroupPrefix
*@param String remoteIpPrefix The remote IP prefix to be associated with this security group rule. You can specify either remoteGroupId or remoteGroupPrefix
* @param String portRangeMin The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the portRangeMax attribute. If the protocol is ICMP, this value must be an ICMP type
* @param String portRangeMax The maximum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the portRangeMax attribute. If the protocol is ICMP, this value must be an ICMP type.
* @param String protocol The protocol that is matched by the security group rule
* @param String remoteGroupId The remote group ID to be associated with this security group rule. You can specify either remoteGroupId or remoteGroupPrefix
* @param String remoteIpPrefix The remote IP prefix to be associated with this security group rule. You can specify either remoteGroupId or remoteGroupPrefix
*
* @return NULL
* @return void
*/
private function createSecurityGroupRule()
{
@ -1112,7 +1113,7 @@ class network{
/**
* List of Security Groupes
*
* @return List of Security Groupes
* @return void
*/
private function listSecurityGroupe()
@ -1143,7 +1144,7 @@ class network{
/**
* List of Security Groupe Rules
*
* @return List of Security Groupe Rules
* @return void
*/
private function listSecurityGroupeRule()
@ -1174,8 +1175,10 @@ class network{
/**
* retrieve a specific Security Groupe given
*
* @param securityGroupeId ID of security Groupe which we want to get
* @return securityGroupe
*
* @return void
*/
private function getSecurityGroupe()
@ -1207,9 +1210,12 @@ class network{
/**
* internal function
*
* retrieve a specific Security Groupe given
*
* @param securityGroupeId ID of security Groupe which we want to get
* @return securityGroupe
*
* @return securityGroup
*/
private function getSecurityGroupeP($securityGroupeId)
{
@ -1238,8 +1244,10 @@ class network{
}
/**
* Delete a specific Security Groupe given
*
* @param securityGroupeId ID of security Groupe which we want to get
* @return NULL
*
* @return void
*/
private function deleteSecurityGroupe()
{