diff --git a/server/core/Network.php b/server/core/Network.php index 65de962..a4e0939 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -1,13 +1,42 @@ {$action.""}(); } - + /** + * Create a new network + * + * @param String name A human-readable name for the network. This name might not be unique + * @param String adminStateUp The administrative state of network. If false (down), the network does not forward packets + * @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 void + */ public function create_network() { $options = array(); + // check the name if it is null if (isset($this->app->getPostParam("name"))) { $options['name'] = $this->app->getPostParam("name"); } + // check the adminStateUp if it is null if (isset($this->app->getPostParam("adminStateUp"))) { $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); } + // check the shared if it is null if (isset($this->app->getPostParam("shared"))) { $options['shared'] = $this->app->getPostParam("shared"); } + // check the tenantId if it is null if (isset($this->app->getPostParam("tenantId"))) { $options['tenantId'] = $this->app->getPostParam("tenantId"); } try { - $network = $this->libClass->createNetworks($options); + $network = $this->libClass->createNetworks($options); } catch(BadResponseError $e) { @@ -68,6 +116,26 @@ class network{ } + /** + * Create a new subnet + * + * @param String networkId A Network this subnet is associated with + * @param String ipVersion IP version (4 or 6) + * @param String cidr CIDR representing the IP address range for this subnet Exmple X.Y.W.Z/12 + * @param String tenantId Owner of network. Only admin users can specify a tenant ID other than their own + * @param String name A human-readable name for the subnet. This name might not be unique + * @param String gatewayIp IP address of the default gateway used by devices on this subnet + * @param String dnsNameservers DNS nameservers used by hosts in this subnet + * @param String enableDhcp Specifies whether DHCP is enabled for this subnet + * @param String hostRoutes Routes that should be used by devices with IP addresses from this subnet (not including the local subnet route) + * @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 void + */ + public function create_subnet() { $options = array(); if (isset($this->app->getPostParam("networkId"))) @@ -139,6 +207,12 @@ class network{ } + /** + * List the ID of the NETWORKS + * + * @return List of Networks ID + */ + public function list_network_ids() { try @@ -176,6 +250,12 @@ class network{ $this->app->setOutput("ListNetworkIds", $list_ids); } + /** + * List the name of the NETWORKS + * + * @return List of Networks name + */ + public function list_network_names() { try @@ -213,7 +293,11 @@ class network{ $this->app->setOutput("ListNetworkNames", $list_names); } - + /** + * List the CIDR of the SUBNETS + * + * @return List of SUBNETS CIDR + */ public function list_cidr() { try @@ -245,7 +329,12 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } - + /** + * retrieve a specific network + * @param networkId ID of network which we want to get + * @return Network + */ + retrieve a specific network public function getNetwork() { $network=""; @@ -277,8 +366,13 @@ class network{ $this->app->setOutput("Network", $network); } - - public function getNetwork($netId) + + /** + * internal function + * @param String netId ID of network which we want to get + * @return Network + */ + private function getNetwork($netId) { $network=""; @@ -310,6 +404,11 @@ class network{ return $network; } + /** + * retrieve a specific subnet + * @param subnetId ID of subnet which we want to get + * @return subnet + */ public function getSubnet() { $sbnet=""; @@ -340,8 +439,12 @@ class network{ $this->app->setOutput("Subnet", subnet); } - - public function getSubnet($subnetId) + /** + * internal function + * @param String subnetId ID of subnet which we want to get + * @return subnet + */ + private function getSubnet($subnetId) { $subnet=""; @@ -371,6 +474,18 @@ class network{ return $subnet; } + + /** + * Update a network given + * + * @param String name A human-readable name for the network. This name might not be unique + * @param String adminStateUp The administrative state of network. If false (down), the network does not forward packets + * @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 void + **/ public function updateNetwork() { @@ -411,6 +526,25 @@ class network{ } } + /** + * Update a subnet given + * + * @param String networkId A Network this subnet is associated with + * @param String ipVersion IP version (4 or 6) + * @param String cidr CIDR representing the IP address range for this subnet Exmple X.Y.W.Z/12 + * @param String tenantId Owner of network. Only admin users can specify a tenant ID other than their own + * @param String name A human-readable name for the subnet. This name might not be unique + * @param String gatewayIp IP address of the default gateway used by devices on this subnet + * @param String dnsNameservers DNS nameservers used by hosts in this subnet + * @param String enableDhcp Specifies whether DHCP is enabled for this subnet + * @param String hostRoutes Routes that should be used by devices with IP addresses from this subnet (not including the local subnet route) + * @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 void + **/ + public function updateSubnet() { $options = array(); @@ -453,7 +587,16 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } - + + /** + * Delete a network given + * + * @param String networkId ID if network which we want to delete + + * + * + * @return void + **/ public function deleteNetwork() { try @@ -479,7 +622,16 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } - + + /** + * Delete a subnet given + * + * @param String subnetId ID if network which we want to delete + + * + * + * @return void + **/ public function deleteSubnet() { try @@ -505,6 +657,22 @@ class network{ } } + /** + * Create a new port + * + * @param String networkId Network this port is associated with + * @param String name A human-readable name for the port. This name might not be unique + * @param String adminStateUp The administrative state of port. If false (down), the port does not forward packets + * @param String macAddress MAC address to use on this port + * @param String fixedIps IP addresses for this port + * @param String deviceId Identifies the device (for example, virtual server) using this port + * @param String deviceOwner Identifies the entity (for example, DHCP agent) using this port + * @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 void + */ + public function createPort() { $options = array(); @@ -565,6 +733,12 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } + + /** + * List the of ports + * + * @return List of ports + */ public function listPorts() { @@ -590,6 +764,12 @@ class network{ } } + /** + * retrieve a specific port given + * @param portId ID of port which we want to get + * @return port + */ + public function getPort() { try @@ -616,7 +796,14 @@ class network{ } - public function getPort($portId) + /** + * internal function + * retrieve a specific port given + * @param portId ID of port which we want to get + * @return port + */ + + private function getPort($portId) { try { @@ -642,6 +829,22 @@ class network{ } + + /** + * Update port given + * + * @param String networkId Network this port is associated with + * @param String name A human-readable name for the port. This name might not be unique + * @param String adminStateUp The administrative state of port. If false (down), the port does not forward packets + * @param String macAddress MAC address to use on this port + * @param String fixedIps IP addresses for this port + * @param String deviceId Identifies the device (for example, virtual server) using this port + * @param String deviceOwner Identifies the entity (for example, DHCP agent) using this port + * @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 void + */ public function updatePort() { $options = array(); @@ -704,7 +907,13 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } - + /** + * Delete a port given + * + * @param String portId id of port which we wante to delete + + * @return void + */ public function deletePort() { @@ -731,6 +940,15 @@ class network{ } } + /** + * Create a new security groupe + * + * @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 void + */ + public function createSecurityGroup() { $options = array(); @@ -764,7 +982,21 @@ 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 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 + * + * @return void + */ public function createSecurityGroupRule() { $options = array(); @@ -822,6 +1054,12 @@ class network{ } } + + /** + * List of Security Groupes + * + * @return List of Security Groupes + */ public function listSecurityGroupe() { @@ -846,6 +1084,13 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } + + + /** + * List of Security Groupe Rules + * + * @return List of Security Groupe Rules + */ public function listSecurityGroupeRule() { @@ -872,6 +1117,12 @@ class network{ $this->app->getErrorInstance->NotImplementedHandler($e); } } + + /** + * retrieve a specific Security Groupe given + * @param securityGroupeId ID of security Groupe which we want to get + * @return securityGroupe + */ public function getSecurityGroupe() { @@ -898,8 +1149,14 @@ class network{ } } - - public function getSecurityGroupe($securityGroupeId) + + /** + * internal function + * retrieve a specific Security Groupe given + * @param securityGroupeId ID of security Groupe which we want to get + * @return securityGroupe + */ + private function getSecurityGroupe($securityGroupeId) { try { @@ -924,7 +1181,11 @@ class network{ } } - + /** + * Delete a specific Security Groupe given + * @param securityGroupeId ID of security Groupe which we want to get + * @return void + */ public function deleteSecurityGroupe() { try