ionoscloud 5.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/DOCS.md +14618 -0
- data/Gemfile +9 -0
- data/README.md +55 -0
- data/Rakefile +10 -0
- data/git_push.sh +58 -0
- data/ionoscloud.gemspec +38 -0
- data/lib/ionoscloud.rb +181 -0
- data/lib/ionoscloud/api/_api.rb +96 -0
- data/lib/ionoscloud/api/backup_unit_api.rb +583 -0
- data/lib/ionoscloud/api/contract_api.rb +96 -0
- data/lib/ionoscloud/api/data_center_api.rb +532 -0
- data/lib/ionoscloud/api/image_api.rb +432 -0
- data/lib/ionoscloud/api/ip_blocks_api.rb +514 -0
- data/lib/ionoscloud/api/kubernetes_api.rb +1479 -0
- data/lib/ionoscloud/api/label_api.rb +2460 -0
- data/lib/ionoscloud/api/lan_api.rb +858 -0
- data/lib/ionoscloud/api/load_balancer_api.rb +950 -0
- data/lib/ionoscloud/api/location_api.rb +262 -0
- data/lib/ionoscloud/api/nic_api.rb +1222 -0
- data/lib/ionoscloud/api/private_cross_connect_api.rb +426 -0
- data/lib/ionoscloud/api/request_api.rb +283 -0
- data/lib/ionoscloud/api/server_api.rb +1679 -0
- data/lib/ionoscloud/api/snapshot_api.rb +432 -0
- data/lib/ionoscloud/api/user_management_api.rb +2495 -0
- data/lib/ionoscloud/api/volume_api.rb +763 -0
- data/lib/ionoscloud/api_client.rb +521 -0
- data/lib/ionoscloud/api_error.rb +57 -0
- data/lib/ionoscloud/configuration.rb +291 -0
- data/lib/ionoscloud/models/attached_volumes.rb +278 -0
- data/lib/ionoscloud/models/backup_unit.rb +294 -0
- data/lib/ionoscloud/models/backup_unit_properties.rb +242 -0
- data/lib/ionoscloud/models/backup_unit_sso.rb +217 -0
- data/lib/ionoscloud/models/backup_units.rb +283 -0
- data/lib/ionoscloud/models/balanced_nics.rb +278 -0
- data/lib/ionoscloud/models/cdroms.rb +278 -0
- data/lib/ionoscloud/models/connectable_datacenter.rb +234 -0
- data/lib/ionoscloud/models/contract.rb +231 -0
- data/lib/ionoscloud/models/contract_properties.rb +256 -0
- data/lib/ionoscloud/models/data_center_entities.rb +243 -0
- data/lib/ionoscloud/models/datacenter.rb +269 -0
- data/lib/ionoscloud/models/datacenter_element_metadata.rb +321 -0
- data/lib/ionoscloud/models/datacenter_properties.rb +296 -0
- data/lib/ionoscloud/models/datacenters.rb +278 -0
- data/lib/ionoscloud/models/error.rb +228 -0
- data/lib/ionoscloud/models/error_message.rb +227 -0
- data/lib/ionoscloud/models/firewall_rule.rb +260 -0
- data/lib/ionoscloud/models/firewall_rules.rb +278 -0
- data/lib/ionoscloud/models/firewallrule_properties.rb +468 -0
- data/lib/ionoscloud/models/group.rb +260 -0
- data/lib/ionoscloud/models/group_entities.rb +225 -0
- data/lib/ionoscloud/models/group_members.rb +249 -0
- data/lib/ionoscloud/models/group_properties.rb +307 -0
- data/lib/ionoscloud/models/group_share.rb +251 -0
- data/lib/ionoscloud/models/group_share_properties.rb +227 -0
- data/lib/ionoscloud/models/group_shares.rb +249 -0
- data/lib/ionoscloud/models/group_users.rb +250 -0
- data/lib/ionoscloud/models/groups.rb +249 -0
- data/lib/ionoscloud/models/image.rb +260 -0
- data/lib/ionoscloud/models/image_properties.rb +428 -0
- data/lib/ionoscloud/models/images.rb +249 -0
- data/lib/ionoscloud/models/info.rb +237 -0
- data/lib/ionoscloud/models/ip_block.rb +260 -0
- data/lib/ionoscloud/models/ip_block_properties.rb +271 -0
- data/lib/ionoscloud/models/ip_blocks.rb +249 -0
- data/lib/ionoscloud/models/ip_consumer.rb +270 -0
- data/lib/ionoscloud/models/ip_failover.rb +225 -0
- data/lib/ionoscloud/models/kubernetes_auto_scaling.rb +227 -0
- data/lib/ionoscloud/models/kubernetes_cluster.rb +303 -0
- data/lib/ionoscloud/models/kubernetes_cluster_entities.rb +216 -0
- data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +265 -0
- data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post_and_put.rb +241 -0
- data/lib/ionoscloud/models/kubernetes_clusters.rb +283 -0
- data/lib/ionoscloud/models/kubernetes_config.rb +285 -0
- data/lib/ionoscloud/models/kubernetes_config_properties.rb +217 -0
- data/lib/ionoscloud/models/kubernetes_maintenance_window.rb +261 -0
- data/lib/ionoscloud/models/kubernetes_node.rb +294 -0
- data/lib/ionoscloud/models/kubernetes_node_metadata.rb +291 -0
- data/lib/ionoscloud/models/kubernetes_node_pool.rb +294 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_for_put.rb +294 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_lan.rb +217 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +476 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +464 -0
- data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +464 -0
- data/lib/ionoscloud/models/kubernetes_node_pools.rb +283 -0
- data/lib/ionoscloud/models/kubernetes_node_properties.rb +252 -0
- data/lib/ionoscloud/models/kubernetes_nodes.rb +283 -0
- data/lib/ionoscloud/models/label.rb +294 -0
- data/lib/ionoscloud/models/label_properties.rb +257 -0
- data/lib/ionoscloud/models/label_resource.rb +294 -0
- data/lib/ionoscloud/models/label_resource_properties.rb +227 -0
- data/lib/ionoscloud/models/label_resources.rb +312 -0
- data/lib/ionoscloud/models/labels.rb +283 -0
- data/lib/ionoscloud/models/lan.rb +269 -0
- data/lib/ionoscloud/models/lan_entities.rb +216 -0
- data/lib/ionoscloud/models/lan_nics.rb +278 -0
- data/lib/ionoscloud/models/lan_post.rb +269 -0
- data/lib/ionoscloud/models/lan_properties.rb +249 -0
- data/lib/ionoscloud/models/lan_properties_post.rb +249 -0
- data/lib/ionoscloud/models/lans.rb +278 -0
- data/lib/ionoscloud/models/loadbalancer.rb +269 -0
- data/lib/ionoscloud/models/loadbalancer_entities.rb +216 -0
- data/lib/ionoscloud/models/loadbalancer_properties.rb +271 -0
- data/lib/ionoscloud/models/loadbalancers.rb +278 -0
- data/lib/ionoscloud/models/location.rb +260 -0
- data/lib/ionoscloud/models/location_properties.rb +263 -0
- data/lib/ionoscloud/models/locations.rb +249 -0
- data/lib/ionoscloud/models/nic.rb +269 -0
- data/lib/ionoscloud/models/nic_entities.rb +216 -0
- data/lib/ionoscloud/models/nic_properties.rb +284 -0
- data/lib/ionoscloud/models/nics.rb +278 -0
- data/lib/ionoscloud/models/no_state_meta_data.rb +277 -0
- data/lib/ionoscloud/models/pagination_links.rb +237 -0
- data/lib/ionoscloud/models/peer.rb +252 -0
- data/lib/ionoscloud/models/private_cross_connect.rb +260 -0
- data/lib/ionoscloud/models/private_cross_connect_properties.rb +251 -0
- data/lib/ionoscloud/models/private_cross_connects.rb +249 -0
- data/lib/ionoscloud/models/request.rb +260 -0
- data/lib/ionoscloud/models/request_metadata.rb +246 -0
- data/lib/ionoscloud/models/request_properties.rb +245 -0
- data/lib/ionoscloud/models/request_status.rb +246 -0
- data/lib/ionoscloud/models/request_status_metadata.rb +280 -0
- data/lib/ionoscloud/models/request_target.rb +259 -0
- data/lib/ionoscloud/models/requests.rb +293 -0
- data/lib/ionoscloud/models/resource.rb +265 -0
- data/lib/ionoscloud/models/resource_entities.rb +216 -0
- data/lib/ionoscloud/models/resource_groups.rb +250 -0
- data/lib/ionoscloud/models/resource_limits.rb +462 -0
- data/lib/ionoscloud/models/resource_properties.rb +227 -0
- data/lib/ionoscloud/models/resource_reference.rb +242 -0
- data/lib/ionoscloud/models/resources.rb +250 -0
- data/lib/ionoscloud/models/resources_users.rb +250 -0
- data/lib/ionoscloud/models/s3_key.rb +260 -0
- data/lib/ionoscloud/models/s3_key_metadata.rb +227 -0
- data/lib/ionoscloud/models/s3_key_properties.rb +227 -0
- data/lib/ionoscloud/models/s3_keys.rb +249 -0
- data/lib/ionoscloud/models/s3_object_storage_sso.rb +217 -0
- data/lib/ionoscloud/models/server.rb +269 -0
- data/lib/ionoscloud/models/server_entities.rb +234 -0
- data/lib/ionoscloud/models/server_properties.rb +341 -0
- data/lib/ionoscloud/models/servers.rb +278 -0
- data/lib/ionoscloud/models/snapshot.rb +260 -0
- data/lib/ionoscloud/models/snapshot_properties.rb +401 -0
- data/lib/ionoscloud/models/snapshots.rb +249 -0
- data/lib/ionoscloud/models/type.rb +59 -0
- data/lib/ionoscloud/models/user.rb +269 -0
- data/lib/ionoscloud/models/user_metadata.rb +237 -0
- data/lib/ionoscloud/models/user_properties.rb +297 -0
- data/lib/ionoscloud/models/users.rb +249 -0
- data/lib/ionoscloud/models/users_entities.rb +225 -0
- data/lib/ionoscloud/models/volume.rb +260 -0
- data/lib/ionoscloud/models/volume_properties.rb +463 -0
- data/lib/ionoscloud/models/volumes.rb +278 -0
- data/lib/ionoscloud/version.rb +15 -0
- data/spec/api/_api_spec.rb +49 -0
- data/spec/api/backup_unit_api_spec.rb +140 -0
- data/spec/api/contract_api_spec.rb +49 -0
- data/spec/api/data_center_api_spec.rb +128 -0
- data/spec/api/image_api_spec.rb +111 -0
- data/spec/api/ip_blocks_api_spec.rb +126 -0
- data/spec/api/kubernetes_api_spec.rb +306 -0
- data/spec/api/label_api_spec.rb +480 -0
- data/spec/api/lan_api_spec.rb +186 -0
- data/spec/api/load_balancer_api_spec.rb +203 -0
- data/spec/api/location_api_spec.rb +80 -0
- data/spec/api/nic_api_spec.rb +251 -0
- data/spec/api/private_cross_connect_api_spec.rb +110 -0
- data/spec/api/request_api_spec.rb +84 -0
- data/spec/api/server_api_spec.rb +337 -0
- data/spec/api/snapshot_api_spec.rb +111 -0
- data/spec/api/user_management_api_spec.rb +495 -0
- data/spec/api/volume_api_spec.rb +171 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/attached_volumes_spec.rb +70 -0
- data/spec/models/backup_unit_properties_spec.rb +46 -0
- data/spec/models/backup_unit_spec.rb +62 -0
- data/spec/models/backup_unit_sso_spec.rb +34 -0
- data/spec/models/backup_units_spec.rb +56 -0
- data/spec/models/balanced_nics_spec.rb +70 -0
- data/spec/models/cdroms_spec.rb +70 -0
- data/spec/models/connectable_datacenter_spec.rb +46 -0
- data/spec/models/contract_properties_spec.rb +58 -0
- data/spec/models/contract_spec.rb +40 -0
- data/spec/models/data_center_entities_spec.rb +52 -0
- data/spec/models/datacenter_element_metadata_spec.rb +80 -0
- data/spec/models/datacenter_properties_spec.rb +68 -0
- data/spec/models/datacenter_spec.rb +64 -0
- data/spec/models/datacenters_spec.rb +70 -0
- data/spec/models/error_message_spec.rb +40 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/firewall_rule_spec.rb +58 -0
- data/spec/models/firewall_rules_spec.rb +70 -0
- data/spec/models/firewallrule_properties_spec.rb +98 -0
- data/spec/models/group_entities_spec.rb +40 -0
- data/spec/models/group_members_spec.rb +52 -0
- data/spec/models/group_properties_spec.rb +88 -0
- data/spec/models/group_share_properties_spec.rb +40 -0
- data/spec/models/group_share_spec.rb +52 -0
- data/spec/models/group_shares_spec.rb +52 -0
- data/spec/models/group_spec.rb +58 -0
- data/spec/models/group_users_spec.rb +52 -0
- data/spec/models/groups_spec.rb +52 -0
- data/spec/models/image_properties_spec.rb +138 -0
- data/spec/models/image_spec.rb +58 -0
- data/spec/models/images_spec.rb +52 -0
- data/spec/models/info_spec.rb +46 -0
- data/spec/models/ip_block_properties_spec.rb +58 -0
- data/spec/models/ip_block_spec.rb +58 -0
- data/spec/models/ip_blocks_spec.rb +52 -0
- data/spec/models/ip_consumer_spec.rb +70 -0
- data/spec/models/ip_failover_spec.rb +40 -0
- data/spec/models/kubernetes_auto_scaling_spec.rb +40 -0
- data/spec/models/kubernetes_cluster_entities_spec.rb +34 -0
- data/spec/models/kubernetes_cluster_properties_for_post_and_put_spec.rb +46 -0
- data/spec/models/kubernetes_cluster_properties_spec.rb +58 -0
- data/spec/models/kubernetes_cluster_spec.rb +68 -0
- data/spec/models/kubernetes_clusters_spec.rb +56 -0
- data/spec/models/kubernetes_config_properties_spec.rb +34 -0
- data/spec/models/kubernetes_config_spec.rb +56 -0
- data/spec/models/kubernetes_maintenance_window_spec.rb +44 -0
- data/spec/models/kubernetes_node_metadata_spec.rb +62 -0
- data/spec/models/kubernetes_node_pool_for_put_spec.rb +62 -0
- data/spec/models/kubernetes_node_pool_lan_spec.rb +34 -0
- data/spec/models/kubernetes_node_pool_properties_for_post_spec.rb +132 -0
- data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +132 -0
- data/spec/models/kubernetes_node_pool_properties_spec.rb +138 -0
- data/spec/models/kubernetes_node_pool_spec.rb +62 -0
- data/spec/models/kubernetes_node_pools_spec.rb +56 -0
- data/spec/models/kubernetes_node_properties_spec.rb +46 -0
- data/spec/models/kubernetes_node_spec.rb +62 -0
- data/spec/models/kubernetes_nodes_spec.rb +56 -0
- data/spec/models/label_properties_spec.rb +58 -0
- data/spec/models/label_resource_properties_spec.rb +40 -0
- data/spec/models/label_resource_spec.rb +62 -0
- data/spec/models/label_resources_spec.rb +74 -0
- data/spec/models/label_spec.rb +62 -0
- data/spec/models/labels_spec.rb +56 -0
- data/spec/models/lan_entities_spec.rb +34 -0
- data/spec/models/lan_nics_spec.rb +70 -0
- data/spec/models/lan_post_spec.rb +64 -0
- data/spec/models/lan_properties_post_spec.rb +52 -0
- data/spec/models/lan_properties_spec.rb +52 -0
- data/spec/models/lan_spec.rb +64 -0
- data/spec/models/lans_spec.rb +70 -0
- data/spec/models/loadbalancer_entities_spec.rb +34 -0
- data/spec/models/loadbalancer_properties_spec.rb +50 -0
- data/spec/models/loadbalancer_spec.rb +64 -0
- data/spec/models/loadbalancers_spec.rb +70 -0
- data/spec/models/location_properties_spec.rb +50 -0
- data/spec/models/location_spec.rb +58 -0
- data/spec/models/locations_spec.rb +52 -0
- data/spec/models/nic_entities_spec.rb +34 -0
- data/spec/models/nic_properties_spec.rb +70 -0
- data/spec/models/nic_spec.rb +64 -0
- data/spec/models/nics_spec.rb +70 -0
- data/spec/models/no_state_meta_data_spec.rb +70 -0
- data/spec/models/pagination_links_spec.rb +46 -0
- data/spec/models/peer_spec.rb +58 -0
- data/spec/models/private_cross_connect_properties_spec.rb +52 -0
- data/spec/models/private_cross_connect_spec.rb +58 -0
- data/spec/models/private_cross_connects_spec.rb +52 -0
- data/spec/models/request_metadata_spec.rb +52 -0
- data/spec/models/request_properties_spec.rb +52 -0
- data/spec/models/request_spec.rb +58 -0
- data/spec/models/request_status_metadata_spec.rb +56 -0
- data/spec/models/request_status_spec.rb +52 -0
- data/spec/models/request_target_spec.rb +44 -0
- data/spec/models/requests_spec.rb +70 -0
- data/spec/models/resource_entities_spec.rb +34 -0
- data/spec/models/resource_groups_spec.rb +52 -0
- data/spec/models/resource_limits_spec.rb +130 -0
- data/spec/models/resource_properties_spec.rb +40 -0
- data/spec/models/resource_reference_spec.rb +46 -0
- data/spec/models/resource_spec.rb +64 -0
- data/spec/models/resources_spec.rb +52 -0
- data/spec/models/resources_users_spec.rb +52 -0
- data/spec/models/s3_key_metadata_spec.rb +40 -0
- data/spec/models/s3_key_properties_spec.rb +40 -0
- data/spec/models/s3_key_spec.rb +58 -0
- data/spec/models/s3_keys_spec.rb +52 -0
- data/spec/models/s3_object_storage_sso_spec.rb +34 -0
- data/spec/models/server_entities_spec.rb +46 -0
- data/spec/models/server_properties_spec.rb +84 -0
- data/spec/models/server_spec.rb +64 -0
- data/spec/models/servers_spec.rb +70 -0
- data/spec/models/snapshot_properties_spec.rb +128 -0
- data/spec/models/snapshot_spec.rb +58 -0
- data/spec/models/snapshots_spec.rb +52 -0
- data/spec/models/type_spec.rb +28 -0
- data/spec/models/user_metadata_spec.rb +46 -0
- data/spec/models/user_properties_spec.rb +82 -0
- data/spec/models/user_spec.rb +64 -0
- data/spec/models/users_entities_spec.rb +40 -0
- data/spec/models/users_spec.rb +52 -0
- data/spec/models/volume_properties_spec.rb +152 -0
- data/spec/models/volume_spec.rb +58 -0
- data/spec/models/volumes_spec.rb +70 -0
- data/spec/spec_helper.rb +111 -0
- metadata +532 -0
@@ -0,0 +1,463 @@
|
|
1
|
+
=begin
|
2
|
+
#CLOUD API
|
3
|
+
|
4
|
+
#An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 5.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Ionoscloud
|
17
|
+
class VolumeProperties
|
18
|
+
# A name of that resource
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# Hardware type of the volume.
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
# The size of the volume in GB
|
25
|
+
attr_accessor :size
|
26
|
+
|
27
|
+
# The availability zone in which the volume should exist. The storage volume will be provisioned on as less physical storages as possible but cannot guarantee upfront
|
28
|
+
attr_accessor :availability_zone
|
29
|
+
|
30
|
+
# Image or snapshot ID to be used as template for this volume
|
31
|
+
attr_accessor :image
|
32
|
+
|
33
|
+
# Initial password to be set for installed OS. Works with public images only. Not modifiable, forbidden in update requests. Password rules allows all characters from a-z, A-Z, 0-9
|
34
|
+
attr_accessor :image_password
|
35
|
+
|
36
|
+
attr_accessor :image_alias
|
37
|
+
|
38
|
+
# Public SSH keys are set on the image as authorized keys for appropriate SSH login to the instance using the corresponding private key. This field may only be set in creation requests. When reading, it always returns null. SSH keys are only supported if a public Linux image is used for the volume creation.
|
39
|
+
attr_accessor :ssh_keys
|
40
|
+
|
41
|
+
# The bus type of the volume. Default is VIRTIO
|
42
|
+
attr_accessor :bus
|
43
|
+
|
44
|
+
# OS type of this volume
|
45
|
+
attr_accessor :licence_type
|
46
|
+
|
47
|
+
# Is capable of CPU hot plug (no reboot required)
|
48
|
+
attr_accessor :cpu_hot_plug
|
49
|
+
|
50
|
+
# Is capable of memory hot plug (no reboot required)
|
51
|
+
attr_accessor :ram_hot_plug
|
52
|
+
|
53
|
+
# Is capable of nic hot plug (no reboot required)
|
54
|
+
attr_accessor :nic_hot_plug
|
55
|
+
|
56
|
+
# Is capable of nic hot unplug (no reboot required)
|
57
|
+
attr_accessor :nic_hot_unplug
|
58
|
+
|
59
|
+
# Is capable of Virt-IO drive hot plug (no reboot required)
|
60
|
+
attr_accessor :disc_virtio_hot_plug
|
61
|
+
|
62
|
+
# Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
|
63
|
+
attr_accessor :disc_virtio_hot_unplug
|
64
|
+
|
65
|
+
# The LUN ID of the storage volume. Null for volumes not mounted to any VM
|
66
|
+
attr_accessor :device_number
|
67
|
+
|
68
|
+
# The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provied either public image or imageAlias in conjunction with this property.
|
69
|
+
attr_accessor :backupunit_id
|
70
|
+
|
71
|
+
class EnumAttributeValidator
|
72
|
+
attr_reader :datatype
|
73
|
+
attr_reader :allowable_values
|
74
|
+
|
75
|
+
def initialize(datatype, allowable_values)
|
76
|
+
@allowable_values = allowable_values.map do |value|
|
77
|
+
case datatype.to_s
|
78
|
+
when /Integer/i
|
79
|
+
value.to_i
|
80
|
+
when /Float/i
|
81
|
+
value.to_f
|
82
|
+
else
|
83
|
+
value
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def valid?(value)
|
89
|
+
!value || allowable_values.include?(value)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
94
|
+
def self.attribute_map
|
95
|
+
{
|
96
|
+
:'name' => :'name',
|
97
|
+
:'type' => :'type',
|
98
|
+
:'size' => :'size',
|
99
|
+
:'availability_zone' => :'availabilityZone',
|
100
|
+
:'image' => :'image',
|
101
|
+
:'image_password' => :'imagePassword',
|
102
|
+
:'image_alias' => :'imageAlias',
|
103
|
+
:'ssh_keys' => :'sshKeys',
|
104
|
+
:'bus' => :'bus',
|
105
|
+
:'licence_type' => :'licenceType',
|
106
|
+
:'cpu_hot_plug' => :'cpuHotPlug',
|
107
|
+
:'ram_hot_plug' => :'ramHotPlug',
|
108
|
+
:'nic_hot_plug' => :'nicHotPlug',
|
109
|
+
:'nic_hot_unplug' => :'nicHotUnplug',
|
110
|
+
:'disc_virtio_hot_plug' => :'discVirtioHotPlug',
|
111
|
+
:'disc_virtio_hot_unplug' => :'discVirtioHotUnplug',
|
112
|
+
:'device_number' => :'deviceNumber',
|
113
|
+
:'backupunit_id' => :'backupunitId'
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
# Returns all the JSON keys this model knows about
|
118
|
+
def self.acceptable_attributes
|
119
|
+
attribute_map.values
|
120
|
+
end
|
121
|
+
|
122
|
+
# Attribute type mapping.
|
123
|
+
def self.openapi_types
|
124
|
+
{
|
125
|
+
:'name' => :'String',
|
126
|
+
:'type' => :'String',
|
127
|
+
:'size' => :'Float',
|
128
|
+
:'availability_zone' => :'String',
|
129
|
+
:'image' => :'String',
|
130
|
+
:'image_password' => :'String',
|
131
|
+
:'image_alias' => :'String',
|
132
|
+
:'ssh_keys' => :'Array<String>',
|
133
|
+
:'bus' => :'String',
|
134
|
+
:'licence_type' => :'String',
|
135
|
+
:'cpu_hot_plug' => :'Boolean',
|
136
|
+
:'ram_hot_plug' => :'Boolean',
|
137
|
+
:'nic_hot_plug' => :'Boolean',
|
138
|
+
:'nic_hot_unplug' => :'Boolean',
|
139
|
+
:'disc_virtio_hot_plug' => :'Boolean',
|
140
|
+
:'disc_virtio_hot_unplug' => :'Boolean',
|
141
|
+
:'device_number' => :'Integer',
|
142
|
+
:'backupunit_id' => :'String'
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
146
|
+
# List of attributes with nullable: true
|
147
|
+
def self.openapi_nullable
|
148
|
+
Set.new([
|
149
|
+
])
|
150
|
+
end
|
151
|
+
|
152
|
+
# Initializes the object
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
def initialize(attributes = {})
|
155
|
+
if (!attributes.is_a?(Hash))
|
156
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::VolumeProperties` initialize method"
|
157
|
+
end
|
158
|
+
|
159
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
160
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
161
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
162
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::VolumeProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
163
|
+
end
|
164
|
+
h[k.to_sym] = v
|
165
|
+
}
|
166
|
+
|
167
|
+
if attributes.key?(:'name')
|
168
|
+
self.name = attributes[:'name']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'type')
|
172
|
+
self.type = attributes[:'type']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'size')
|
176
|
+
self.size = attributes[:'size']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'availability_zone')
|
180
|
+
self.availability_zone = attributes[:'availability_zone']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'image')
|
184
|
+
self.image = attributes[:'image']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'image_password')
|
188
|
+
self.image_password = attributes[:'image_password']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'image_alias')
|
192
|
+
self.image_alias = attributes[:'image_alias']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'ssh_keys')
|
196
|
+
if (value = attributes[:'ssh_keys']).is_a?(Array)
|
197
|
+
self.ssh_keys = value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'bus')
|
202
|
+
self.bus = attributes[:'bus']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'licence_type')
|
206
|
+
self.licence_type = attributes[:'licence_type']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'cpu_hot_plug')
|
210
|
+
self.cpu_hot_plug = attributes[:'cpu_hot_plug']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'ram_hot_plug')
|
214
|
+
self.ram_hot_plug = attributes[:'ram_hot_plug']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'nic_hot_plug')
|
218
|
+
self.nic_hot_plug = attributes[:'nic_hot_plug']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'nic_hot_unplug')
|
222
|
+
self.nic_hot_unplug = attributes[:'nic_hot_unplug']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'disc_virtio_hot_plug')
|
226
|
+
self.disc_virtio_hot_plug = attributes[:'disc_virtio_hot_plug']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'disc_virtio_hot_unplug')
|
230
|
+
self.disc_virtio_hot_unplug = attributes[:'disc_virtio_hot_unplug']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'device_number')
|
234
|
+
self.device_number = attributes[:'device_number']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'backupunit_id')
|
238
|
+
self.backupunit_id = attributes[:'backupunit_id']
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
243
|
+
# @return Array for valid properties with the reasons
|
244
|
+
def list_invalid_properties
|
245
|
+
invalid_properties = Array.new
|
246
|
+
if @size.nil?
|
247
|
+
invalid_properties.push('invalid value for "size", size cannot be nil.')
|
248
|
+
end
|
249
|
+
|
250
|
+
invalid_properties
|
251
|
+
end
|
252
|
+
|
253
|
+
# Check to see if the all the properties in the model are valid
|
254
|
+
# @return true if the model is valid
|
255
|
+
def valid?
|
256
|
+
type_validator = EnumAttributeValidator.new('String', ["HDD", "SSD", "SSD Standard", "SSD Premium"])
|
257
|
+
return false unless type_validator.valid?(@type)
|
258
|
+
return false if @size.nil?
|
259
|
+
availability_zone_validator = EnumAttributeValidator.new('String', ["AUTO", "ZONE_1", "ZONE_2", "ZONE_3"])
|
260
|
+
return false unless availability_zone_validator.valid?(@availability_zone)
|
261
|
+
bus_validator = EnumAttributeValidator.new('String', ["VIRTIO", "IDE"])
|
262
|
+
return false unless bus_validator.valid?(@bus)
|
263
|
+
licence_type_validator = EnumAttributeValidator.new('String', ["UNKNOWN", "WINDOWS", "WINDOWS2016", "LINUX", "OTHER"])
|
264
|
+
return false unless licence_type_validator.valid?(@licence_type)
|
265
|
+
true
|
266
|
+
end
|
267
|
+
|
268
|
+
# Custom attribute writer method checking allowed values (enum).
|
269
|
+
# @param [Object] type Object to be assigned
|
270
|
+
def type=(type)
|
271
|
+
validator = EnumAttributeValidator.new('String', ["HDD", "SSD", "SSD Standard", "SSD Premium"])
|
272
|
+
unless validator.valid?(type)
|
273
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
274
|
+
end
|
275
|
+
@type = type
|
276
|
+
end
|
277
|
+
|
278
|
+
# Custom attribute writer method checking allowed values (enum).
|
279
|
+
# @param [Object] availability_zone Object to be assigned
|
280
|
+
def availability_zone=(availability_zone)
|
281
|
+
validator = EnumAttributeValidator.new('String', ["AUTO", "ZONE_1", "ZONE_2", "ZONE_3"])
|
282
|
+
unless validator.valid?(availability_zone)
|
283
|
+
fail ArgumentError, "invalid value for \"availability_zone\", must be one of #{validator.allowable_values}."
|
284
|
+
end
|
285
|
+
@availability_zone = availability_zone
|
286
|
+
end
|
287
|
+
|
288
|
+
# Custom attribute writer method checking allowed values (enum).
|
289
|
+
# @param [Object] bus Object to be assigned
|
290
|
+
def bus=(bus)
|
291
|
+
validator = EnumAttributeValidator.new('String', ["VIRTIO", "IDE"])
|
292
|
+
unless validator.valid?(bus)
|
293
|
+
fail ArgumentError, "invalid value for \"bus\", must be one of #{validator.allowable_values}."
|
294
|
+
end
|
295
|
+
@bus = bus
|
296
|
+
end
|
297
|
+
|
298
|
+
# Custom attribute writer method checking allowed values (enum).
|
299
|
+
# @param [Object] licence_type Object to be assigned
|
300
|
+
def licence_type=(licence_type)
|
301
|
+
validator = EnumAttributeValidator.new('String', ["UNKNOWN", "WINDOWS", "WINDOWS2016", "LINUX", "OTHER"])
|
302
|
+
unless validator.valid?(licence_type)
|
303
|
+
fail ArgumentError, "invalid value for \"licence_type\", must be one of #{validator.allowable_values}."
|
304
|
+
end
|
305
|
+
@licence_type = licence_type
|
306
|
+
end
|
307
|
+
|
308
|
+
# Checks equality by comparing each attribute.
|
309
|
+
# @param [Object] Object to be compared
|
310
|
+
def ==(o)
|
311
|
+
return true if self.equal?(o)
|
312
|
+
self.class == o.class &&
|
313
|
+
name == o.name &&
|
314
|
+
type == o.type &&
|
315
|
+
size == o.size &&
|
316
|
+
availability_zone == o.availability_zone &&
|
317
|
+
image == o.image &&
|
318
|
+
image_password == o.image_password &&
|
319
|
+
image_alias == o.image_alias &&
|
320
|
+
ssh_keys == o.ssh_keys &&
|
321
|
+
bus == o.bus &&
|
322
|
+
licence_type == o.licence_type &&
|
323
|
+
cpu_hot_plug == o.cpu_hot_plug &&
|
324
|
+
ram_hot_plug == o.ram_hot_plug &&
|
325
|
+
nic_hot_plug == o.nic_hot_plug &&
|
326
|
+
nic_hot_unplug == o.nic_hot_unplug &&
|
327
|
+
disc_virtio_hot_plug == o.disc_virtio_hot_plug &&
|
328
|
+
disc_virtio_hot_unplug == o.disc_virtio_hot_unplug &&
|
329
|
+
device_number == o.device_number &&
|
330
|
+
backupunit_id == o.backupunit_id
|
331
|
+
end
|
332
|
+
|
333
|
+
# @see the `==` method
|
334
|
+
# @param [Object] Object to be compared
|
335
|
+
def eql?(o)
|
336
|
+
self == o
|
337
|
+
end
|
338
|
+
|
339
|
+
# Calculates hash code according to all attributes.
|
340
|
+
# @return [Integer] Hash code
|
341
|
+
def hash
|
342
|
+
[name, type, size, availability_zone, image, image_password, image_alias, ssh_keys, bus, licence_type, cpu_hot_plug, ram_hot_plug, nic_hot_plug, nic_hot_unplug, disc_virtio_hot_plug, disc_virtio_hot_unplug, device_number, backupunit_id].hash
|
343
|
+
end
|
344
|
+
|
345
|
+
# Builds the object from hash
|
346
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
347
|
+
# @return [Object] Returns the model itself
|
348
|
+
def self.build_from_hash(attributes)
|
349
|
+
new.build_from_hash(attributes)
|
350
|
+
end
|
351
|
+
|
352
|
+
# Builds the object from hash
|
353
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
354
|
+
# @return [Object] Returns the model itself
|
355
|
+
def build_from_hash(attributes)
|
356
|
+
return nil unless attributes.is_a?(Hash)
|
357
|
+
self.class.openapi_types.each_pair do |key, type|
|
358
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
359
|
+
self.send("#{key}=", nil)
|
360
|
+
elsif type =~ /\AArray<(.*)>/i
|
361
|
+
# check to ensure the input is an array given that the attribute
|
362
|
+
# is documented as an array but the input is not
|
363
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
364
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
365
|
+
end
|
366
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
367
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
self
|
372
|
+
end
|
373
|
+
|
374
|
+
# Deserializes the data based on type
|
375
|
+
# @param string type Data type
|
376
|
+
# @param string value Value to be deserialized
|
377
|
+
# @return [Object] Deserialized data
|
378
|
+
def _deserialize(type, value)
|
379
|
+
case type.to_sym
|
380
|
+
when :Time
|
381
|
+
Time.parse(value)
|
382
|
+
when :Date
|
383
|
+
Date.parse(value)
|
384
|
+
when :String
|
385
|
+
value.to_s
|
386
|
+
when :Integer
|
387
|
+
value.to_i
|
388
|
+
when :Float
|
389
|
+
value.to_f
|
390
|
+
when :Boolean
|
391
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
392
|
+
true
|
393
|
+
else
|
394
|
+
false
|
395
|
+
end
|
396
|
+
when :Object
|
397
|
+
# generic object (usually a Hash), return directly
|
398
|
+
value
|
399
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
400
|
+
inner_type = Regexp.last_match[:inner_type]
|
401
|
+
value.map { |v| _deserialize(inner_type, v) }
|
402
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
403
|
+
k_type = Regexp.last_match[:k_type]
|
404
|
+
v_type = Regexp.last_match[:v_type]
|
405
|
+
{}.tap do |hash|
|
406
|
+
value.each do |k, v|
|
407
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
408
|
+
end
|
409
|
+
end
|
410
|
+
else # model
|
411
|
+
# models (e.g. Pet) or oneOf
|
412
|
+
klass = Ionoscloud.const_get(type)
|
413
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
# Returns the string representation of the object
|
418
|
+
# @return [String] String presentation of the object
|
419
|
+
def to_s
|
420
|
+
to_hash.to_s
|
421
|
+
end
|
422
|
+
|
423
|
+
# to_body is an alias to to_hash (backward compatibility)
|
424
|
+
# @return [Hash] Returns the object in the form of hash
|
425
|
+
def to_body
|
426
|
+
to_hash
|
427
|
+
end
|
428
|
+
|
429
|
+
# Returns the object in the form of hash
|
430
|
+
# @return [Hash] Returns the object in the form of hash
|
431
|
+
def to_hash
|
432
|
+
hash = {}
|
433
|
+
self.class.attribute_map.each_pair do |attr, param|
|
434
|
+
value = self.send(attr)
|
435
|
+
if value.nil?
|
436
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
437
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
438
|
+
end
|
439
|
+
|
440
|
+
hash[param] = _to_hash(value)
|
441
|
+
end
|
442
|
+
hash
|
443
|
+
end
|
444
|
+
|
445
|
+
# Outputs non-array value in the form of hash
|
446
|
+
# For object, use to_hash. Otherwise, just return the value
|
447
|
+
# @param [Object] value Any valid value
|
448
|
+
# @return [Hash] Returns the value in the form of hash
|
449
|
+
def _to_hash(value)
|
450
|
+
if value.is_a?(Array)
|
451
|
+
value.compact.map { |v| _to_hash(v) }
|
452
|
+
elsif value.is_a?(Hash)
|
453
|
+
{}.tap do |hash|
|
454
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
455
|
+
end
|
456
|
+
elsif value.respond_to? :to_hash
|
457
|
+
value.to_hash
|
458
|
+
else
|
459
|
+
value
|
460
|
+
end
|
461
|
+
end
|
462
|
+
end
|
463
|
+
end
|