diff --git a/Alert.php b/Alert.php index 2cebb19c..3739f456 100644 --- a/Alert.php +++ b/Alert.php @@ -92,6 +92,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/ApplicationServer/Application.php b/ApplicationServer/Application.php index 829fa42e..f56a23f3 100644 --- a/ApplicationServer/Application.php +++ b/ApplicationServer/Application.php @@ -169,6 +169,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/Backup.php b/ApplicationServer/Backup.php index 9df6b0db..0911e571 100644 --- a/ApplicationServer/Backup.php +++ b/ApplicationServer/Backup.php @@ -112,6 +112,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/Database.php b/ApplicationServer/Database.php index 3afdcfc5..2b31afb6 100644 --- a/ApplicationServer/Database.php +++ b/ApplicationServer/Database.php @@ -88,6 +88,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/ApplicationServer/DatabaseUser.php b/ApplicationServer/DatabaseUser.php index fe5253ce..bfc79a8b 100644 --- a/ApplicationServer/DatabaseUser.php +++ b/ApplicationServer/DatabaseUser.php @@ -93,6 +93,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/Domain.php b/ApplicationServer/Domain.php index 98086cee..5ddb1a0c 100644 --- a/ApplicationServer/Domain.php +++ b/ApplicationServer/Domain.php @@ -90,6 +90,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/EmailAccount.php b/ApplicationServer/EmailAccount.php index 4bac185d..ee5f9b74 100644 --- a/ApplicationServer/EmailAccount.php +++ b/ApplicationServer/EmailAccount.php @@ -79,6 +79,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/Ftp.php b/ApplicationServer/Ftp.php index 93a63836..68b68f7d 100644 --- a/ApplicationServer/Ftp.php +++ b/ApplicationServer/Ftp.php @@ -90,6 +90,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/Service.php b/ApplicationServer/Service.php index 80789abe..29f70337 100644 --- a/ApplicationServer/Service.php +++ b/ApplicationServer/Service.php @@ -66,6 +66,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ApplicationServer/SystemApp.php b/ApplicationServer/SystemApp.php index e1674371..a379b468 100644 --- a/ApplicationServer/SystemApp.php +++ b/ApplicationServer/SystemApp.php @@ -108,6 +108,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Asset.php b/Asset.php index 3d2905f2..d7d4597e 100644 --- a/Asset.php +++ b/Asset.php @@ -96,6 +96,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['integrated_storage_disabled'] = array( + ONAPP_FIELD_MAP => '_integrated_storage_disabled', + ONAPP_FIELD_TYPE => 'boolean', + ); + break; } diff --git a/AutobackupPresets.php b/AutobackupPresets.php index 2c8ffeb1..3ab6b176 100644 --- a/AutobackupPresets.php +++ b/AutobackupPresets.php @@ -103,6 +103,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability.php b/Availability.php index a07f1488..9c512e63 100644 --- a/Availability.php +++ b/Availability.php @@ -149,6 +149,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/CommunicationInterface.php b/Availability/CommunicationInterface.php index 6c7bd03a..07f3628d 100644 --- a/Availability/CommunicationInterface.php +++ b/Availability/CommunicationInterface.php @@ -100,6 +100,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/CommunicationRing.php b/Availability/CommunicationRing.php index 979e7a1b..f771399b 100644 --- a/Availability/CommunicationRing.php +++ b/Availability/CommunicationRing.php @@ -104,6 +104,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/Host.php b/Availability/Host.php index 03f41577..1664b2e0 100644 --- a/Availability/Host.php +++ b/Availability/Host.php @@ -118,6 +118,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/Node.php b/Availability/Node.php index 95418fe6..3bd5db0d 100644 --- a/Availability/Node.php +++ b/Availability/Node.php @@ -118,6 +118,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/Subsystem.php b/Availability/Subsystem.php index eb1519db..6340bc7b 100644 --- a/Availability/Subsystem.php +++ b/Availability/Subsystem.php @@ -85,6 +85,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Availability/Subsystem/Service.php b/Availability/Subsystem/Service.php index 5defe02d..fe7d22f0 100644 --- a/Availability/Subsystem/Service.php +++ b/Availability/Subsystem/Service.php @@ -88,6 +88,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BackgroundTaskDaemon.php b/BackgroundTaskDaemon.php index 67f6af33..9ee88424 100644 --- a/BackgroundTaskDaemon.php +++ b/BackgroundTaskDaemon.php @@ -99,6 +99,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BackupServer.php b/BackupServer.php index e253b7b3..051c2d46 100644 --- a/BackupServer.php +++ b/BackupServer.php @@ -123,6 +123,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['os_version_minor'] = array( + ONAPP_FIELD_MAP => '_os_version_minor', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BackupServerZone.php b/BackupServerZone.php index a1cb7e76..7442b169 100644 --- a/BackupServerZone.php +++ b/BackupServerZone.php @@ -186,6 +186,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BaremetalServer.php b/BaremetalServer.php new file mode 100644 index 00000000..9728a8c3 --- /dev/null +++ b/BaremetalServer.php @@ -0,0 +1,33 @@ +fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingCompany/BaseResource.php b/BillingCompany/BaseResource.php index 7c54756a..fd06ccc2 100644 --- a/BillingCompany/BaseResource.php +++ b/BillingCompany/BaseResource.php @@ -179,6 +179,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingCompany/BaseResource/Limit.php b/BillingCompany/BaseResource/Limit.php index c035e6ec..4fffe93e 100644 --- a/BillingCompany/BaseResource/Limit.php +++ b/BillingCompany/BaseResource/Limit.php @@ -182,6 +182,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingCompany/BaseResource/Price.php b/BillingCompany/BaseResource/Price.php index d453e7de..db3c7034 100644 --- a/BillingCompany/BaseResource/Price.php +++ b/BillingCompany/BaseResource/Price.php @@ -112,6 +112,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingCompany/ResourceVCloudComputeZone.php b/BillingCompany/ResourceVCloudComputeZone.php index 2b38b090..e0914f2c 100644 --- a/BillingCompany/ResourceVCloudComputeZone.php +++ b/BillingCompany/ResourceVCloudComputeZone.php @@ -249,6 +249,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } return $this->fields; diff --git a/BillingCompany/ResourceVCloudDataStoreZone.php b/BillingCompany/ResourceVCloudDataStoreZone.php index a92b9c63..47524d3a 100644 --- a/BillingCompany/ResourceVCloudDataStoreZone.php +++ b/BillingCompany/ResourceVCloudDataStoreZone.php @@ -122,6 +122,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } return $this->fields; diff --git a/BillingCompany/ResourceVCloudNetworkZone.php b/BillingCompany/ResourceVCloudNetworkZone.php index 3a1aae1a..5a1f1c49 100644 --- a/BillingCompany/ResourceVCloudNetworkZone.php +++ b/BillingCompany/ResourceVCloudNetworkZone.php @@ -114,6 +114,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } return $this->fields; diff --git a/BillingPlan.php b/BillingPlan.php index e1d0e04b..5399e90e 100644 --- a/BillingPlan.php +++ b/BillingPlan.php @@ -166,6 +166,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingPlan/BaseResource.php b/BillingPlan/BaseResource.php index dc27de0a..cb211443 100644 --- a/BillingPlan/BaseResource.php +++ b/BillingPlan/BaseResource.php @@ -183,6 +183,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingPlan/BaseResource/Limit.php b/BillingPlan/BaseResource/Limit.php index 246af485..a2cd0167 100644 --- a/BillingPlan/BaseResource/Limit.php +++ b/BillingPlan/BaseResource/Limit.php @@ -122,6 +122,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingPlan/BaseResource/Price.php b/BillingPlan/BaseResource/Price.php index 8ab28e12..c9157a56 100644 --- a/BillingPlan/BaseResource/Price.php +++ b/BillingPlan/BaseResource/Price.php @@ -76,6 +76,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingPlan/ResourceAutoScale.php b/BillingPlan/ResourceAutoScale.php new file mode 100644 index 00000000..63597555 --- /dev/null +++ b/BillingPlan/ResourceAutoScale.php @@ -0,0 +1,44 @@ +fields['resource_class'] = array( + ONAPP_FIELD_MAP => '_resource_class', + ONAPP_FIELD_TYPE => 'string', + ONAPP_FIELD_REQUIRED => true, + ONAPP_FIELD_READ_ONLY => true, + ONAPP_FIELD_DEFAULT_VALUE => 'Resource::Autoscale' + ); + + return $this->fields; + } +} \ No newline at end of file diff --git a/BillingUser.php b/BillingUser.php index e34684aa..261fcedb 100644 --- a/BillingUser.php +++ b/BillingUser.php @@ -169,6 +169,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingUser/BaseResource.php b/BillingUser/BaseResource.php index 74b5400c..8356c026 100644 --- a/BillingUser/BaseResource.php +++ b/BillingUser/BaseResource.php @@ -199,6 +199,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); @@ -357,47 +360,33 @@ function getList( $billing_plan_id = null, $url_args = null ) { */ function save() { if ( is_null( $this->_limit ) ) { - $this->_limit = isset( $this->_limits->_limit ) - ? $this->_limits->_limit : ( - isset( $this->_obj->_limits->_limit ) - ? $this->_obj->_limits->_limit - : '' - ); + if ( isset( $this->_limits->_limit ) || isset( $this->_obj->_limits->_limit ) ) { + $this->_limit = isset( $this->_limits->_limit ) ? $this->_limits->_limit : $this->_obj->_limits->_limit; + } } if ( is_null( $this->_limit_free ) ) { - $this->_limit_free = isset( $this->_limits->_limit_free ) - ? $this->_limits->_limit_free : ( - isset( $this->_obj->_limits->_limit_free ) - ? $this->_obj->_limits->_limit_free - : '' - ); + if ( isset( $this->_limits->_limit_free ) || isset( $this->_obj->_limits->_limit_free ) ) { + $this->_limit_free = isset( $this->_limits->_limit_free ) ? $this->_limits->_limit_free : $this->_obj->_limits->_limit_free; + } } if ( is_null( $this->_price_on ) ) { - $this->_price_on = isset( $this->_prices->_price_on ) - ? $this->_prices->_price_on : ( - isset( $this->_obj->_prices->_price_on ) ? - $this->_obj->_prices->_price_on - : '' - ); + if ( isset( $this->_prices->_price_on ) || isset( $this->_obj->_prices->_price_on ) ) { + $this->_price_on = isset( $this->_prices->_price_on ) ? $this->_prices->_price_on : $this->_obj->_prices->_price_on; + } } if ( is_null( $this->_price_off ) ) { - $this->_price_off = isset( $this->_limits->_price_off ) - ? $this->_prices->_price_off : ( - isset( $this->_obj->_prices->_price_off ) - ? $this->_obj->_prices->_price_off - : "" - ); + if ( isset( $this->_limits->_price_off ) || isset( $this->_obj->_prices->_price_off ) ) { + $this->_price_off = isset( $this->_limits->_price_off ) ? $this->_prices->_price_off : $this->_obj->_prices->_price_off; + } } if ( is_null( $this->_price ) ) { - $this->_price = isset( $this->_limits->_price ) - ? $this->_prices->_price - : ( isset( $this->_obj->_prices->_price ) - ? $this->_obj->_prices->_price - : '' ); + if ( isset( $this->_limits->_price ) || isset( $this->_obj->_prices->_price ) ) { + $this->_price = isset( $this->_limits->_price ) ? $this->_prices->_price : $this->_obj->_prices->_price; + } } return parent::save(); diff --git a/BillingUser/BaseResource/Limit.php b/BillingUser/BaseResource/Limit.php index eba032a5..3d0a6b15 100644 --- a/BillingUser/BaseResource/Limit.php +++ b/BillingUser/BaseResource/Limit.php @@ -181,6 +181,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingUser/BaseResource/Price.php b/BillingUser/BaseResource/Price.php index a3f44282..2305d8e1 100644 --- a/BillingUser/BaseResource/Price.php +++ b/BillingUser/BaseResource/Price.php @@ -170,6 +170,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BillingUser/ResourceAutoScale.php b/BillingUser/ResourceAutoScale.php index d82e2167..e69e2c24 100644 --- a/BillingUser/ResourceAutoScale.php +++ b/BillingUser/ResourceAutoScale.php @@ -14,7 +14,7 @@ */ /** - * The OnApp_BillingUser_ResourceAutoScale class uses the following basic methods: + * The OnApp_BillingUser_ResourceAutoscale class uses the following basic methods: * {@link load}, {@link save}, {@link delete}, and {@link getList}. * * For full fields reference and curl request details visit: ( http://help.onapp.com/manual.php?m=2 ) @@ -25,7 +25,7 @@ class OnApp_BillingUser_ResourceAutoScale extends OnApp_BillingUser_BaseResource * * @var string */ - var $_specified_resource_name = 'autoscale'; + var $_specified_resource_name = 'Autoscale'; /** * API Fields description @@ -43,7 +43,7 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_READ_ONLY => true, - ONAPP_FIELD_DEFAULT_VALUE => 'Resource::AutoScale' + ONAPP_FIELD_DEFAULT_VALUE => 'Resource::Autoscale' ); $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceBackupServerGroup.php b/BillingUser/ResourceBackupServerGroup.php index b333cf6c..f5123261 100644 --- a/BillingUser/ResourceBackupServerGroup.php +++ b/BillingUser/ResourceBackupServerGroup.php @@ -149,6 +149,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceDataStoreGroup.php b/BillingUser/ResourceDataStoreGroup.php index 14dcd265..b55062f5 100644 --- a/BillingUser/ResourceDataStoreGroup.php +++ b/BillingUser/ResourceDataStoreGroup.php @@ -149,6 +149,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceEdgeGroup.php b/BillingUser/ResourceEdgeGroup.php index 15e9e918..d3ebb055 100644 --- a/BillingUser/ResourceEdgeGroup.php +++ b/BillingUser/ResourceEdgeGroup.php @@ -90,6 +90,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceHypervisorGroup.php b/BillingUser/ResourceHypervisorGroup.php index 1dd46c2f..4418ff86 100644 --- a/BillingUser/ResourceHypervisorGroup.php +++ b/BillingUser/ResourceHypervisorGroup.php @@ -199,6 +199,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceInstancePackage.php b/BillingUser/ResourceInstancePackage.php new file mode 100644 index 00000000..ef760f43 --- /dev/null +++ b/BillingUser/ResourceInstancePackage.php @@ -0,0 +1,135 @@ +fields['resource_class'] = array( + ONAPP_FIELD_MAP => '_resource_class', + ONAPP_FIELD_TYPE => 'string', + ONAPP_FIELD_REQUIRED => true, + ONAPP_FIELD_READ_ONLY => true, + ONAPP_FIELD_DEFAULT_VALUE => 'Billing::Resource::InstancePackage', + ); + + $this->fields['in_master_zone'] = array( + ONAPP_FIELD_MAP => '_in_master_zone', + ONAPP_FIELD_TYPE => 'string', + ); + + $this->fields['master'] = array( + ONAPP_FIELD_MAP => '_master', + ONAPP_FIELD_TYPE => 'boolean', + ); + + $this->fields['target_type'] = array( + ONAPP_FIELD_MAP => '_target_type', + ONAPP_FIELD_TYPE => 'string', + ONAPP_FIELD_REQUIRED => true, + ONAPP_FIELD_DEFAULT_VALUE => 'InstancePackage', + ); + + $this->fields['hypervisor_group_ids'] = array( + ONAPP_FIELD_MAP => '_hypervisor_group_ids', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['data_store_group_ids'] = array( + ONAPP_FIELD_MAP => '_data_store_group_ids', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['network_group_ids'] = array( + ONAPP_FIELD_MAP => '_network_group_ids', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['price_overused_bandwidth'] = array( + ONAPP_FIELD_MAP => '_price_overused_bandwidth', + ONAPP_FIELD_TYPE => 'string', + ); + + break; + case 4.3: + $this->fields = $this->initFields( 4.2 ); + break; + case 5.0: + $this->fields = $this->initFields( 4.3 ); + break; + case 5.1: + $this->fields = $this->initFields( 5.0 ); + break; + case 5.2: + $this->fields = $this->initFields( 5.1 ); + break; + case 5.3: + $this->fields = $this->initFields( 5.2 ); + break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; + } + + $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; + + foreach ( array( 'unit', 'limit', 'limit_free', 'price', 'price_on', 'price_off' ) as $field ) { + unset( $this->fields[ $field ] ); + } + + return $this->fields; + } + +} + diff --git a/BillingUser/ResourceInstanceType.php b/BillingUser/ResourceInstanceType.php index 53fd2457..296fc5ab 100644 --- a/BillingUser/ResourceInstanceType.php +++ b/BillingUser/ResourceInstanceType.php @@ -117,6 +117,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceNetworkGroup.php b/BillingUser/ResourceNetworkGroup.php index aae0d5fe..38158ea8 100644 --- a/BillingUser/ResourceNetworkGroup.php +++ b/BillingUser/ResourceNetworkGroup.php @@ -149,6 +149,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceRecipeGroup.php b/BillingUser/ResourceRecipeGroup.php index c107674a..d45ba419 100644 --- a/BillingUser/ResourceRecipeGroup.php +++ b/BillingUser/ResourceRecipeGroup.php @@ -99,6 +99,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BillingUser/ResourceTemplateGroup.php b/BillingUser/ResourceTemplateGroup.php index b7b11096..ec944967 100644 --- a/BillingUser/ResourceTemplateGroup.php +++ b/BillingUser/ResourceTemplateGroup.php @@ -100,6 +100,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } $this->fields['id'][ ONAPP_FIELD_REQUIRED ] = false; diff --git a/BlueprintTemplate.php b/BlueprintTemplate.php index 8341fe43..bb3c5cd9 100644 --- a/BlueprintTemplate.php +++ b/BlueprintTemplate.php @@ -106,6 +106,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BlueprintTemplateGroup.php b/BlueprintTemplateGroup.php index 472496d7..9047e712 100644 --- a/BlueprintTemplateGroup.php +++ b/BlueprintTemplateGroup.php @@ -114,6 +114,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/BlueprintTemplateGroup/Relation.php b/BlueprintTemplateGroup/Relation.php index 3ac84b7d..e22bd094 100644 --- a/BlueprintTemplateGroup/Relation.php +++ b/BlueprintTemplateGroup/Relation.php @@ -120,6 +120,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator.php b/CDNAccelerator.php index 2c9a7341..d102b46e 100644 --- a/CDNAccelerator.php +++ b/CDNAccelerator.php @@ -428,6 +428,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/CpuHourlyStat.php b/CDNAccelerator/CpuHourlyStat.php index edb9cca3..68685e67 100644 --- a/CDNAccelerator/CpuHourlyStat.php +++ b/CDNAccelerator/CpuHourlyStat.php @@ -101,6 +101,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/Disk.php b/CDNAccelerator/Disk.php index 79c355a4..337529b4 100644 --- a/CDNAccelerator/Disk.php +++ b/CDNAccelerator/Disk.php @@ -190,6 +190,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/IpAddressJoin.php b/CDNAccelerator/IpAddressJoin.php index 3b83e235..f1228811 100644 --- a/CDNAccelerator/IpAddressJoin.php +++ b/CDNAccelerator/IpAddressJoin.php @@ -120,6 +120,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/IpAddressJoin/IpAddress.php b/CDNAccelerator/IpAddressJoin/IpAddress.php index 6c2f35e9..1acde799 100644 --- a/CDNAccelerator/IpAddressJoin/IpAddress.php +++ b/CDNAccelerator/IpAddressJoin/IpAddress.php @@ -138,6 +138,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/NetworkInterface.php b/CDNAccelerator/NetworkInterface.php index 11411e9a..e67afab0 100644 --- a/CDNAccelerator/NetworkInterface.php +++ b/CDNAccelerator/NetworkInterface.php @@ -142,6 +142,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'boolean', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNAccelerator/VMHourlyStat.php b/CDNAccelerator/VMHourlyStat.php index ed454c8c..cc00e882 100644 --- a/CDNAccelerator/VMHourlyStat.php +++ b/CDNAccelerator/VMHourlyStat.php @@ -125,6 +125,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/Admin.php b/CDNReport/Admin.php new file mode 100644 index 00000000..4f8b1d39 --- /dev/null +++ b/CDNReport/Admin.php @@ -0,0 +1,170 @@ +fields = array( + 'cache_statistic_admin_line_chart' => array( + ONAPP_FIELD_MAP => '_cache_statistic_admin_line_chart', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_CacheStatistic_LineChart' + ), + 'top_five_resources_admin_table' => array( + ONAPP_FIELD_MAP => '_top_five_resources_admin_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_OverviewTopFive_ResourcesTable' + ), + 'top_five_locations_admin' => array( + ONAPP_FIELD_MAP => '_top_five_locations_admin', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_OverviewTopFive_LocationTable' + ), + 'top_five_http_error_codes_admin_table' => array( + ONAPP_FIELD_MAP => '_top_five_http_error_codes_admin_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_OverviewTopFive_HtpErrorCodesTable' + ), + ); + break; + } + + parent::initFields($version, __CLASS__); + + return $this->fields; + } + + function getResource($action = ONAPP_GETRESOURCE_DEFAULT) + { + switch ($action) { + default: + $resource = parent::getResource($action); + break; + } + + return $resource; + } + + + /** + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects + * + * @param array $url_args [start, end, type, resource_type, resources[] ] + * + * @return mixed an array of Object instances on success. Otherwise false + * @access public + */ + public function getList($url_args = null, $params = null) + { + return parent::getList(null, $url_args); + } + + + /** + * Activates action performed with object + * + * @param string $action_name the name of action + * + * @access public + */ + function activateCheck($action_name) + { + switch ($action_name) { + case ONAPP_ACTIVATE_LOAD: + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit('Call to undefined method ' . __CLASS__ . '::' . $action_name . '()'); + break; + } + } + + public function overview() { + + $data = array(); + + if ( $this->_frequency ) { + $data['frequency'] = $this->_frequency; + } else { + $this->logger->error( + 'getList: argument _frequency not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_start_date ) { + $data['start_date'] = $this->_start_date; + } else { + $this->logger->error( + 'getList: argument _start_date not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_end_date ) { + $data['end_date'] = $this->_end_date; + } else { + $this->logger->error( + 'getList: argument _end_date not set.', + __FILE__, + __LINE__ + ); + } + + + $data = array( + 'root' => 'admin', + 'data' => $data + ); + + return $this->sendGet( ONAPP_REQUEST_METHOD_GET, $data ); + } + + +} diff --git a/CDNReport/AdminLocation.php b/CDNReport/AdminLocation.php new file mode 100644 index 00000000..7ac7960f --- /dev/null +++ b/CDNReport/AdminLocation.php @@ -0,0 +1,155 @@ +fields = array( + 'location_admin_table' => array( + ONAPP_FIELD_MAP => '_location_admin_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_Location_AdminTable' + ), + ); + break; + } + + parent::initFields($version, __CLASS__); + + return $this->fields; + } + + function getResource($action = ONAPP_GETRESOURCE_DEFAULT) + { + switch ($action) { + default: + $resource = parent::getResource($action); + break; + } + + return $resource; + } + + + /** + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects + * + * @param array $url_args [start, end, type, resource_type, resources[] ] + * + * @return mixed an array of Object instances on success. Otherwise false + * @access public + */ + public function getList($url_args = null, $params = null) + { + return parent::getList(null, $url_args); + } + + + /** + * Activates action performed with object + * + * @param string $action_name the name of action + * + * @access public + */ + function activateCheck($action_name) + { + switch ($action_name) { + case ONAPP_ACTIVATE_LOAD: + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit('Call to undefined method ' . __CLASS__ . '::' . $action_name . '()'); + break; + } + } + + public function overview() { + + $data = array(); + + if ( $this->_frequency ) { + $data['frequency'] = $this->_frequency; + } else { + $this->logger->error( + 'getList: argument _frequency not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_start_date ) { + $data['start_date'] = $this->_start_date; + } else { + $this->logger->error( + 'getList: argument _start_date not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_end_date ) { + $data['end_date'] = $this->_end_date; + } else { + $this->logger->error( + 'getList: argument _end_date not set.', + __FILE__, + __LINE__ + ); + } + + + $data = array( + 'root' => 'admin', + 'data' => $data + ); + + return $this->sendGet( ONAPP_REQUEST_METHOD_GET, $data ); + } + + +} diff --git a/CDNReport/AdminTopFiftyCDNResource.php b/CDNReport/AdminTopFiftyCDNResource.php new file mode 100644 index 00000000..ad39ce05 --- /dev/null +++ b/CDNReport/AdminTopFiftyCDNResource.php @@ -0,0 +1,155 @@ +fields = array( + 'top_fifty_resources_admin_table' => array( + ONAPP_FIELD_MAP => '_top_fifty_resources_admin_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_TopFifty_AdminTable' + ) + ); + break; + } + + parent::initFields($version, __CLASS__); + + return $this->fields; + } + + function getResource($action = ONAPP_GETRESOURCE_DEFAULT) + { + switch ($action) { + default: + $resource = parent::getResource($action); + break; + } + + return $resource; + } + + + /** + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects + * + * @param array $url_args [start, end, type, resource_type, resources[] ] + * + * @return mixed an array of Object instances on success. Otherwise false + * @access public + */ + public function getList($url_args = null, $params = null) + { + return parent::getList(null, $url_args); + } + + + /** + * Activates action performed with object + * + * @param string $action_name the name of action + * + * @access public + */ + function activateCheck($action_name) + { + switch ($action_name) { + case ONAPP_ACTIVATE_LOAD: + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit('Call to undefined method ' . __CLASS__ . '::' . $action_name . '()'); + break; + } + } + + public function overview() { + + $data = array(); + + if ( $this->_frequency ) { + $data['frequency'] = $this->_frequency; + } else { + $this->logger->error( + 'getList: argument _frequency not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_start_date ) { + $data['start_date'] = $this->_start_date; + } else { + $this->logger->error( + 'getList: argument _start_date not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_end_date ) { + $data['end_date'] = $this->_end_date; + } else { + $this->logger->error( + 'getList: argument _end_date not set.', + __FILE__, + __LINE__ + ); + } + + + $data = array( + 'root' => 'admin', + 'data' => $data + ); + + return $this->sendGet( ONAPP_REQUEST_METHOD_GET, $data ); + } + + +} diff --git a/CDNReport/AdminTopFiftyHttpError.php b/CDNReport/AdminTopFiftyHttpError.php new file mode 100644 index 00000000..d2456656 --- /dev/null +++ b/CDNReport/AdminTopFiftyHttpError.php @@ -0,0 +1,155 @@ +fields = array( + 'top_fifty_http_error_codes_admin_table' => array( + ONAPP_FIELD_MAP => '_top_fifty_http_error_codes_admin_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_TopFifty_HttpErrorCode' + ) + ); + break; + } + + parent::initFields($version, __CLASS__); + + return $this->fields; + } + + function getResource($action = ONAPP_GETRESOURCE_DEFAULT) + { + switch ($action) { + default: + $resource = parent::getResource($action); + break; + } + + return $resource; + } + + + /** + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects + * + * @param array $url_args [start, end, type, resource_type, resources[] ] + * + * @return mixed an array of Object instances on success. Otherwise false + * @access public + */ + public function getList($url_args = null, $params = null) + { + return parent::getList(null, $url_args); + } + + + /** + * Activates action performed with object + * + * @param string $action_name the name of action + * + * @access public + */ + function activateCheck($action_name) + { + switch ($action_name) { + case ONAPP_ACTIVATE_LOAD: + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit('Call to undefined method ' . __CLASS__ . '::' . $action_name . '()'); + break; + } + } + + public function overview() { + + $data = array(); + + if ( $this->_frequency ) { + $data['frequency'] = $this->_frequency; + } else { + $this->logger->error( + 'getList: argument _frequency not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_start_date ) { + $data['start_date'] = $this->_start_date; + } else { + $this->logger->error( + 'getList: argument _start_date not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_end_date ) { + $data['end_date'] = $this->_end_date; + } else { + $this->logger->error( + 'getList: argument _end_date not set.', + __FILE__, + __LINE__ + ); + } + + + $data = array( + 'root' => 'admin', + 'data' => $data + ); + + return $this->sendGet( ONAPP_REQUEST_METHOD_GET, $data ); + } + + +} diff --git a/CDNReport/BandwidthStatistic.php b/CDNReport/BandwidthStatistic.php index 05791dbf..18b8d23d 100644 --- a/CDNReport/BandwidthStatistic.php +++ b/CDNReport/BandwidthStatistic.php @@ -55,6 +55,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/CacheStatistic.php b/CDNReport/CacheStatistic.php index ed11fcb2..40911749 100644 --- a/CDNReport/CacheStatistic.php +++ b/CDNReport/CacheStatistic.php @@ -61,6 +61,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/CacheStatistic/LineChart.php b/CDNReport/CacheStatistic/LineChart.php index 2aa98ce2..679bdfdf 100644 --- a/CDNReport/CacheStatistic/LineChart.php +++ b/CDNReport/CacheStatistic/LineChart.php @@ -55,6 +55,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/CacheStatistic/Table.php b/CDNReport/CacheStatistic/Table.php index 40767876..af0dbb81 100644 --- a/CDNReport/CacheStatistic/Table.php +++ b/CDNReport/CacheStatistic/Table.php @@ -55,6 +55,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/Location/AdminTable.php b/CDNReport/Location/AdminTable.php new file mode 100644 index 00000000..2c82c3e1 --- /dev/null +++ b/CDNReport/Location/AdminTable.php @@ -0,0 +1,51 @@ +fields = array( + 'locationId' => array( + ONAPP_FIELD_MAP => '_locationId', + ONAPP_FIELD_TYPE => 'integer', + ), + 'operatorId' => array( + ONAPP_FIELD_MAP => '_operatorId', + ONAPP_FIELD_TYPE => 'integer', + ), + 'bandwidth' => array( + ONAPP_FIELD_MAP => '_bandwidth', + ONAPP_FIELD_TYPE => 'string', + ) + ); + break; + } + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } +} \ No newline at end of file diff --git a/CDNReport/Location/VisitorCountryTable.php b/CDNReport/Location/VisitorCountryTable.php new file mode 100644 index 00000000..807a0d94 --- /dev/null +++ b/CDNReport/Location/VisitorCountryTable.php @@ -0,0 +1,59 @@ +fields = array( + 'country' => array( + ONAPP_FIELD_MAP => '_country', + ONAPP_FIELD_TYPE => 'string', + ), + 'avgLatency' => array( + ONAPP_FIELD_MAP => '_avgLatency', + ONAPP_FIELD_TYPE => 'float', + ), + 'avgTransferRate' => array( + ONAPP_FIELD_MAP => '_avgTransferRate', + ONAPP_FIELD_TYPE => 'float', + ), + 'request' => array( + ONAPP_FIELD_MAP => '_request', + ONAPP_FIELD_TYPE => 'integer', + ), + 'bandwidth' => array( + ONAPP_FIELD_MAP => '_bandwidth', + ONAPP_FIELD_TYPE => 'string', + ) + ); + break; + } + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } +} \ No newline at end of file diff --git a/CDNReport/OverviewReport.php b/CDNReport/OverviewReport.php index c8a120e4..91b194b7 100644 --- a/CDNReport/OverviewReport.php +++ b/CDNReport/OverviewReport.php @@ -76,6 +76,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/OverviewTopFive/HtpErrorCodesTable.php b/CDNReport/OverviewTopFive/HtpErrorCodesTable.php index d53ecec7..9915a5c7 100644 --- a/CDNReport/OverviewTopFive/HtpErrorCodesTable.php +++ b/CDNReport/OverviewTopFive/HtpErrorCodesTable.php @@ -40,6 +40,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/OverviewTopFive/LocationTable.php b/CDNReport/OverviewTopFive/LocationTable.php index cbc7c8fd..346d8051 100644 --- a/CDNReport/OverviewTopFive/LocationTable.php +++ b/CDNReport/OverviewTopFive/LocationTable.php @@ -40,6 +40,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/OverviewTopFive/ResourcesTable.php b/CDNReport/OverviewTopFive/ResourcesTable.php index d5348d3b..221c78e6 100644 --- a/CDNReport/OverviewTopFive/ResourcesTable.php +++ b/CDNReport/OverviewTopFive/ResourcesTable.php @@ -48,6 +48,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/OverviewTopFive/VisitorCountriesLineChart.php b/CDNReport/OverviewTopFive/VisitorCountriesLineChart.php new file mode 100644 index 00000000..bef5d1b7 --- /dev/null +++ b/CDNReport/OverviewTopFive/VisitorCountriesLineChart.php @@ -0,0 +1,52 @@ +fields = array( + 'time' => array( + ONAPP_FIELD_MAP => '_time', + ONAPP_FIELD_TYPE => 'datetime', + ), + 'country' => array( + ONAPP_FIELD_MAP => '_country', + ONAPP_FIELD_TYPE => 'string', + ), + 'request' => array( + ONAPP_FIELD_MAP => '_request', + ONAPP_FIELD_TYPE => 'integer', + ), + ); + break; + } + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } +} \ No newline at end of file diff --git a/CDNReport/OverviewTopFive/VisitorLocationsPieChart.php b/CDNReport/OverviewTopFive/VisitorLocationsPieChart.php index 4d9b436c..e2a996eb 100644 --- a/CDNReport/OverviewTopFive/VisitorLocationsPieChart.php +++ b/CDNReport/OverviewTopFive/VisitorLocationsPieChart.php @@ -40,6 +40,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/StatusCode.php b/CDNReport/StatusCode.php index c45b4ea4..45a33401 100644 --- a/CDNReport/StatusCode.php +++ b/CDNReport/StatusCode.php @@ -68,6 +68,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/StatusCode/HttpErrorCodeTable.php b/CDNReport/StatusCode/HttpErrorCodeTable.php index ac8c04ca..6f011354 100644 --- a/CDNReport/StatusCode/HttpErrorCodeTable.php +++ b/CDNReport/StatusCode/HttpErrorCodeTable.php @@ -39,6 +39,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/StatusCode/LineChart.php b/CDNReport/StatusCode/LineChart.php index add38a1b..1c5bb695 100644 --- a/CDNReport/StatusCode/LineChart.php +++ b/CDNReport/StatusCode/LineChart.php @@ -43,6 +43,9 @@ public function initFields( $version = null, $className = '' ) { ) ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/StatusCode/Table.php b/CDNReport/StatusCode/Table.php index 1670715a..0104c1b2 100644 --- a/CDNReport/StatusCode/Table.php +++ b/CDNReport/StatusCode/Table.php @@ -39,6 +39,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/TopFifty/AdminTable.php b/CDNReport/TopFifty/AdminTable.php new file mode 100644 index 00000000..4fbd0602 --- /dev/null +++ b/CDNReport/TopFifty/AdminTable.php @@ -0,0 +1,55 @@ +fields = array( + 'resourceId' => array( + ONAPP_FIELD_MAP => '_resourceId', + ONAPP_FIELD_TYPE => 'integer', + ), + 'pastHour' => array( + ONAPP_FIELD_MAP => '_pastHour', + ONAPP_FIELD_TYPE => 'integer', + ), + 'currentHour' => array( + ONAPP_FIELD_MAP => '_currentHour', + ONAPP_FIELD_TYPE => 'integer', + ), + 'bandwidth' => array( + ONAPP_FIELD_MAP => '_bandwidth', + ONAPP_FIELD_TYPE => 'string', + ) + ); + break; + } + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } +} \ No newline at end of file diff --git a/CDNReport/TopFifty/FilesTable.php b/CDNReport/TopFifty/FilesTable.php index ce625ae7..8e15e4de 100644 --- a/CDNReport/TopFifty/FilesTable.php +++ b/CDNReport/TopFifty/FilesTable.php @@ -55,6 +55,9 @@ public function initFields( $version = null, $className = '' ) { ) ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/TopFifty/HttpErrorCode.php b/CDNReport/TopFifty/HttpErrorCode.php new file mode 100644 index 00000000..02b45e8a --- /dev/null +++ b/CDNReport/TopFifty/HttpErrorCode.php @@ -0,0 +1,48 @@ +fields = array( + 'resourceId' => array( + ONAPP_FIELD_MAP => '_resourceId', + ONAPP_FIELD_TYPE => 'integer', + ), + 'errorRequest' => array( + ONAPP_FIELD_MAP => '_errorRequest', + ONAPP_FIELD_TYPE => 'integer', + ) + ); + break; + } + parent::initFields($version, __CLASS__); + + return $this->fields; + } +} \ No newline at end of file diff --git a/CDNReport/TopFifty/ReferersTable.php b/CDNReport/TopFifty/ReferersTable.php index 4cb69eff..24ce1b86 100644 --- a/CDNReport/TopFifty/ReferersTable.php +++ b/CDNReport/TopFifty/ReferersTable.php @@ -43,6 +43,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/TopFile.php b/CDNReport/TopFile.php index b14a9ec7..b6a7eb9f 100644 --- a/CDNReport/TopFile.php +++ b/CDNReport/TopFile.php @@ -66,6 +66,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/TopReferrer.php b/CDNReport/TopReferrer.php index f8f8c16e..46150450 100644 --- a/CDNReport/TopReferrer.php +++ b/CDNReport/TopReferrer.php @@ -61,6 +61,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNReport/Visitor.php b/CDNReport/Visitor.php new file mode 100644 index 00000000..6982d994 --- /dev/null +++ b/CDNReport/Visitor.php @@ -0,0 +1,160 @@ +fields = array( + 'top_five_visitor_countries_line_chart' => array( + ONAPP_FIELD_MAP => '_top_five_visitor_countries_line_chart', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_OverviewTopFive_VisitorCountriesLineChart' + ), + 'visitor_country_table' => array( + ONAPP_FIELD_MAP => '_visitor_country_table', + ONAPP_FIELD_TYPE => 'array', + ONAPP_FIELD_CLASS => 'CDNReport_Location_VisitorCountryTable' + ), + ); + break; + } + + parent::initFields($version, __CLASS__); + + return $this->fields; + } + + function getResource($action = ONAPP_GETRESOURCE_DEFAULT) + { + switch ($action) { + default: + $resource = parent::getResource($action); + break; + } + + return $resource; + } + + + /** + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects + * + * @param array $url_args [start, end, type, resource_type, resources[] ] + * + * @return mixed an array of Object instances on success. Otherwise false + * @access public + */ + public function getList($url_args = null, $params = null) + { + return parent::getList(null, $url_args); + } + + + /** + * Activates action performed with object + * + * @param string $action_name the name of action + * + * @access public + */ + function activateCheck($action_name) + { + switch ($action_name) { + case ONAPP_ACTIVATE_LOAD: + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit('Call to undefined method ' . __CLASS__ . '::' . $action_name . '()'); + break; + } + } + + public function overview() { + + $data = array(); + + if ( $this->_frequency ) { + $data['frequency'] = $this->_frequency; + } else { + $this->logger->error( + 'getList: argument _frequency not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_start_date ) { + $data['start_date'] = $this->_start_date; + } else { + $this->logger->error( + 'getList: argument _start_date not set.', + __FILE__, + __LINE__ + ); + } + if ( $this->_end_date ) { + $data['end_date'] = $this->_end_date; + } else { + $this->logger->error( + 'getList: argument _end_date not set.', + __FILE__, + __LINE__ + ); + } + + + $data = array( + 'root' => 'visitors', + 'data' => $data + ); + + return $this->sendGet( ONAPP_REQUEST_METHOD_GET, $data ); + } + + +} diff --git a/CDNResource.php b/CDNResource.php index 0a0e875c..6804371c 100644 --- a/CDNResource.php +++ b/CDNResource.php @@ -322,6 +322,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/Advanced.php b/CDNResource/Advanced.php index 9f039101..a3c5a94f 100755 --- a/CDNResource/Advanced.php +++ b/CDNResource/Advanced.php @@ -265,6 +265,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/Advanced/Country.php b/CDNResource/Advanced/Country.php index e6a27b30..81e50171 100644 --- a/CDNResource/Advanced/Country.php +++ b/CDNResource/Advanced/Country.php @@ -109,6 +109,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/AvailableEdgeGroup.php b/CDNResource/AvailableEdgeGroup.php index 20aafc63..1f1daab0 100644 --- a/CDNResource/AvailableEdgeGroup.php +++ b/CDNResource/AvailableEdgeGroup.php @@ -105,6 +105,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/AvailableEdgeGroup/Location.php b/CDNResource/AvailableEdgeGroup/Location.php index 10d398ff..9c937938 100644 --- a/CDNResource/AvailableEdgeGroup/Location.php +++ b/CDNResource/AvailableEdgeGroup/Location.php @@ -135,6 +135,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/Bandwidth.php b/CDNResource/Bandwidth.php index 3fb6a965..a44c8f75 100644 --- a/CDNResource/Bandwidth.php +++ b/CDNResource/Bandwidth.php @@ -96,6 +96,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/BillingStatistic.php b/CDNResource/BillingStatistic.php index 3fa7e4fd..88fc00fe 100644 --- a/CDNResource/BillingStatistic.php +++ b/CDNResource/BillingStatistic.php @@ -167,6 +167,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/HTTPCachingRules.php b/CDNResource/HTTPCachingRules.php index 53335225..e0114f68 100644 --- a/CDNResource/HTTPCachingRules.php +++ b/CDNResource/HTTPCachingRules.php @@ -69,6 +69,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/Instructions.php b/CDNResource/Instructions.php index e8c21991..4e68f075 100644 --- a/CDNResource/Instructions.php +++ b/CDNResource/Instructions.php @@ -115,6 +115,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNResource/Origin.php b/CDNResource/Origin.php index 361a8d4f..5efa67b4 100644 --- a/CDNResource/Origin.php +++ b/CDNResource/Origin.php @@ -95,6 +95,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CDNUsageStatistic.php b/CDNUsageStatistic.php index 03c29a81..be46609e 100644 --- a/CDNUsageStatistic.php +++ b/CDNUsageStatistic.php @@ -97,6 +97,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Catalogs.php b/Catalogs.php index 6baff063..6678d93e 100644 --- a/Catalogs.php +++ b/Catalogs.php @@ -93,6 +93,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'integer', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Catalogs/Media.php b/Catalogs/Media.php index 025ce5a3..5ff9a3e5 100644 --- a/Catalogs/Media.php +++ b/Catalogs/Media.php @@ -104,6 +104,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Catalogs/VAppTemplates.php b/Catalogs/VAppTemplates.php index f1e723b8..26e5a9dc 100644 --- a/Catalogs/VAppTemplates.php +++ b/Catalogs/VAppTemplates.php @@ -96,6 +96,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/CloudBootIpAddress.php b/CloudBootIpAddress.php index 998b069d..67587d64 100644 --- a/CloudBootIpAddress.php +++ b/CloudBootIpAddress.php @@ -139,6 +139,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } @@ -159,4 +162,17 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { return $resource; } + function allocateIP( $ip_address = null) { + $data = array( + 'root' => 'ip_address', + 'data' => array( + 'address' => $ip_address, + ) + ); + + $this->sendPost( ONAPP_GETRESOURCE_DEFAULT, $data ); + } + + + } \ No newline at end of file diff --git a/Console.php b/Console.php index 95a136c4..dfa030e8 100644 --- a/Console.php +++ b/Console.php @@ -111,6 +111,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/Container.php b/Container.php index 0eb7d298..ccef6f43 100644 --- a/Container.php +++ b/Container.php @@ -59,6 +59,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } return $this->fields; diff --git a/Currency.php b/Currency.php index b0ad08b7..9c1a5f31 100644 --- a/Currency.php +++ b/Currency.php @@ -119,6 +119,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/CustomerNetwork.php b/CustomerNetwork.php index ce50c7b6..6fa36f9a 100644 --- a/CustomerNetwork.php +++ b/CustomerNetwork.php @@ -131,6 +131,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/CustomerVLAN.php b/CustomerVLAN.php index 38c6c811..09d35a29 100644 --- a/CustomerVLAN.php +++ b/CustomerVLAN.php @@ -95,6 +95,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/DNSSetup.php b/DNSSetup.php index fd2d6e15..23036b17 100644 --- a/DNSSetup.php +++ b/DNSSetup.php @@ -107,6 +107,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } } diff --git a/DNSZone.php b/DNSZone.php index 331b9d20..e26ab3c0 100644 --- a/DNSZone.php +++ b/DNSZone.php @@ -112,6 +112,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; default: $this->fields = $this->initFields( '3.0' ); diff --git a/DNSZone/Record.php b/DNSZone/Record.php index a10f6f3e..492cc389 100644 --- a/DNSZone/Record.php +++ b/DNSZone/Record.php @@ -160,6 +160,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/DataStore.php b/DataStore.php index 806a5415..921ee364 100644 --- a/DataStore.php +++ b/DataStore.php @@ -26,6 +26,8 @@ */ define( 'ONAPP_GETRESOURCE_DATASTORES_LIST_BY_HYPERVISOR_GROUP_ID', 'hypervisor_zones_data_stores' ); +define( 'ONAPP_GETRESOURCE_DATASTORE_IOLIMITS', 'io_limits' ); + /** * Data Stores * @@ -209,6 +211,29 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'boolean', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['read_iops'] = array( + ONAPP_FIELD_MAP => '_read_iops', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['write_iops'] = array( + ONAPP_FIELD_MAP => '_write_iops', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['read_throughput'] = array( + ONAPP_FIELD_MAP => '_read_throughput', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['write_throughput'] = array( + ONAPP_FIELD_MAP => '_write_throughput', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['io_limits'] = array( + ONAPP_FIELD_MAP => '_io_limits', + ONAPP_FIELD_TYPE => 'string', + ); + break; } @@ -231,6 +256,10 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { $resource = 'settings/hypervisor_zones/' . $this->_hypervisor_group_id . '/data_stores'; break; + case ONAPP_GETRESOURCE_DATASTORE_IOLIMITS: + $resource = $this->getResource( ONAPP_GETRESOURCE_LOAD ) . '/io_limits'; + break; + case ONAPP_GETRESOURCE_DEFAULT: /** * ROUTE : @@ -314,4 +343,34 @@ function getListByHypervisorGroupId( $hypervisor_group_id ) { return ( is_array( $result ) || ! $result ) ? $result : array( $result ); } + + function ioLimits( $read_iops = null, $write_iops = null, $read_throughput = null, $write_throughput = null, $id = null ) { + if ( $id ) { + $this->_id = $id; + } + if ( $read_iops ) { + $this->_read_iops = $read_iops; + } + if ( $write_iops ) { + $this->_write_iops = $write_iops; + } + if ( $read_throughput ) { + $this->_read_throughput = $read_throughput; + } + if ( $write_throughput ) { + $this->_write_throughput = $write_throughput; + } + + $data = array( + 'root' => 'io_limits', + 'data' => array( + 'read_iops' => $this->_read_iops, + 'write_iops' => $this->_write_iops, + 'read_throughput' => $this->_read_throughput, + 'write_throughput' => $this->_write_throughput, + ) + ); + $this->sendPut( ONAPP_GETRESOURCE_DATASTORE_IOLIMITS, $data ); + } + } \ No newline at end of file diff --git a/DataStoreZone.php b/DataStoreZone.php index 3ca47ba9..49a7f0c4 100644 --- a/DataStoreZone.php +++ b/DataStoreZone.php @@ -178,6 +178,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'integer', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Disk.php b/Disk.php index 613a1ae0..60fbf62c 100644 --- a/Disk.php +++ b/Disk.php @@ -27,8 +27,11 @@ */ define( 'ONAPP_GETRESOURCE_TAKE_BACKUP', 'backups' ); -define( 'ONAPP_GERRESOURCE_MIGRATE', 'migrate' ); +define( 'ONAPP_GETRESOURCE_MIGRATE', 'migrate' ); +define( 'ONAPP_GETRESOURCE_DISK_IOLIMITS', 'io_limits' ); + +define( 'ONAPP_GETRESOURCE_DISK_ASSIGN', 'assign' ); /** * Managing Disks * @@ -230,7 +233,42 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['io_limits_override'] = array( + ONAPP_FIELD_MAP => '_io_limits_override', + ONAPP_FIELD_TYPE => 'boolean', + ); + $this->fields['read_iops'] = array( + ONAPP_FIELD_MAP => '_read_iops', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['write_iops'] = array( + ONAPP_FIELD_MAP => '_write_iops', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['read_throughput'] = array( + ONAPP_FIELD_MAP => '_read_throughput', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['write_throughput'] = array( + ONAPP_FIELD_MAP => '_write_throughput', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['temporary_virtual_machine_id'] = array( + ONAPP_FIELD_MAP => '_temporary_virtual_machine_id', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['io_limits'] = array( + ONAPP_FIELD_MAP => '_io_limits', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); @@ -343,6 +381,14 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { } break; + case ONAPP_GETRESOURCE_DISK_IOLIMITS: + $resource = $this->getResource( ONAPP_GETRESOURCE_LOAD ) . '/io_limits'; + break; + + case ONAPP_GETRESOURCE_DISK_ASSIGN: + $resource = $this->getResource( ONAPP_GETRESOURCE_LOAD ) . '/assign'; + break; + default: /** * ROUTE : @@ -519,4 +565,63 @@ function migrate( $data_store_id, $id = null ) { ); $this->sendPost( ONAPP_GETRESOURCE_MIGRATE, $data ); } + + function ioLimits( $io_limits_override = null, $read_iops = null, $write_iops = null, $read_throughput = null, $write_throughput = null, $id = null ) { + if ( $id ) { + $this->_id = $id; + } + if ( $io_limits_override !== null ) { + $this->_io_limits_override = $io_limits_override; + } + if ( $read_iops ) { + $this->_read_iops = $read_iops; + } + if ( $write_iops ) { + $this->_write_iops = $write_iops; + } + if ( $read_throughput ) { + $this->_read_throughput = $read_throughput; + } + if ( $write_throughput ) { + $this->_write_throughput = $write_throughput; + } + + $data = array( + 'root' => 'io_limits', + 'data' => array( + 'io_limits_override' => $this->_io_limits_override, + 'read_iops' => $this->_read_iops, + 'write_iops' => $this->_write_iops, + 'read_throughput' => $this->_read_throughput, + 'write_throughput' => $this->_write_throughput, + ) + ); + $this->sendPut( ONAPP_GETRESOURCE_DISK_IOLIMITS, $data ); + } + + function assign( $id = null, $temporary_virtual_machine_id = null ) { + if ( $id ) { + $this->_id = $id; + } + if ( $temporary_virtual_machine_id !== null ) { + $this->_temporary_virtual_machine_id = $temporary_virtual_machine_id; + } + + $data = array( + 'root' => 'disk', + 'data' => array( + 'temporary_virtual_machine_id' => $this->_temporary_virtual_machine_id, + ) + ); + $this->sendPost( ONAPP_GETRESOURCE_DISK_ASSIGN, $data ); + } + + function deassign( $id = null ) { + if ( $id ) { + $this->_id = $id; + } + + $this->sendDelete( ONAPP_GETRESOURCE_DISK_ASSIGN ); + } + } diff --git a/Disk/Schedule.php b/Disk/Schedule.php index c447d07e..ff729660 100644 --- a/Disk/Schedule.php +++ b/Disk/Schedule.php @@ -165,6 +165,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/EdgeGroup.php b/EdgeGroup.php index cf46a9be..132e8f4d 100644 --- a/EdgeGroup.php +++ b/EdgeGroup.php @@ -128,6 +128,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/EdgeGroup/Location.php b/EdgeGroup/Location.php index 9db9d792..fe7726be 100644 --- a/EdgeGroup/Location.php +++ b/EdgeGroup/Location.php @@ -161,6 +161,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/EdgeGroup/Location/Operator.php b/EdgeGroup/Location/Operator.php index 04a1c110..4c4e00b4 100644 --- a/EdgeGroup/Location/Operator.php +++ b/EdgeGroup/Location/Operator.php @@ -133,6 +133,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/EdgeGroup/Location/Operator/Setting.php b/EdgeGroup/Location/Operator/Setting.php index 39574c69..22a52705 100644 --- a/EdgeGroup/Location/Operator/Setting.php +++ b/EdgeGroup/Location/Operator/Setting.php @@ -133,6 +133,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Errors.php b/Errors.php index 325f718c..b6f3c018 100644 --- a/Errors.php +++ b/Errors.php @@ -115,6 +115,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/Federation.php b/Federation.php index c4f18cb9..14f9fead 100644 --- a/Federation.php +++ b/Federation.php @@ -332,6 +332,29 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['certificates'] = array( + ONAPP_FIELD_MAP => '_certificates', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['tier_bandwidth_index'] = array( + ONAPP_FIELD_MAP => '_tier_bandwidth_index', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['tier_cloud_index'] = array( + ONAPP_FIELD_MAP => '_tier_cloud_index', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['tier_cpu_index'] = array( + ONAPP_FIELD_MAP => '_tier_cpu_index', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['tier_disk_index'] = array( + ONAPP_FIELD_MAP => '_tier_disk_index', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/Announcement.php b/Federation/Announcement.php index aa4fb386..7dcdaebd 100644 --- a/Federation/Announcement.php +++ b/Federation/Announcement.php @@ -102,6 +102,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/BuyerToken.php b/Federation/BuyerToken.php index ef903ea2..7b80df51 100644 --- a/Federation/BuyerToken.php +++ b/Federation/BuyerToken.php @@ -75,6 +75,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/DataStoreZonePricing.php b/Federation/DataStoreZonePricing.php index 600cfc1a..01c3cdca 100644 --- a/Federation/DataStoreZonePricing.php +++ b/Federation/DataStoreZonePricing.php @@ -87,6 +87,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/FederationFailedAction.php b/Federation/FederationFailedAction.php index d6ace624..69fb86b3 100644 --- a/Federation/FederationFailedAction.php +++ b/Federation/FederationFailedAction.php @@ -83,6 +83,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/HypervisorZonePricing.php b/Federation/HypervisorZonePricing.php index 748e2bcf..052c10f2 100644 --- a/Federation/HypervisorZonePricing.php +++ b/Federation/HypervisorZonePricing.php @@ -94,6 +94,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/HypervisorZoneScore.php b/Federation/HypervisorZoneScore.php index f3a441a3..2a0c43d5 100644 --- a/Federation/HypervisorZoneScore.php +++ b/Federation/HypervisorZoneScore.php @@ -95,6 +95,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/HypervisorZoneUptime.php b/Federation/HypervisorZoneUptime.php index da69bcb8..efc120c1 100644 --- a/Federation/HypervisorZoneUptime.php +++ b/Federation/HypervisorZoneUptime.php @@ -71,6 +71,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/NetworkZonePricing.php b/Federation/NetworkZonePricing.php index ee4dc7d1..c9603e0b 100644 --- a/Federation/NetworkZonePricing.php +++ b/Federation/NetworkZonePricing.php @@ -86,6 +86,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/SellerToken.php b/Federation/SellerToken.php index c646aeb8..187c7ef4 100644 --- a/Federation/SellerToken.php +++ b/Federation/SellerToken.php @@ -83,6 +83,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/TierOptions.php b/Federation/TierOptions.php index b7a2d012..0dc0772b 100644 --- a/Federation/TierOptions.php +++ b/Federation/TierOptions.php @@ -94,6 +94,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Federation/UserVirtualServerPricing.php b/Federation/UserVirtualServerPricing.php index 9ceb1f91..1b02d789 100644 --- a/Federation/UserVirtualServerPricing.php +++ b/Federation/UserVirtualServerPricing.php @@ -106,6 +106,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Firewall.php b/Firewall.php index 372ded34..25c65c12 100644 --- a/Firewall.php +++ b/Firewall.php @@ -138,6 +138,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Group.php b/Group.php index 55f63082..31408f77 100644 --- a/Group.php +++ b/Group.php @@ -174,6 +174,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Hypervisor.php b/Hypervisor.php index 05afceef..ad551c43 100644 --- a/Hypervisor.php +++ b/Hypervisor.php @@ -229,7 +229,6 @@ public function initFields( $version = null, $className = '' ) { $this->fields['free_disk_space'] = array( ONAPP_FIELD_MAP => '_free_disk_space', ONAPP_FIELD_TYPE => '_array', - ); break; @@ -454,6 +453,17 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['integrated_storage_disabled'] = array( + ONAPP_FIELD_MAP => '_integrated_storage_disabled', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['os_version_minor'] = array( + ONAPP_FIELD_MAP => '_os_version_minor', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); @@ -641,7 +651,10 @@ function save() { return parent::save(); } - function enableMaintanceMode() { + function enableMaintanceMode( $id = null ) { + if ( $id ) { + $this->_id = $id; + } $data = array( 'root' => 'force', 'data' => '1' @@ -650,7 +663,11 @@ function enableMaintanceMode() { return $this->sendPut( ONAPP_ENABLE_MAINTENANCE_MODE, $data ); } - function disableMaintanceMode() { + function disableMaintanceMode( $id = null ) { + if ( $id ) { + $this->_id = $id; + } + return $this->sendPut( ONAPP_DISABLE_MAINTENANCE_MODE ); } } \ No newline at end of file diff --git a/Hypervisor/BackupServerJoin.php b/Hypervisor/BackupServerJoin.php index d18ba702..3e613443 100644 --- a/Hypervisor/BackupServerJoin.php +++ b/Hypervisor/BackupServerJoin.php @@ -83,6 +83,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Hypervisor/ConnectionOptions.php b/Hypervisor/ConnectionOptions.php index 50988305..14d61165 100644 --- a/Hypervisor/ConnectionOptions.php +++ b/Hypervisor/ConnectionOptions.php @@ -90,6 +90,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Hypervisor/DataStoreJoin.php b/Hypervisor/DataStoreJoin.php index da324f7b..4f14b578 100644 --- a/Hypervisor/DataStoreJoin.php +++ b/Hypervisor/DataStoreJoin.php @@ -95,6 +95,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Hypervisor/NetworkJoin.php b/Hypervisor/NetworkJoin.php index fb7526a8..99dd20ba 100644 --- a/Hypervisor/NetworkJoin.php +++ b/Hypervisor/NetworkJoin.php @@ -129,6 +129,11 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['target_join_id'][ ONAPP_FIELD_REQUIRED ] = false; + $this->fields['target_join_type'][ ONAPP_FIELD_REQUIRED ] = false; + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Hypervisor/Storage.php b/Hypervisor/Storage.php index 0a09b4f6..ef4d6fcc 100644 --- a/Hypervisor/Storage.php +++ b/Hypervisor/Storage.php @@ -106,6 +106,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/HypervisorZone.php b/HypervisorZone.php index 471fd3e3..69240c34 100644 --- a/HypervisorZone.php +++ b/HypervisorZone.php @@ -249,6 +249,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/HypervisorZone/BackupServerJoin.php b/HypervisorZone/BackupServerJoin.php index 598ad791..0b94a5dc 100644 --- a/HypervisorZone/BackupServerJoin.php +++ b/HypervisorZone/BackupServerJoin.php @@ -83,6 +83,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/HypervisorZone/DataStoreJoin.php b/HypervisorZone/DataStoreJoin.php index 5699e116..f2840d37 100644 --- a/HypervisorZone/DataStoreJoin.php +++ b/HypervisorZone/DataStoreJoin.php @@ -114,6 +114,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/HypervisorZone/NetworkJoin.php b/HypervisorZone/NetworkJoin.php index cdbecf93..10700986 100644 --- a/HypervisorZone/NetworkJoin.php +++ b/HypervisorZone/NetworkJoin.php @@ -125,6 +125,11 @@ function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['target_join_id'][ ONAPP_FIELD_REQUIRED ] = false; + $this->fields['target_join_type'][ ONAPP_FIELD_REQUIRED ] = false; + break; } parent::initFields( $version, __CLASS__ ); @@ -167,7 +172,20 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { * @alias /settings/hypervisor_zones/:hypervisor_group_id/network_joins/:id(.:format) * @format {:controller=>"network_joins", :action=>"destroy"} */ - $resource = 'settings/hypervisor_zones/' . $this->_target_join_id . '/' . $this->_resource; + + if ( is_null( $this->_network_id ) && is_null( $this->_obj->_network_id ) ) { + $this->logger->error( + 'getResource( ' . $action . ' ): argument _network_id not set.', + __FILE__, + __LINE__ + ); + } else { + if ( is_null( $this->_network_id ) ) { + $this->_network_id = $this->_obj->_network_id ; + } + } + + $resource = 'settings/hypervisor_zones/' . $this->_network_id . '/' . $this->_resource; $this->logger->debug( 'getResource( ' . $action . ' ): return ' . $resource ); break; @@ -178,29 +196,4 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { return $resource; } - - /** - * Gets list of network joins to particular hypervisor zone - * - * @param integet hypervisor zone id - * - * @return array of newtwork join objects - */ - function getList( $target_join_id = null, $url_args = null ) { - if ( is_null( $target_join_id ) && ! is_null( $this->_target_join_id ) ) { - $target_join_id = $this->_target_join_id; - } - - if ( ! is_null( $target_join_id ) ) { - $this->_target_join_id = $target_join_id; - - return parent::getList(); - } else { - $this->logger->error( - 'getList: argument _target_join_id not set.', - __FILE__, - __LINE__ - ); - } - } } diff --git a/IPAddressPool.php b/IPAddressPool.php index 8ce2edbe..e46775da 100644 --- a/IPAddressPool.php +++ b/IPAddressPool.php @@ -97,6 +97,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ISO.php b/ISO.php index 16c267f6..cb4f68f0 100644 --- a/ISO.php +++ b/ISO.php @@ -260,6 +260,13 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'boolean', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/InstancePackage.php b/InstancePackage.php index 84eb6d90..6c984960 100644 --- a/InstancePackage.php +++ b/InstancePackage.php @@ -113,6 +113,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/InstanceType.php b/InstanceType.php index 9d6e5e6e..f8f41bf0 100644 --- a/InstanceType.php +++ b/InstanceType.php @@ -123,6 +123,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/IpAddress.php b/IpAddress.php index 3732ae9b..ec5af019 100644 --- a/IpAddress.php +++ b/IpAddress.php @@ -153,6 +153,21 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['ip_range_id'] = array( + ONAPP_FIELD_MAP => '_ip_range_id', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['ipv4'] = array( + ONAPP_FIELD_MAP => '_ipv4', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['prefix'] = array( + ONAPP_FIELD_MAP => '_prefix', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..810d1158 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +Copyright (c) 2014, OnApp Ltd + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/License.php b/License.php index 82859701..b8f13ed0 100644 --- a/License.php +++ b/License.php @@ -109,6 +109,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LoadBalancingCluster.php b/LoadBalancingCluster.php index e87baa50..8bb3dfad 100644 --- a/LoadBalancingCluster.php +++ b/LoadBalancingCluster.php @@ -188,6 +188,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LoadBalancingCluster/AutoScaling.php b/LoadBalancingCluster/AutoScaling.php index 74008e3f..36a31b8e 100644 --- a/LoadBalancingCluster/AutoScaling.php +++ b/LoadBalancingCluster/AutoScaling.php @@ -96,6 +96,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LoadBalancingCluster/Config.php b/LoadBalancingCluster/Config.php index 5bb3d601..98932cbd 100644 --- a/LoadBalancingCluster/Config.php +++ b/LoadBalancingCluster/Config.php @@ -76,6 +76,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LoadBalancingCluster/Node.php b/LoadBalancingCluster/Node.php index e48d11a6..68e9035a 100644 --- a/LoadBalancingCluster/Node.php +++ b/LoadBalancingCluster/Node.php @@ -103,6 +103,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LoadBalancingCluster/NodeAtribute.php b/LoadBalancingCluster/NodeAtribute.php index 08d158ac..6e84c486 100644 --- a/LoadBalancingCluster/NodeAtribute.php +++ b/LoadBalancingCluster/NodeAtribute.php @@ -86,6 +86,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Locale.php b/Locale.php index 8800e929..4ddd1abe 100644 --- a/Locale.php +++ b/Locale.php @@ -69,6 +69,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/LocationGroup.php b/LocationGroup.php index 2b5e3eef..851106b5 100644 --- a/LocationGroup.php +++ b/LocationGroup.php @@ -119,6 +119,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Log.php b/Log.php index 78a24210..ddffb562 100644 --- a/Log.php +++ b/Log.php @@ -116,6 +116,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Maintenance.php b/Maintenance.php index e98d93f7..139db53c 100644 --- a/Maintenance.php +++ b/Maintenance.php @@ -89,6 +89,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Nameserver.php b/Nameserver.php index 3b1b8992..d4fb6baa 100644 --- a/Nameserver.php +++ b/Nameserver.php @@ -112,6 +112,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Network.php b/Network.php index 3501ef52..a7c01289 100644 --- a/Network.php +++ b/Network.php @@ -41,6 +41,11 @@ */ define( 'ONAPP_GETRESOURCE_IP_ASSIGN', 'ip_assign' ); +/** + * + */ +define( 'ONAPP_GETRESOURCE_IP_UNASSIGN', 'ip_unassign' ); + /** * Configuring Network @@ -228,6 +233,18 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['id'][ONAPP_FIELD_REQUIRED] = false; + $this->fields['created_at'][ONAPP_FIELD_REQUIRED] = false; + $this->fields['updated_at'][ONAPP_FIELD_REQUIRED] = false; + $this->fields['identifier'][ONAPP_FIELD_REQUIRED] = false; + + $this->fields['type'] = array( + ONAPP_FIELD_MAP => '_type', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); @@ -269,6 +286,14 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { $resource = $this->_resource . '/' . $this->_id . '/ip_addresses/assign'; break; + case ONAPP_GETRESOURCE_IP_UNASSIGN: + /* + * @method POST + * @alias /settings/networks/:network_id/ip_addresses/assign(.:format) + */ + $resource = $this->_resource . '/' . $this->_id . '/ip_addresses/unassign'; + break; + default: /** * ROUTE : @@ -327,7 +352,7 @@ function getListByHypervisorGroupId( $hypervisor_group_id = null ) { return ( is_array( $result ) || ! $result ) ? $result : array( $result ); } - function assignIPAddressToUser( $ipAddressIDs, $userID ) { + function assignIPAddressToUser( $ipAddresses, $userID ) { if ( is_null( $this->_id ) ) { $this->logger->error( 'cloudConfig: argument _id not set.', @@ -335,26 +360,65 @@ function assignIPAddressToUser( $ipAddressIDs, $userID ) { __LINE__ ); } + $ipAddressesRes = []; + if ( is_array( $ipAddresses ) ) { + foreach ( $ipAddresses as $ip ) { + $ipAddressesRes[] = $ip; + } + } else { + $ipAddressesRes[] = $ipAddresses; + } $data = array( 'root' => 'tmp_holder', 'data' => array( - 'ip_address' => $ipAddressIDs, - 'user_id' => $userID, + 'ip_address' => $ipAddressesRes, + 'user_id' => $userID, ), ); - $res = $this->sendPut( ONAPP_GETRESOURCE_IP_ASSIGN, $data ); + $res = $this->sendPost( ONAPP_GETRESOURCE_IP_ASSIGN, $data ); + + return $res; + } + + function unassignIPAddress( $ipAddressIDs ) { + if ( is_null( $this->_id ) ) { + $this->logger->error( + 'cloudConfig: argument _id not set.', + __FILE__, + __LINE__ + ); + } + $ipAddresses = []; + if ( is_array( $ipAddressIDs ) ) { + foreach ( $ipAddressIDs as $ip ) { + $ipAddresses[] = $ip; + } + } else { + $ipAddresses[] = $ipAddressIDs; + } + + $data = array( + 'root' => 'tmp_holder', + 'data' => array( + 'ip_addresses' => $ipAddresses, + ), + ); + + $res = $this->sendPost( ONAPP_GETRESOURCE_IP_UNASSIGN, $data ); return $res; } function activateCheck( $action_name ) { - switch ( $action_name ) { - case ONAPP_ACTIVATE_SAVE: - case ONAPP_ACTIVATE_DELETE: - exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' ); - break; + if($this->version < 5.3){ + switch ( $action_name ) { + case ONAPP_ACTIVATE_SAVE: + case ONAPP_ACTIVATE_DELETE: + exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' ); + break; + } } } } diff --git a/Network/IpNet.php b/Network/IpNet.php new file mode 100644 index 00000000..c48f5b34 --- /dev/null +++ b/Network/IpNet.php @@ -0,0 +1,165 @@ +fields = array( + 'id' => array( + ONAPP_FIELD_MAP => '_id', + ONAPP_FIELD_TYPE => 'integer' + ), + 'network_address' => array( + ONAPP_FIELD_MAP => '_network_address', + ONAPP_FIELD_TYPE => 'string' + ), + 'default_gateway' => array( + ONAPP_FIELD_MAP => '_default_gateway', + ONAPP_FIELD_TYPE => 'string' + ), + 'network_mask' => array( + ONAPP_FIELD_MAP => '_network_mask', + ONAPP_FIELD_TYPE => 'integer' + ), + 'ipv4' => array( + ONAPP_FIELD_MAP => '_ipv4', + ONAPP_FIELD_TYPE => 'boolean' + ), + 'label' => array( + ONAPP_FIELD_MAP => '_label', + ONAPP_FIELD_TYPE => 'string' + ), + 'created_at' => array( + ONAPP_FIELD_MAP => '_created_at', + ONAPP_FIELD_TYPE => 'datetime' + ), + 'updated_at' => array( + ONAPP_FIELD_MAP => '_updated_at', + ONAPP_FIELD_TYPE => 'datetime' + ), + 'openstack_id' => array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'integer' + ), + 'network' => array( + ONAPP_FIELD_MAP => '_network', + ONAPP_FIELD_TYPE => 'array' + ), + 'network_id' => array( + ONAPP_FIELD_MAP => '_network_id', + ONAPP_FIELD_TYPE => 'string' + ), + ); + break; + } + + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } + + function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { + switch ( $action ) { + case ONAPP_GETRESOURCE_DEFAULT: + if ( is_null( $this->_network_id ) && is_null( $this->_obj->_network_id ) ) { + $this->logger->error( + 'getResource( ' . $action . ' ): argument _network_id not set.', + __FILE__, + __LINE__ + ); + } else { + if ( is_null( $this->_network_id ) ) { + $this->_network_id = $this->_obj->_network_id; + } + } + $resource = $this->_resource . '/' . $this->_network_id . '/ip_nets'; + break; + + + default: + /** + * ROUTE : + * + * @name ip_nets + * @method GET + * @alias settings/networks/:network_zone_id/ip_nets(.:format) + * @format {:controller=>"ip_nets", :action=>"index"} + */ + /** + * ROUTE : + * + * @name ip_nets + * @method GET + * @alias settings/networks/:network_zone_id/ip_nets/:id(.:format) + * @format {:controller=>"ip_nets", :action=>"show"} + */ + /** + * ROUTE : + * + * @name ip_nets + * @method POST + * @alias settings/networks/:network_zone_id/ip_nets/:id(.:format) + * @format {:controller=>"ip_nets", :action=>"create"} + */ + /** + * ROUTE : + * + * @name ip_nets + * @method PUT + * @alias settings/networks/:network_zone_id/ip_nets/:id(.:format) + * @format {:controller=>"ip_nets", :action=>"update"} + */ + /** + * ROUTE : + * + * @name ip_nets + * @method DELETE + * @alias settings/networks/:network_zone_id/ip_nets/:id(.:format) + * @format {:controller=>"ip_nets", :action=>"destroy"} + */ + $resource = parent::getResource( $action ); + } + + return $resource; + } +} \ No newline at end of file diff --git a/Network/IpNet/IpRange.php b/Network/IpNet/IpRange.php new file mode 100644 index 00000000..bee4d579 --- /dev/null +++ b/Network/IpNet/IpRange.php @@ -0,0 +1,174 @@ +fields = array( + 'id' => array( + ONAPP_FIELD_MAP => '_id', + ONAPP_FIELD_TYPE => 'integer' + ), + 'ipv4' => array( + ONAPP_FIELD_MAP => '_ipv4', + ONAPP_FIELD_TYPE => 'boolean' + ), + 'default_gateway' => array( + ONAPP_FIELD_MAP => '_default_gateway', + ONAPP_FIELD_TYPE => 'string' + ), + 'created_at' => array( + ONAPP_FIELD_MAP => '_created_at', + ONAPP_FIELD_TYPE => 'datetime' + ), + 'updated_at' => array( + ONAPP_FIELD_MAP => '_updated_at', + ONAPP_FIELD_TYPE => 'datetime' + ), + 'start_address' => array( + ONAPP_FIELD_MAP => '_start_address', + ONAPP_FIELD_TYPE => 'string' + ), + 'end_address' => array( + ONAPP_FIELD_MAP => '_end_address', + ONAPP_FIELD_TYPE => 'string' + ), + 'net_id' => array( + ONAPP_FIELD_MAP => '_net_id', + ONAPP_FIELD_TYPE => 'integer' + ), + 'network_id' => array( + ONAPP_FIELD_MAP => '_network_id', + ONAPP_FIELD_TYPE => 'integer' + ), + 'ip_net' => array( + ONAPP_FIELD_MAP => '_ip_net', + ONAPP_FIELD_TYPE => 'array' + ), + ); + break; + } + + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } + + function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { + switch ( $action ) { + case ONAPP_GETRESOURCE_DEFAULT: + if ( is_null( $this->_network_id ) && is_null( $this->_obj->_network_id ) ) { + $this->logger->error( + 'getResource( ' . $action . ' ): argument _network_id not set.', + __FILE__, + __LINE__ + ); + } else { + if ( is_null( $this->_network_id ) ) { + $this->_network_id = $this->_obj->_network_id; + } + } + + if ( is_null( $this->_net_id ) && is_null( $this->_obj->_net_id ) ) { + $this->logger->error( + 'getResource( ' . $action . ' ): argument _net_id not set.', + __FILE__, + __LINE__ + ); + } else { + if ( is_null( $this->_net_id ) ) { + $this->_net_id = $this->_obj->_net_id; + } + } + + $resource = $this->_resource . '/' . $this->_network_id . '/ip_nets/' . $this->_net_id . '/ip_ranges'; + break; + + + default: + /** + * ROUTE : + * + * @name ip_ranges + * @method GET + * @alias settings/networks/:network_zone_id/ip_nets/:net_id/ip_ranges(.:format) + * @format {:controller=>"ip_ranges", :action=>"index"} + */ + /** + * ROUTE : + * + * @name ip_ranges + * @method GET + * @alias settings/networks/:network_zone_id/ip_nets/:net_id/ip_ranges/:id(.:format) + * @format {:controller=>"ip_ranges", :action=>"show"} + */ + /** + * ROUTE : + * + * @name ip_ranges + * @method POST + * @alias settings/networks/:network_zone_id/ip_nets/:net_id/ip_ranges/:id(.:format) + * @format {:controller=>"ip_ranges", :action=>"create"} + */ + /** + * ROUTE : + * + * @name ip_ranges + * @method PUT + * @alias settings/networks/:network_zone_id/ip_nets/:net_id/ip_ranges/:id(.:format) + * @format {:controller=>"ip_ranges", :action=>"update"} + */ + /** + * ROUTE : + * + * @name ip_ranges + * @method DELETE + * @alias settings/networks/:network_zone_id/ip_nets/:net_id/ip_ranges/:id(.:format) + * @format {:controller=>"ip_ranges", :action=>"destroy"} + */ + $resource = parent::getResource( $action ); + } + + return $resource; + } +} \ No newline at end of file diff --git a/NetworkZone.php b/NetworkZone.php index a78603f7..7220a426 100644 --- a/NetworkZone.php +++ b/NetworkZone.php @@ -21,6 +21,10 @@ * */ define( 'ONAPP_GETRESOURCE_NETWORKZONE_ATTACH', 'networkzone_attach' ); +/** + * + */ +define( 'ONAPP_GETRESOURCE_NETWORKZONE_DETACH', 'networkzone_detach' ); /** * @@ -161,6 +165,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'integer', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); @@ -206,6 +213,13 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { $resource = $this->getResource( ONAPP_GETRESOURCE_NETWORKZONE_WITHNETWORKID ) . '/attach'; break; + case ONAPP_GETRESOURCE_NETWORKZONE_DETACH: + /** + * @alias /settings/network_zones/:network_zone_id/networks/:id/attach.json + */ + $resource = $this->getResource( ONAPP_GETRESOURCE_NETWORKZONE_WITHNETWORKID ) . '/detach'; + break; + default: /** * ROUTE : @@ -259,5 +273,10 @@ function attach( $network_id = null ) { } $this->sendPost( ONAPP_GETRESOURCE_NETWORKZONE_ATTACH ); } - + function detach( $network_id = null ) { + if ( ! is_null( $network_id ) ) { + $this->_network_id = $network_id; + } + $this->sendPost( ONAPP_GETRESOURCE_NETWORKZONE_DETACH ); + } } \ No newline at end of file diff --git a/OrchestrationModel.php b/OrchestrationModel.php index aa3be298..f3e34eda 100644 --- a/OrchestrationModel.php +++ b/OrchestrationModel.php @@ -340,6 +340,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/OrchestrationModel/DataStore.php b/OrchestrationModel/DataStore.php index b5d370b3..c1195dc4 100644 --- a/OrchestrationModel/DataStore.php +++ b/OrchestrationModel/DataStore.php @@ -88,6 +88,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/OrchestrationModel/Network.php b/OrchestrationModel/Network.php index acaf80e0..402829bf 100644 --- a/OrchestrationModel/Network.php +++ b/OrchestrationModel/Network.php @@ -72,6 +72,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/OrgNetwork.php b/OrgNetwork.php new file mode 100644 index 00000000..8aeba32e --- /dev/null +++ b/OrgNetwork.php @@ -0,0 +1,237 @@ +fields = array( + 'created_at' => array( + ONAPP_FIELD_MAP => '_created_at', + ONAPP_FIELD_TYPE => 'datetime', + ), + 'updated_at' => array( + ONAPP_FIELD_MAP => '_updated_at', + ONAPP_FIELD_TYPE => 'datetime', + ), + 'default_nat_rule_number' => array( + ONAPP_FIELD_MAP => '_default_nat_rule_number', + ONAPP_FIELD_TYPE => 'string', + ), + 'default_outside_ip_address_id' => array( + ONAPP_FIELD_MAP => '_default_outside_ip_address_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'dns_suffix' => array( + ONAPP_FIELD_MAP => '_dns_suffix', + ONAPP_FIELD_TYPE => 'string', + ), + 'dvportgroup' => array( + ONAPP_FIELD_MAP => '_dvportgroup', + ONAPP_FIELD_TYPE => 'string', + ), + 'enabled' => array( + ONAPP_FIELD_MAP => '_enabled', + ONAPP_FIELD_TYPE => 'string', + ), + 'fence_mode' => array( + ONAPP_FIELD_MAP => '_fence_mode', + ONAPP_FIELD_TYPE => 'string', + ), + 'gateway' => array( + ONAPP_FIELD_MAP => '_gateway', + ONAPP_FIELD_TYPE => 'string', + ), + 'id' => array( + ONAPP_FIELD_MAP => '_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'identifier' => array( + ONAPP_FIELD_MAP => '_identifier', + ONAPP_FIELD_TYPE => 'string', + ), + 'ip_address_pool_id' => array( + ONAPP_FIELD_MAP => '_ip_address_pool_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'is_nated' => array( + ONAPP_FIELD_MAP => '_is_nated', + ONAPP_FIELD_TYPE => 'string', + ), + 'label' => array( + ONAPP_FIELD_MAP => '_label', + ONAPP_FIELD_TYPE => 'string', + ), + 'netmask' => array( + ONAPP_FIELD_MAP => '_netmask', + ONAPP_FIELD_TYPE => 'string', + ), + 'network_group_id' => array( + ONAPP_FIELD_MAP => '_network_group_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'prefix_size' => array( + ONAPP_FIELD_MAP => '_prefix_size', + ONAPP_FIELD_TYPE => 'string', + ), + 'primary_dns' => array( + ONAPP_FIELD_MAP => '_primary_dns', + ONAPP_FIELD_TYPE => 'string', + ), + 'secondary_dns' => array( + ONAPP_FIELD_MAP => '_secondary_dns', + ONAPP_FIELD_TYPE => 'string', + ), + 'shared' => array( + ONAPP_FIELD_MAP => '_shared', + ONAPP_FIELD_TYPE => 'string', + ), + 'user_id' => array( + ONAPP_FIELD_MAP => '_user_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'vapp_id' => array( + ONAPP_FIELD_MAP => '_vapp_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'vdc_id' => array( + ONAPP_FIELD_MAP => '_vdc_id', + ONAPP_FIELD_TYPE => 'string', + ), + 'vlan' => array( + ONAPP_FIELD_MAP => '_vlan', + ONAPP_FIELD_TYPE => 'string', + ), + ); + break; + case 5.1: + case 5.2: + case 5.3: + $this->fields = $this->initFields( 5.0 ); + break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; + } + + parent::initFields( $version, __CLASS__ ); + + return $this->fields; + } + + function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { + switch ( $action ) { + default: + $resource = parent::getResource( $action ); + break; + } + + return $resource; + } + + function createDirectNetwork( $user_group_id, $label, $vdc_id, $fence_mode, $parent_network_id ) { + $data = array( + 'root' => 'tmp_holder', + 'data' => array( + 'user_group_id' => $user_group_id, + 'org_network' => array( + 'label' => $label, + 'vdc_id' => $vdc_id, + 'fence_mode' => $fence_mode, + 'parent_network_id' => $parent_network_id, + ), + ) + ); + $this->sendPost( ONAPP_GETRESOURCE_DEFAULT, $data ); + } + + function createRoutedNetwork( $user_group_id, $label, $vdc_id, $fence_mode, $network_gateway_cidr, $shared, $start_address, $end_address, $edge_gateway ) { + $data = array( + 'root' => 'tmp_holder', + 'data' => array( + 'user_group_id' => $user_group_id, + 'org_network' => array( + 'label' => $label, + 'vdc_id' => $vdc_id, + 'fence_mode' => $fence_mode, + 'network_gateway_cidr' => $network_gateway_cidr, + 'shared' => $shared, + 'ip_ranges_attributes' => array( + 'start_address' => $start_address, + 'end_address' => $end_address, + ), + 'edge_gateway' => $edge_gateway, + ), + ) + ); + $this->sendPost( ONAPP_GETRESOURCE_DEFAULT, $data ); + } + + function createIsolatedNetwork( $user_group_id, $label, $vdc_id, $fence_mode, $network_gateway_cidr, $shared, $start_address, $end_address ) { + $data = array( + 'root' => 'tmp_holder', + 'data' => array( + 'user_group_id' => $user_group_id, + 'org_network' => array( + 'label' => $label, + 'vdc_id' => $vdc_id, + 'fence_mode' => $fence_mode, + 'network_gateway_cidr' => $network_gateway_cidr, + 'shared' => $shared, + 'ip_ranges_attributes' => array( + 'start_address' => $start_address, + 'end_address' => $end_address, + ), + ), + ) + ); + $this->sendPost( ONAPP_GETRESOURCE_DEFAULT, $data ); + } + +} diff --git a/Payment.php b/Payment.php index 05fba243..517340ca 100644 --- a/Payment.php +++ b/Payment.php @@ -123,6 +123,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Profile.php b/Profile.php index 6da10e95..afe2242f 100644 --- a/Profile.php +++ b/Profile.php @@ -284,6 +284,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['cdn_reference'] = array( + ONAPP_FIELD_MAP => '_cdn_reference', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Recipe.php b/Recipe.php index 9064bb0f..568836f0 100644 --- a/Recipe.php +++ b/Recipe.php @@ -118,6 +118,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Recipe/Step.php b/Recipe/Step.php index 4bc892c8..f242a7ed 100644 --- a/Recipe/Step.php +++ b/Recipe/Step.php @@ -136,6 +136,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/RecipeGroup.php b/RecipeGroup.php index cbab9c65..fdfcedf7 100644 --- a/RecipeGroup.php +++ b/RecipeGroup.php @@ -115,6 +115,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/RecipeGroup/Recipe.php b/RecipeGroup/Recipe.php index 063b0629..904c6a15 100644 --- a/RecipeGroup/Recipe.php +++ b/RecipeGroup/Recipe.php @@ -111,6 +111,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ResourceLimit.php b/ResourceLimit.php index 5913767e..6eb023c0 100644 --- a/ResourceLimit.php +++ b/ResourceLimit.php @@ -163,6 +163,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Restriction.php b/Restriction.php index 18ee9eaf..7807b3d2 100644 --- a/Restriction.php +++ b/Restriction.php @@ -110,6 +110,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Role.php b/Role.php index be6edf4d..b80d3d66 100644 --- a/Role.php +++ b/Role.php @@ -141,6 +141,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['system'] = array( + ONAPP_FIELD_MAP => '_system', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Role/Permission.php b/Role/Permission.php index 84150a62..b5c0fa17 100644 --- a/Role/Permission.php +++ b/Role/Permission.php @@ -98,6 +98,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/SSH.php b/SSH.php index 31f34a8b..c8234ec5 100644 --- a/SSH.php +++ b/SSH.php @@ -93,6 +93,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Schedule.php b/Schedule.php index b705009a..31fbfb5b 100644 --- a/Schedule.php +++ b/Schedule.php @@ -151,6 +151,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Schedule/Log.php b/Schedule/Log.php index 1ae1c65a..7e0331bb 100644 --- a/Schedule/Log.php +++ b/Schedule/Log.php @@ -97,6 +97,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/ServiceAddon.php b/ServiceAddon.php index a6ccf0b2..2aa36ab9 100644 --- a/ServiceAddon.php +++ b/ServiceAddon.php @@ -82,6 +82,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/ServiceAddon/Event.php b/ServiceAddon/Event.php index d3c8c5e1..63fc923d 100644 --- a/ServiceAddon/Event.php +++ b/ServiceAddon/Event.php @@ -78,6 +78,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Settings.php b/Settings.php index 6cb6a10e..03bf2458 100644 --- a/Settings.php +++ b/Settings.php @@ -800,6 +800,49 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'integer', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['block_size'] = array( + ONAPP_FIELD_MAP => '_block_size', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['migration_rate_limit'] = array( + ONAPP_FIELD_MAP => '_migration_rate_limit', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['simultaneous_migrations_per_hypervisor'] = array( + ONAPP_FIELD_MAP => '_simultaneous_migrations_per_hypervisor', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['snmp_stats_level1_period'] = array( + ONAPP_FIELD_MAP => '_snmp_stats_level1_period', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['snmp_stats_level2_period'] = array( + ONAPP_FIELD_MAP => '_snmp_stats_level2_period', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['snmp_stats_level3_period'] = array( + ONAPP_FIELD_MAP => '_snmp_stats_level3_period', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['io_limiting_enabled'] = array( + ONAPP_FIELD_MAP => '_io_limiting_enabled', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['localdomain'] = array( + ONAPP_FIELD_MAP => '_localdomain', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['number_of_notifications_to_show'] = array( + ONAPP_FIELD_MAP => '_number_of_notifications_to_show', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['wizard_resource_reservation_ttl'] = array( + ONAPP_FIELD_MAP => '_wizard_resource_reservation_ttl', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/SmartServer.php b/SmartServer.php new file mode 100644 index 00000000..4e7d84bb --- /dev/null +++ b/SmartServer.php @@ -0,0 +1,33 @@ +fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Statistics.php b/Statistics.php index 29be85d5..e3c449d2 100644 --- a/Statistics.php +++ b/Statistics.php @@ -97,6 +97,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'array', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/StorageServer.php b/StorageServer.php index b5f19bd1..716da811 100644 --- a/StorageServer.php +++ b/StorageServer.php @@ -215,6 +215,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Template.php b/Template.php index 91a4cd55..aa33be7b 100644 --- a/Template.php +++ b/Template.php @@ -296,6 +296,13 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'boolean', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Template/Recipe.php b/Template/Recipe.php index b0f5c9eb..fa68f3f5 100644 --- a/Template/Recipe.php +++ b/Template/Recipe.php @@ -119,6 +119,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/TemplateOVA.php b/TemplateOVA.php index 9e7f9b07..ec271e8f 100644 --- a/TemplateOVA.php +++ b/TemplateOVA.php @@ -237,6 +237,13 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'boolean', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/TemplateStore.php b/TemplateStore.php index 12fc48f8..95073080 100644 --- a/TemplateStore.php +++ b/TemplateStore.php @@ -155,6 +155,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/TopIOPSDisk.php b/TopIOPSDisk.php index a2ba9a9c..50cf2521 100644 --- a/TopIOPSDisk.php +++ b/TopIOPSDisk.php @@ -92,6 +92,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } diff --git a/Transaction.php b/Transaction.php index 894a3bc5..3d8421fe 100644 --- a/Transaction.php +++ b/Transaction.php @@ -198,6 +198,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['chain_id'] = array( + ONAPP_FIELD_MAP => '_chain_id', + ONAPP_FIELD_TYPE => 'string' + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/UsageStatistic.php b/UsageStatistic.php index 88c19797..a4c6efb8 100644 --- a/UsageStatistic.php +++ b/UsageStatistic.php @@ -227,6 +227,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User.php b/User.php index 8e5d0717..a739070a 100644 --- a/User.php +++ b/User.php @@ -397,6 +397,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/BillingStatistics.php b/User/BillingStatistics.php index c8fa971c..590eed85 100644 --- a/User/BillingStatistics.php +++ b/User/BillingStatistics.php @@ -144,6 +144,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/LastAccessLog.php b/User/LastAccessLog.php index fec9855f..03e79e24 100644 --- a/User/LastAccessLog.php +++ b/User/LastAccessLog.php @@ -90,6 +90,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/Limit.php b/User/Limit.php index 390264b0..ba8fa189 100644 --- a/User/Limit.php +++ b/User/Limit.php @@ -150,6 +150,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/MonthlyBill.php b/User/MonthlyBill.php index cade5390..fe635ef2 100644 --- a/User/MonthlyBill.php +++ b/User/MonthlyBill.php @@ -89,6 +89,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/Payments.php b/User/Payments.php index 48416100..ceeb038e 100644 --- a/User/Payments.php +++ b/User/Payments.php @@ -107,6 +107,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/Statistics.php b/User/Statistics.php index 7de50df0..b9c7b1b9 100644 --- a/User/Statistics.php +++ b/User/Statistics.php @@ -221,6 +221,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/Statistics/VmStat.php b/User/Statistics/VmStat.php index 60a41635..9bdd9758 100644 --- a/User/Statistics/VmStat.php +++ b/User/Statistics/VmStat.php @@ -96,6 +96,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/UsedIpAddress.php b/User/UsedIpAddress.php index c0c0ebf4..f245d0cf 100644 --- a/User/UsedIpAddress.php +++ b/User/UsedIpAddress.php @@ -125,6 +125,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/WhiteList.php b/User/WhiteList.php index 5aee2e29..c6a37867 100644 --- a/User/WhiteList.php +++ b/User/WhiteList.php @@ -110,6 +110,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/User/YubiKey.php b/User/YubiKey.php index c52c9c1a..e353b59c 100644 --- a/User/YubiKey.php +++ b/User/YubiKey.php @@ -80,6 +80,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/UserAdditionalField.php b/UserAdditionalField.php index f68bb00b..8ec428db 100644 --- a/UserAdditionalField.php +++ b/UserAdditionalField.php @@ -97,6 +97,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; default: $this->logger->error( diff --git a/UserGroup.php b/UserGroup.php index 94e300e4..46735b12 100644 --- a/UserGroup.php +++ b/UserGroup.php @@ -155,6 +155,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS.php b/VDCS.php index 56997888..c58b24c1 100644 --- a/VDCS.php +++ b/VDCS.php @@ -172,6 +172,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/DataStore.php b/VDCS/DataStore.php index c72ec899..d7ce4099 100644 --- a/VDCS/DataStore.php +++ b/VDCS/DataStore.php @@ -82,6 +82,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/EdgeGateway.php b/VDCS/EdgeGateway.php index b950ac57..365d71a3 100644 --- a/VDCS/EdgeGateway.php +++ b/VDCS/EdgeGateway.php @@ -128,6 +128,13 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['advanced_enabled '] = array( + ONAPP_FIELD_MAP => '_advanced_enabled ', + ONAPP_FIELD_TYPE => 'boolean', + ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/EdgeGateway/FirewallRule/VCloudFirewallRule.php b/VDCS/EdgeGateway/FirewallRule/VCloudFirewallRule.php index 44d72aa4..b4e5a499 100644 --- a/VDCS/EdgeGateway/FirewallRule/VCloudFirewallRule.php +++ b/VDCS/EdgeGateway/FirewallRule/VCloudFirewallRule.php @@ -129,6 +129,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/EdgeGateway/FirewallService.php b/VDCS/EdgeGateway/FirewallService.php index 91978d2e..4b917373 100644 --- a/VDCS/EdgeGateway/FirewallService.php +++ b/VDCS/EdgeGateway/FirewallService.php @@ -151,6 +151,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/EdgeGateway/GatewayInterface.php b/VDCS/EdgeGateway/GatewayInterface.php index 9119546f..1741dbf2 100644 --- a/VDCS/EdgeGateway/GatewayInterface.php +++ b/VDCS/EdgeGateway/GatewayInterface.php @@ -87,6 +87,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VDCS/Statistics.php b/VDCS/Statistics.php index ec98fa47..ce9232ae 100644 --- a/VDCS/Statistics.php +++ b/VDCS/Statistics.php @@ -119,6 +119,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Vapp.php b/Vapp.php index b77c3339..b98f3028 100644 --- a/Vapp.php +++ b/Vapp.php @@ -148,6 +148,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/Vapp/VirtualMachineParam.php b/Vapp/VirtualMachineParam.php index 3d3bf3fd..e6466bdd 100644 --- a/Vapp/VirtualMachineParam.php +++ b/Vapp/VirtualMachineParam.php @@ -86,6 +86,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VappTemplateGroup.php b/VappTemplateGroup.php index 437d5bf5..2d33dc7c 100644 --- a/VappTemplateGroup.php +++ b/VappTemplateGroup.php @@ -92,6 +92,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine.php b/VirtualMachine.php index 22f2d767..fcf839a9 100644 --- a/VirtualMachine.php +++ b/VirtualMachine.php @@ -113,6 +113,12 @@ */ define( 'ONAPP_GETRESOURCE_MIGRATE', 'migrate' ); +/** + * + * + */ +define( 'ONAPP_GETRESOURCE_MIGRATION', 'migration' ); + /** * * @@ -680,6 +686,38 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_CLASS => 'VirtualMachine_CustomVariablesAttribute', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + $this->fields['domain'] = array( + ONAPP_FIELD_MAP => '_domain', + ONAPP_FIELD_TYPE => 'string', + ONAPP_FIELD_DEFAULT_VALUE => 'localdomain', + ); + $this->fields['user_group_id'] = array( + ONAPP_FIELD_MAP => '_user_group_id', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['vdc_id'] = array( + ONAPP_FIELD_MAP => '_vdc_id', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['data_store_id'] = array( + ONAPP_FIELD_MAP => '_data_store_id', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['network_id'] = array( + ONAPP_FIELD_MAP => '_network_id', + ONAPP_FIELD_TYPE => 'integer', + ); + $this->fields['openstack_id'] = array( + ONAPP_FIELD_MAP => '_openstack_id', + ONAPP_FIELD_TYPE => 'string', + ); + $this->fields['vcenter_reserved_memory'] = array( + ONAPP_FIELD_MAP => '_vcenter_reserved_memory', + ONAPP_FIELD_TYPE => 'string', + ); + break; } if ( is_null( $this->_id ) ) { @@ -861,6 +899,20 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { $resource = $this->getResource( ONAPP_GETRESOURCE_LOAD ) . '/migrate'; break; + case ONAPP_GETRESOURCE_MIGRATION: + + /** + * ROUTE : + * + * @name migrate_virtual_machine + * @method POST + * @alias /virtual_machines/:id/migration(.:format) + * @format {:controller=>"virtual_machines", :action=>"migration"} + */ + + $resource = $this->getResource( ONAPP_GETRESOURCE_LOAD ) . '/migration'; + break; + case ONAPP_GETRESOURCE_SUSPEND_VM: /** * ROUTE : @@ -1184,6 +1236,31 @@ function migrate( $id, $hypervisor_id ) { $this->sendPost( ONAPP_GETRESOURCE_MIGRATE, $data ); } + /** + * Migrates Virtual Machine to the other hypervisor + * + * @param int $id virtual machine id + * @param int $hypervisor_id destination hypervisor id + */ + function migration( $id, $hypervisor_id, $cold_migrate_on_rollback = false ) { + if ( $id ) { + $this->_id = $id; + } + + $data = array( + 'root' => 'tmp_holder', + 'data' => array( + 'destination' => $hypervisor_id, + //'cold_migrate_on_rollback' => true + ), + ); + if ( $cold_migrate_on_rollback ) { + $data['data']['cold_migrate_on_rollback'] = "1"; + } + + $this->sendPost( ONAPP_GETRESOURCE_MIGRATION, $data ); + } + /** * Change Virtual Machine Owner * diff --git a/VirtualMachine/Backup.php b/VirtualMachine/Backup.php index 635920c4..82d9db59 100644 --- a/VirtualMachine/Backup.php +++ b/VirtualMachine/Backup.php @@ -248,6 +248,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/BillingStatistics.php b/VirtualMachine/BillingStatistics.php index 32b20851..8fa31458 100644 --- a/VirtualMachine/BillingStatistics.php +++ b/VirtualMachine/BillingStatistics.php @@ -162,6 +162,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'array' ); + break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); break; } diff --git a/VirtualMachine/CpuUsage.php b/VirtualMachine/CpuUsage.php index 7ab4c713..4405f581 100644 --- a/VirtualMachine/CpuUsage.php +++ b/VirtualMachine/CpuUsage.php @@ -143,6 +143,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/CustomRecipeVariable.php b/VirtualMachine/CustomRecipeVariable.php index 6518eaa8..ebc7f038 100644 --- a/VirtualMachine/CustomRecipeVariable.php +++ b/VirtualMachine/CustomRecipeVariable.php @@ -110,6 +110,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/CustomVariablesAttribute.php b/VirtualMachine/CustomVariablesAttribute.php index f19c77ef..3419831e 100644 --- a/VirtualMachine/CustomVariablesAttribute.php +++ b/VirtualMachine/CustomVariablesAttribute.php @@ -78,6 +78,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/Disk.php b/VirtualMachine/Disk.php index b0038ae5..fe030e6d 100644 --- a/VirtualMachine/Disk.php +++ b/VirtualMachine/Disk.php @@ -201,6 +201,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/FirewallRule.php b/VirtualMachine/FirewallRule.php index 7634d140..b13d0351 100644 --- a/VirtualMachine/FirewallRule.php +++ b/VirtualMachine/FirewallRule.php @@ -158,6 +158,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/IpAddress.php b/VirtualMachine/IpAddress.php index 70fa2fd6..c761a163 100644 --- a/VirtualMachine/IpAddress.php +++ b/VirtualMachine/IpAddress.php @@ -25,13 +25,13 @@ */ define( 'ONAPP_GETRESOURCE_JOIN', 'ip_address_join' ); -class OnApp_VirtualMachine_IpAddress extends OnApp_IpAddress { +class OnApp_VirtualMachine_IpAddress extends OnApp { /** * root tag used in the API request * * @var string */ - var $_tagRoot = 'ip_address'; + var $_tagRoot = 'ip_address_join'; /** * alias processing the object data * @@ -48,60 +48,12 @@ class OnApp_VirtualMachine_IpAddress extends OnApp_IpAddress { * @return array */ public function initFields( $version = null, $className = '' ) { + switch ( $version ) { case '2.0': case '2.1': case 2.2: case 2.3: - $this->fields = array( - 'id' => array( - ONAPP_FIELD_MAP => '_id', - ONAPP_FIELD_TYPE => 'integer', - ONAPP_FIELD_READ_ONLY => true, - ), - 'created_at' => array( - ONAPP_FIELD_MAP => '_created_at', - ONAPP_FIELD_TYPE => 'datetime', - ONAPP_FIELD_READ_ONLY => true, - ), - 'updated_at' => array( - ONAPP_FIELD_MAP => '_updated_at', - ONAPP_FIELD_TYPE => 'datetime', - ONAPP_FIELD_READ_ONLY => true, - ), - 'address' => array( - ONAPP_FIELD_MAP => '_address', - ONAPP_FIELD_READ_ONLY => true, - ), - 'netmask' => array( - ONAPP_FIELD_MAP => '_netmask', - ONAPP_FIELD_READ_ONLY => true, - ), - 'broadcast' => array( - ONAPP_FIELD_MAP => '_broadcast', - ONAPP_FIELD_READ_ONLY => true, - ), - 'network_address' => array( - ONAPP_FIELD_MAP => '_network_address', - ONAPP_FIELD_READ_ONLY => true, - ), - 'gateway' => array( - ONAPP_FIELD_MAP => '_gateway', - ONAPP_FIELD_READ_ONLY => true, - ), - 'network_id' => array( - ONAPP_FIELD_MAP => '_network_id', - ONAPP_FIELD_TYPE => 'integer', - ONAPP_FIELD_READ_ONLY => true, - ), - 'free' => array( - ONAPP_FIELD_MAP => '_free', - ONAPP_FIELD_TYPE => 'boolean', - ONAPP_FIELD_READ_ONLY => true, - ), - ); - break; - case 3.0: case 3.1: case 3.2: @@ -111,44 +63,38 @@ public function initFields( $version = null, $className = '' ) { case 4.0: case 4.1: case 4.2: - $this->fields = $this->initFields( 2.3 ); - $this->fields['customer_network_id'] = array( - ONAPP_FIELD_MAP => '_customer_network_id', - ONAPP_FIELD_TYPE => 'boolean' + case 4.3: + case 5.0: + case 5.1: + case 5.2: + case 5.3: + case 5.4: + $this->fields = array(); + $this->fields['id'] = array( + ONAPP_FIELD_MAP => '_id', + ONAPP_FIELD_TYPE => 'integer', ); - $this->fields['disallowed_primary'] = array( - ONAPP_FIELD_MAP => '_disallowed_primary', - ONAPP_FIELD_TYPE => 'boolean' + $this->fields['created_at'] = array( + ONAPP_FIELD_MAP => '_created_at', + ONAPP_FIELD_TYPE => 'datetime', ); - $this->fields['hypervisor_id'] = array( - ONAPP_FIELD_MAP => '_hypervisor_id', - ONAPP_FIELD_TYPE => 'boolean' + $this->fields['updated_at'] = array( + ONAPP_FIELD_MAP => '_updated_at', + ONAPP_FIELD_TYPE => 'datetime', ); - $this->fields['ip_address_pool_id'] = array( - ONAPP_FIELD_MAP => '_ip_address_pool_id', - ONAPP_FIELD_TYPE => 'boolean' + $this->fields['ip_address_id'] = array( + ONAPP_FIELD_MAP => '_ip_address_id', + ONAPP_FIELD_TYPE => 'integer', ); - $this->fields['pxe'] = array( - ONAPP_FIELD_MAP => '_pxe', - ONAPP_FIELD_TYPE => 'boolean' + $this->fields['network_interface_id'] = array( + ONAPP_FIELD_MAP => '_network_interface_id', + ONAPP_FIELD_TYPE => 'integer', ); - $this->fields['user_id'] = array( - ONAPP_FIELD_MAP => '_user_id', - ONAPP_FIELD_TYPE => 'boolean' + $this->fields['ip_address'] = array( + ONAPP_FIELD_MAP => '_ip_address', + ONAPP_FIELD_CLASS => 'IpAddress', ); - break; - case 4.3: - case 5.0: - $this->fields = $this->initFields( 4.2 ); - break; - case 5.1: - $this->fields = $this->initFields( 5.0 ); - break; - case 5.2: - $this->fields = $this->initFields( 5.1 ); - break; - case 5.3: - $this->fields = $this->initFields( 5.2 ); + break; } @@ -167,6 +113,7 @@ public function initFields( $version = null, $className = '' ) { */ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { switch ( $action ) { + case ONAPP_GETRESOURCE_DEFAULT: case ONAPP_GETRESOURCE_JOIN: $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/' . $this->_resource; $this->logger->debug( 'getResource( ' . $action . ' ): return ' . $resource ); @@ -186,7 +133,7 @@ function getResource( $action = ONAPP_GETRESOURCE_DEFAULT ) { * @param integer $virtual_machine_id virtual machine id * @param integer $network_interface_id network interface id */ - function join( $ip_address_id = null, $virtual_machine_id = null, $network_interface_id = null ) { + function join( $ip_address_id = null, $virtual_machine_id = null, $network_interface_id = null, $used_ip = false ) { if ( $virtual_machine_id ) { $this->_virtual_machine_id = $virtual_machine_id; } @@ -204,24 +151,38 @@ function join( $ip_address_id = null, $virtual_machine_id = null, $network_inter 'ip_address_id' => $this->_id ) ); + if ( $used_ip ) { + $data['data']['used_ip'] = '1'; + } $this->sendPost( ONAPP_GETRESOURCE_JOIN, $data ); } /** - * Activates action performed with object + * Sends an API request to get the Objects. After requesting, + * unserializes the received response into the array of Objects * - * @param string $action_name the name of action + * @param integer $network_id Network ID * + * @return mixed an array of Object instances on success. Otherwise false * @access public */ - function activateCheck( $action_name ) { - switch ( $action_name ) { - case ONAPP_ACTIVATE_GETLIST: - case ONAPP_ACTIVATE_LOAD: - case ONAPP_ACTIVATE_SAVE: - exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' ); - break; + function getList( $virtual_machine_id = null, $url_args = null ) { + if ( $virtual_machine_id ) { + $this->_virtual_machine_id = $virtual_machine_id; } + + if ( ! $this->_virtual_machine_id ) { + $this->logger->error( + 'getList: argument _virtual_machine_id not set.', + __FILE__, + __LINE__ + ); + + return false; + } + + return parent::getList(); } + } diff --git a/VirtualMachine/IpAddressJoin.php b/VirtualMachine/IpAddressJoin.php index fb183992..b89ddaa4 100644 --- a/VirtualMachine/IpAddressJoin.php +++ b/VirtualMachine/IpAddressJoin.php @@ -126,6 +126,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/Log.php b/VirtualMachine/Log.php index 0209734e..8bb18aeb 100644 --- a/VirtualMachine/Log.php +++ b/VirtualMachine/Log.php @@ -106,6 +106,9 @@ public function initFields( $version = null, $className = '' ) { ONAPP_FIELD_TYPE => 'string', ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/NetworkInterface.php b/VirtualMachine/NetworkInterface.php index 086f8aa2..240bebd6 100644 --- a/VirtualMachine/NetworkInterface.php +++ b/VirtualMachine/NetworkInterface.php @@ -153,6 +153,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/NetworkInterface/Usage.php b/VirtualMachine/NetworkInterface/Usage.php index 119696b6..831c9462 100644 --- a/VirtualMachine/NetworkInterface/Usage.php +++ b/VirtualMachine/NetworkInterface/Usage.php @@ -122,6 +122,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/PublishingRule.php b/VirtualMachine/PublishingRule.php index 426617d1..e3647388 100644 --- a/VirtualMachine/PublishingRule.php +++ b/VirtualMachine/PublishingRule.php @@ -118,6 +118,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/Recipe.php b/VirtualMachine/Recipe.php index 7528f9ee..c244206d 100644 --- a/VirtualMachine/Recipe.php +++ b/VirtualMachine/Recipe.php @@ -120,6 +120,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/ServiceAddon.php b/VirtualMachine/ServiceAddon.php index fac0497b..90860c06 100644 --- a/VirtualMachine/ServiceAddon.php +++ b/VirtualMachine/ServiceAddon.php @@ -86,6 +86,9 @@ public function initFields( $version = null, $className = '' ) { ), ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/VirtualMachine/Snapshot.php b/VirtualMachine/Snapshot.php index 00acdb05..4eb98c0b 100644 --- a/VirtualMachine/Snapshot.php +++ b/VirtualMachine/Snapshot.php @@ -120,6 +120,9 @@ public function initFields( $version = null, $className = '' ) { case 5.3: $this->fields = $this->initFields( 5.2 ); break; + case 5.4: + $this->fields = $this->initFields( 5.3 ); + break; } parent::initFields( $version, __CLASS__ ); diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..d9adc7c4 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "OnApp/OnApp-PHP-Wrapper-External", + "description": "OnApp PHP Client Library", + "type": "library", + "keywords": ["onapp", "wrapper"], + "homepage": "https://github.com/OnApp/OnApp-PHP-Wrapper-External", + "license": { + "custom": "https://github.com/OnApp/OnApp-PHP-Wrapper-External/blob/5.4.0/LICENSE.md" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "ext-mbstring": "*" + } +} \ No newline at end of file diff --git a/version.txt b/version.txt index 03f488b0..8a30e8f9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -5.3.0 +5.4.0