本文整理汇总了PHP中OnApp::initFields方法的典型用法代码示例。如果您正苦于以下问题:PHP OnApp::initFields方法的具体用法?PHP OnApp::initFields怎么用?PHP OnApp::initFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OnApp
的用法示例。
在下文中一共展示了OnApp::initFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
case '2.2':
break;
case '2.3':
$this->fields = array('non_cached' => array(ONAPP_FIELD_MAP => '_non_cached', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'date' => array(ONAPP_FIELD_MAP => '_date', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'cached' => array(ONAPP_FIELD_MAP => '_cached', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true));
$this->fields = $this->initFields(2.1);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例2: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
$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), 'label' => array(ONAPP_FIELD_MAP => '_label', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true));
break;
case 2.1:
case 2.2:
case 2.3:
$this->fields = $this->initFields('2.0');
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例3: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.3':
$this->fields = array('city' => array(ONAPP_FIELD_MAP => '_city', ONAPP_FIELD_TYPE => 'string'), 'region' => array(ONAPP_FIELD_MAP => '_region', ONAPP_FIELD_TYPE => 'string'), 'price' => array(ONAPP_FIELD_MAP => '_price', ONAPP_FIELD_TYPE => 'float'), 'latitude' => array(ONAPP_FIELD_MAP => '_latitude', ONAPP_FIELD_TYPE => 'float'), 'country' => array(ONAPP_FIELD_MAP => '_country', ONAPP_FIELD_TYPE => 'string'), 'deleted' => array(ONAPP_FIELD_MAP => '_deleted', ONAPP_FIELD_TYPE => 'boolean'), 'id' => array(ONAPP_FIELD_MAP => '_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'geoblocking' => array(ONAPP_FIELD_MAP => '_geoblocking', ONAPP_FIELD_TYPE => 'boolean'), 'createdAt' => array(ONAPP_FIELD_MAP => '_createdAt', ONAPP_FIELD_TYPE => 'string'), 'updatedAt' => array(ONAPP_FIELD_MAP => '_updatedAt', ONAPP_FIELD_TYPE => 'integer'), 'description' => array(ONAPP_FIELD_MAP => '_description', ONAPP_FIELD_TYPE => 'string'), 'longitude' => array(ONAPP_FIELD_MAP => '_longitude', ONAPP_FIELD_TYPE => 'float'), 'status' => array(ONAPP_FIELD_MAP => '_status', ONAPP_FIELD_TYPE => 'string'), 'operator' => array(ONAPP_FIELD_MAP => '_operator', ONAPP_FIELD_TYPE => 'array', ONAPP_FIELD_CLASS => 'EdgeGroup_Location_Operator'));
break;
case 3.0:
$this->fields = $this->initFields(2.3);
break;
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(3.0);
$this->fields['geoBlocking'] = array(ONAPP_FIELD_MAP => 'geoBlocking', ONAPP_FIELD_TYPE => 'boolean');
$this->fields['onSaleStreamSupported'] = array(ONAPP_FIELD_MAP => 'onSaleStreamSupported', ONAPP_FIELD_TYPE => 'boolean');
$this->fields['onSaleHttpSupported'] = array(ONAPP_FIELD_MAP => 'onSaleHttpSupported', ONAPP_FIELD_TYPE => 'boolean');
$this->fields['streamSupported'] = array(ONAPP_FIELD_MAP => 'streamSupported', ONAPP_FIELD_TYPE => 'boolean');
$this->fields['httpSupported'] = array(ONAPP_FIELD_MAP => 'httpSupported', ONAPP_FIELD_TYPE => 'boolean');
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例4: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
$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), 'network_id' => array(ONAPP_FIELD_MAP => '_network_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true), 'hypervisor_id' => array(ONAPP_FIELD_MAP => '_hypervisor_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'interface' => array(ONAPP_FIELD_MAP => '_interface', ONAPP_FIELD_READ_ONLY => true, ONAPP_FIELD_REQUIRED => true));
break;
case '2.1':
$this->fields = $this->initFields('2.0');
$this->fields['target_join_id'] = array(ONAPP_FIELD_MAP => '_target_join_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true);
$this->fields['target_join_type'] = array(ONAPP_FIELD_MAP => '_target_join_type', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_REQUIRED => true);
break;
case 2.2:
case 2.3:
$this->fields = $this->initFields(2.1);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例5: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
$this->fields = array('price_on' => array(ONAPP_FIELD_MAP => '_price_on', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'price_off' => array(ONAPP_FIELD_MAP => '_price_off', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'price' => array(ONAPP_FIELD_MAP => '_price', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true));
break;
case 2.2:
case 2.3:
$this->fields = $this->initFields(2.1);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例6: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
case '2.2':
break;
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 => 'string', ONAPP_FIELD_READ_ONLY => true), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'data_cached' => array(ONAPP_FIELD_MAP => '_data_cached', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'data_non_cached' => array(ONAPP_FIELD_MAP => '_data_non_cached', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'cdn_resource_id' => array(ONAPP_FIELD_MAP => '_cdn_resource_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'user_id' => array(ONAPP_FIELD_MAP => '_user_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'edge_group_location_id' => array(ONAPP_FIELD_MAP => '_edge_group_location_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'edge_id' => array(ONAPP_FIELD_MAP => '_edge_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'location_id' => array(ONAPP_FIELD_MAP => '_location_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'edge_group_id' => array(ONAPP_FIELD_MAP => '_edge_group_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true));
$this->fields = $this->initFields(2.1);
break;
case 3.0:
case 3.1:
case 3.2:
$this->fields = $this->initFields(2.3);
$fields = array('created_at', 'updated_at', 'cdn_resource_id', 'user_id', 'edge_group_location_id', 'edge_id', 'location_id');
$this->unsetFields($fields);
$this->fields['cost'] = array(ONAPP_FIELD_MAP => '_cost', ONAPP_FIELD_TYPE => 'string');
$this->fields['edge_group_label'] = array(ONAPP_FIELD_MAP => '_edge_group_label', ONAPP_FIELD_TYPE => 'string');
$this->fields['stat_time'] = array(ONAPP_FIELD_MAP => '_stat_time', ONAPP_FIELD_TYPE => 'string');
$this->fields['value'] = array(ONAPP_FIELD_MAP => '_value', ONAPP_FIELD_TYPE => 'string');
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例7: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
$this->fields = array('id' => array(ONAPP_FIELD_MAP => '_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'cpu_shares' => array(ONAPP_FIELD_MAP => '_cpu_shares', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'cpus' => array(ONAPP_FIELD_MAP => '_cpus', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'created_at' => array(ONAPP_FIELD_MAP => '_created_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'disk_size' => array(ONAPP_FIELD_MAP => '_disk_size', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'memory' => array(ONAPP_FIELD_MAP => '_memory', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'user_id' => array(ONAPP_FIELD_MAP => '_user_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'storage_disk_size' => array(ONAPP_FIELD_MAP => '_storage_disk_size', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'virtual_machines_count' => array(ONAPP_FIELD_MAP => '_virtual_machines_count', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''));
break;
case 2.2:
case 2.3:
$this->fields = $this->initFields(2.1);
$this->fields['ip_address_count'] = array(ONAPP_FIELD_MAP => 'ip_address_count', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true);
$this->fields['ip_address_mask'] = array(ONAPP_FIELD_MAP => 'ip_address_mask', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true);
$this->fields['backups_templates_count'] = array(ONAPP_FIELD_MAP => 'backups_templates_count', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true);
$this->fields['rate'] = array(ONAPP_FIELD_MAP => 'rate', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true);
$fields = array('id');
$this->unsetFields($fields);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例8: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.1':
$this->fields = array('limit_free' => array(ONAPP_FIELD_MAP => '_limit_free', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'limit' => array(ONAPP_FIELD_MAP => '_limit', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true));
break;
case 2.2:
case 2.3:
case 3.0:
$this->fields = $this->initFields(2.1);
break;
case 3.1:
case 3.2:
$this->fields = $this->initFields(2.3);
$this->fields['id'] = array(ONAPP_FIELD_MAP => '_id');
$this->fields['billing_plan_id'] = array(ONAPP_FIELD_MAP => 'billing_plan_id');
$this->fields['limit_free_cpu'] = array(ONAPP_FIELD_MAP => 'limit_free_cpu');
$this->fields['limit_free_cpu_share'] = array(ONAPP_FIELD_MAP => 'limit_free_cpu_share');
$this->fields['limit_free_memory'] = array(ONAPP_FIELD_MAP => 'limit_free_memory');
$this->fields['limit_cpu'] = array(ONAPP_FIELD_MAP => 'limit_cpu');
$this->fields['limit_cpu_share'] = array(ONAPP_FIELD_MAP => 'limit_cpu_share');
$this->fields['limit_memory'] = array(ONAPP_FIELD_MAP => 'limit_memory');
$this->fields['limit_default_cpu'] = array(ONAPP_FIELD_MAP => 'limit_default_cpu');
$this->fields['limit_default_cpu_share'] = array(ONAPP_FIELD_MAP => 'limit_default_cpu_share');
$this->fields['limit_rate'] = array(ONAPP_FIELD_MAP => 'limit_rate');
$this->fields['limit_ip'] = array(ONAPP_FIELD_MAP => 'limit_ip');
$this->fields['limit'] = array(ONAPP_FIELD_MAP => 'limit');
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例9: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
case 2.2:
$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), 'identifier' => array(ONAPP_FIELD_MAP => '_identifier', ONAPP_FIELD_TYPE => 'string'), 'permissions' => array(ONAPP_FIELD_MAP => '_permissions', ONAPP_FIELD_TYPE => 'array', ONAPP_FIELD_CLASS => 'Role_Permission'), 'label' => array(ONAPP_FIELD_MAP => '_label', ONAPP_FIELD_REQUIRED => true), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'permission_ids' => array(ONAPP_FIELD_MAP => '_permission_ids', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true));
break;
case 2.3:
$this->fields = $this->initFields(2.2);
$fields = array('permission_ids');
$this->unsetFields($fields);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例10: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
break;
case 2.2:
case 2.3:
$this->fields = array('price' => array(ONAPP_FIELD_MAP => '_price', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'city' => array(ONAPP_FIELD_MAP => '_city', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'created_at' => array(ONAPP_FIELD_MAP => '_created_at', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'country' => array(ONAPP_FIELD_MAP => '_country', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'aflexi_location_id' => array(ONAPP_FIELD_MAP => '_aflexi_location_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'id' => array(ONAPP_FIELD_MAP => '_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'operator' => array(ONAPP_FIELD_MAP => '_operator', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true), 'edge_group_id' => array(ONAPP_FIELD_MAP => '_edge_group_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true));
$this->fields = $this->initFields(2.1);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
$this->fields['streamSupported'] = array(ONAPP_FIELD_MAP => '_streamSupported', ONAPP_FIELD_TYPE => 'boolean');
$this->fields['httpSupported'] = array(ONAPP_FIELD_MAP => '_httpSupported', ONAPP_FIELD_TYPE => 'boolean');
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例11: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
case '2.2':
case '2.3':
case '3.0':
$this->fields = array('created_at' => array(ONAPP_FIELD_MAP => '_created_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'cost' => array(ONAPP_FIELD_MAP => '_cost', ONAPP_FIELD_TYPE => 'float', ONAPP_FIELD_READ_ONLY => true), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'stat_time' => array(ONAPP_FIELD_MAP => '_stat_time', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'id' => array(ONAPP_FIELD_MAP => '_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'user_id' => array(ONAPP_FIELD_MAP => '_user_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'vm_billing_stat_id' => array(ONAPP_FIELD_MAP => '_vm_billing_stat_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'virtual_machine_id' => array(ONAPP_FIELD_MAP => '_virtual_machine_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'billing_stats' => array(ONAPP_FIELD_MAP => '_billing_stats', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true));
break;
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(3.0);
unset($this->fields['cost']);
unset($this->fields['billing_stats']);
$this->fields['currency_code'] = array(ONAPP_FIELD_MAP => '_currency_code', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true);
$this->fields['total_cost'] = array(ONAPP_FIELD_MAP => '_total_cost', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true);
$this->fields['vm_resources_cost'] = array(ONAPP_FIELD_MAP => '_vm_resources_cost', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true);
$this->fields['usage_cost'] = array(ONAPP_FIELD_MAP => '_usage_cost', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例12: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
$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), 'identifier' => array(ONAPP_FIELD_MAP => '_identifier', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'label' => array(ONAPP_FIELD_MAP => '_label', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => ''), 'price_cpu' => array(ONAPP_FIELD_MAP => '_price_cpu', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_cpu_share' => array(ONAPP_FIELD_MAP => '_price_cpu_share', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_disk_size' => array(ONAPP_FIELD_MAP => '_price_disk_size', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_memory' => array(ONAPP_FIELD_MAP => '_price_memory', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'price_ip_address' => array(ONAPP_FIELD_MAP => '_price_ip_address', ONAPP_FIELD_REQUIRED => 'true'), 'price_storage_disk_size' => array(ONAPP_FIELD_MAP => '_price_storage_disk_size', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_cpu_power_off' => array(ONAPP_FIELD_MAP => '_price_cpu_power_off', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_memory_power_off' => array(ONAPP_FIELD_MAP => '_price_memory_power_off', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_disk_size_power_off' => array(ONAPP_FIELD_MAP => '_price_disk_size_power_off', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_cpu_share_power_off' => array(ONAPP_FIELD_MAP => '_price_cpu_share_power_off', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'), 'price_ip_address_power_off' => array(ONAPP_FIELD_MAP => '_price_ip_address_power_off', ONAPP_FIELD_TYPE => 'decimal', ONAPP_FIELD_REQUIRED => 'true', ONAPP_FIELD_DEFAULT_VALUE => '0.0'));
break;
case '2.1':
$this->fields = array();
break;
case 2.2:
case 2.3:
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.1);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例13: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
case 2.2:
$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_REQUIRED => true), 'netmask' => array(ONAPP_FIELD_MAP => '_netmask', ONAPP_FIELD_REQUIRED => true), 'broadcast' => array(ONAPP_FIELD_MAP => '_broadcast', ONAPP_FIELD_REQUIRED => true), 'network_address' => array(ONAPP_FIELD_MAP => '_network_address', ONAPP_FIELD_REQUIRED => true), 'gateway' => array(ONAPP_FIELD_MAP => '_gateway', ONAPP_FIELD_REQUIRED => 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), 'disallowed_primary' => array(ONAPP_FIELD_MAP => '_disallowed_primary', ONAPP_FIELD_TYPE => 'boolean', ONAPP_FIELD_READ_ONLY => true));
break;
case 2.3:
$this->fields = $this->initFields(2.2);
$this->fields['user_id'] = array(ONAPP_FIELD_MAP => 'user_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例14: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
case '2.1':
$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), 'network_interface_id' => array(ONAPP_FIELD_MAP => '_network_interface_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true), 'ip_address_id' => array(ONAPP_FIELD_MAP => '_ip_address_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true), 'ip_address' => array(ONAPP_FIELD_MAP => '_ip_address', ONAPP_FIELD_READ_ONLY => true, ONAPP_FIELD_CLASS => 'VirtualMachine_IpAddress'));
break;
case 2.2:
$this->fields = $this->initFields(2.1);
$this->fields['virtual_machine_id'] = array(ONAPP_FIELD_MAP => 'virtual_machine_id', ONAPP_FIELD_TYPE => 'integer');
break;
case 2.3:
$this->fields = $this->initFields(2.2);
$fields = array('virtual_machine_id');
$this->unsetFields($fields);
break;
case 3.0:
case 3.1:
case 3.2:
case 3.3:
case 3.4:
case 3.5:
case 4.0:
case 4.1:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}
示例15: initFields
/**
* API Fields description
*
* @param string|float $version OnApp API version
* @param string $className current class' name
*
* @return array
*/
public function initFields($version = null, $className = '')
{
switch ($version) {
case '2.0':
$this->fields = array('id' => array(ONAPP_FIELD_MAP => '_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'action' => array(ONAPP_FIELD_MAP => '_action', ONAPP_FIELD_DEFAULT_VALUE => '', ONAPP_FIELD_READ_ONLY => true), 'actor' => array(ONAPP_FIELD_MAP => '_actor', ONAPP_FIELD_READ_ONLY => true), 'created_at' => array(ONAPP_FIELD_MAP => '_created_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'dependent_transaction_id' => array(ONAPP_FIELD_MAP => '_dependent_transaction_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'log_output' => array(ONAPP_FIELD_MAP => '_log_output', ONAPP_FIELD_READ_ONLY => true), 'params' => array(ONAPP_FIELD_MAP => '_params', ONAPP_FIELD_TYPE => 'yaml', ONAPP_FIELD_READ_ONLY => true), 'parent_id' => array(ONAPP_FIELD_MAP => '_parent_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'parent_type' => array(ONAPP_FIELD_MAP => '_parent_type', ONAPP_FIELD_READ_ONLY => true), 'pid' => array(ONAPP_FIELD_MAP => '_pid', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'priority' => array(ONAPP_FIELD_MAP => '_priority', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true), 'status' => array(ONAPP_FIELD_MAP => '_status', ONAPP_FIELD_READ_ONLY => true), 'updated_at' => array(ONAPP_FIELD_MAP => '_updated_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true), 'user_id' => array(ONAPP_FIELD_MAP => '_user_id', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_READ_ONLY => true));
break;
case '2.1':
$this->fields = $this->initFields('2.0');
$this->fields['allowed_cancel'] = array(ONAPP_FIELD_MAP => '_allowed_cancel', ONAPP_FIELD_TYPE => 'boolean', ONAPP_FIELD_READ_ONLY => true);
$this->fields['identifier'] = array(ONAPP_FIELD_MAP => '_identifier', ONAPP_FIELD_TYPE => 'string', ONAPP_FIELD_READ_ONLY => true);
$this->fields['start_after'] = array(ONAPP_FIELD_MAP => '_start_after', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true);
break;
case 2.2:
$this->fields = $this->initFields(2.1);
$this->fields['started_at'] = array(ONAPP_FIELD_MAP => 'started_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true);
$this->fields['finished_at'] = array(ONAPP_FIELD_MAP => 'finished_at', ONAPP_FIELD_TYPE => 'datetime', ONAPP_FIELD_READ_ONLY => true);
break;
case 2.3:
$this->fields = $this->initFields(2.2);
$fields = array('finished_at');
$this->unsetFields($fields);
break;
case 3.0:
case 3.1:
case 3.2:
$this->fields = $this->initFields(2.3);
break;
}
parent::initFields($version, __CLASS__);
return $this->fields;
}