occi-core 4.3.6 → 5.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.fasterer.yml +3 -0
- data/.gitignore +9 -16
- data/.rspec +1 -1
- data/.rubocop.yml +69 -0
- data/.travis.yml +27 -0
- data/AUTHORS +8 -6
- data/CHANGELOG.md +0 -0
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/README.md +25 -170
- data/Rakefile +25 -17
- data/examples/initialize_model.rb +10 -0
- data/examples/parse_action_instance_json.rb +15 -0
- data/examples/parse_action_instance_text.rb +15 -0
- data/examples/parse_categories_json.rb +15 -0
- data/examples/parse_categories_text.rb +15 -0
- data/examples/parse_instance_json.rb +15 -0
- data/examples/parse_instance_text.rb +15 -0
- data/examples/parse_model_json.rb +9 -0
- data/examples/parse_model_text.rb +9 -0
- data/examples/render_action_instance_json.rb +17 -0
- data/examples/render_action_instance_text.rb +17 -0
- data/examples/render_instance_json.rb +20 -0
- data/examples/render_instance_text.rb +20 -0
- data/examples/render_model_json.rb +12 -0
- data/examples/render_model_text.rb +12 -0
- data/examples/rendering/action_instance.json +6 -0
- data/examples/rendering/action_instance.txt +2 -0
- data/examples/rendering/categories.json +78 -0
- data/examples/rendering/categories.txt +4 -0
- data/examples/rendering/instance.json +70 -0
- data/examples/rendering/instance.txt +12 -0
- data/examples/rendering/model.alt.json +1716 -0
- data/examples/rendering/model.json +785 -0
- data/examples/rendering/model.txt +68 -0
- data/lib/occi/core/action.rb +12 -26
- data/lib/occi/core/action_instance.rb +109 -65
- data/lib/occi/core/attribute.rb +136 -0
- data/lib/occi/core/attribute_definition.rb +269 -0
- data/lib/occi/core/category.rb +110 -83
- data/lib/occi/core/collection.rb +255 -0
- data/lib/occi/core/constants.rb +14 -0
- data/lib/occi/core/entity.rb +301 -195
- data/lib/occi/core/errors/.gitkeep +0 -0
- data/lib/occi/core/errors/attribute_definition_error.rb +11 -0
- data/lib/occi/core/errors/attribute_validation_error.rb +13 -0
- data/lib/occi/core/errors/category_validation_error.rb +13 -0
- data/lib/occi/core/errors/collection_lookup_error.rb +11 -0
- data/lib/occi/core/errors/instance_validation_error.rb +13 -0
- data/lib/occi/core/errors/mandatory_argument_error.rb +11 -0
- data/lib/occi/core/errors/model_lookup_error.rb +11 -0
- data/lib/occi/core/errors/parser_error.rb +11 -0
- data/lib/occi/core/errors/parsing_error.rb +11 -0
- data/lib/occi/core/errors/renderer_error.rb +11 -0
- data/lib/occi/core/errors/rendering_error.rb +11 -0
- data/lib/occi/core/errors/validation_error.rb +11 -0
- data/lib/occi/core/errors.rb +9 -0
- data/lib/occi/core/helpers/.gitkeep +0 -0
- data/lib/occi/core/helpers/argument_validator.rb +27 -0
- data/lib/occi/core/helpers/attributes_accessor.rb +22 -0
- data/lib/occi/core/helpers/error_handler.rb +29 -0
- data/lib/occi/core/helpers/hash_dereferencer.rb +149 -0
- data/lib/occi/core/helpers/identifier_validator.rb +135 -0
- data/lib/occi/core/helpers/instance_attribute_resetter.rb +131 -0
- data/lib/occi/core/helpers/instance_attributes_accessor.rb +30 -0
- data/lib/occi/core/helpers/locatable.rb +40 -0
- data/lib/occi/core/helpers/parser_dereferencer.rb +96 -0
- data/lib/occi/core/helpers/raw_json_parser.rb +18 -0
- data/lib/occi/core/helpers/renderable.rb +93 -0
- data/lib/occi/core/helpers/yaml_summoner.rb +44 -0
- data/lib/occi/core/helpers.rb +13 -0
- data/lib/occi/core/instance_builder.rb +162 -0
- data/lib/occi/core/kind.rb +100 -132
- data/lib/occi/core/link.rb +47 -72
- data/lib/occi/core/mixin.rb +76 -61
- data/lib/occi/core/model.rb +341 -0
- data/lib/occi/core/parsers/.gitkeep +0 -0
- data/lib/occi/core/parsers/base_parser.rb +168 -0
- data/lib/occi/core/parsers/json/.gitkeep +0 -0
- data/lib/occi/core/parsers/json/action_instance.rb +36 -0
- data/lib/occi/core/parsers/json/category.rb +113 -0
- data/lib/occi/core/parsers/json/entity.rb +156 -0
- data/lib/occi/core/parsers/json/validator/.gitkeep +0 -0
- data/lib/occi/core/parsers/json/validator/action-instance.json +3 -0
- data/lib/occi/core/parsers/json/validator/entity-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/link-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/link.json +3 -0
- data/lib/occi/core/parsers/json/validator/locations.json +3 -0
- data/lib/occi/core/parsers/json/validator/mixin-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/model.json +3 -0
- data/lib/occi/core/parsers/json/validator/occi-schema.json +277 -0
- data/lib/occi/core/parsers/json/validator/resource-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/resource.json +3 -0
- data/lib/occi/core/parsers/json/validator.rb +87 -0
- data/lib/occi/core/parsers/json_parser.rb +128 -0
- data/lib/occi/core/parsers/text/.gitkeep +0 -0
- data/lib/occi/core/parsers/text/category.rb +183 -0
- data/lib/occi/core/parsers/text/constants.rb +89 -0
- data/lib/occi/core/parsers/text/entity.rb +257 -0
- data/lib/occi/core/parsers/text/location.rb +48 -0
- data/lib/occi/core/parsers/text_parser.rb +257 -0
- data/lib/occi/core/parsers.rb +18 -0
- data/lib/occi/core/renderer_factory.rb +213 -0
- data/lib/occi/core/renderers/.gitkeep +0 -0
- data/lib/occi/core/renderers/base_renderer.rb +81 -0
- data/lib/occi/core/renderers/json/.gitkeep +0 -0
- data/lib/occi/core/renderers/json/action_instance.rb +24 -0
- data/lib/occi/core/renderers/json/attributes.rb +50 -0
- data/lib/occi/core/renderers/json/base.rb +46 -0
- data/lib/occi/core/renderers/json/category.rb +85 -0
- data/lib/occi/core/renderers/json/collection.rb +52 -0
- data/lib/occi/core/renderers/json/instance.rb +39 -0
- data/lib/occi/core/renderers/json/link.rb +48 -0
- data/lib/occi/core/renderers/json/model.rb +26 -0
- data/lib/occi/core/renderers/json/resource.rb +27 -0
- data/lib/occi/core/renderers/json_renderer.rb +72 -0
- data/lib/occi/core/renderers/text/.gitkeep +0 -0
- data/lib/occi/core/renderers/text/action_instance.rb +36 -0
- data/lib/occi/core/renderers/text/attributes.rb +87 -0
- data/lib/occi/core/renderers/text/base.rb +82 -0
- data/lib/occi/core/renderers/text/category.rb +183 -0
- data/lib/occi/core/renderers/text/collection.rb +65 -0
- data/lib/occi/core/renderers/text/instance.rb +44 -0
- data/lib/occi/core/renderers/text/link.rb +40 -0
- data/lib/occi/core/renderers/text/model.rb +41 -0
- data/lib/occi/core/renderers/text/resource.rb +109 -0
- data/lib/occi/core/renderers/text_renderer.rb +72 -0
- data/lib/occi/core/renderers.rb +20 -0
- data/lib/occi/core/resource.rb +93 -57
- data/lib/occi/core/utils/.gitkeep +0 -0
- data/lib/occi/core/version.rb +17 -0
- data/lib/occi/core/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/core/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.id.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.source.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.summary.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.target.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.title.yml +7 -0
- data/lib/occi/core/warehouse/kinds/entity.yml +10 -0
- data/lib/occi/core/warehouse/kinds/link.yml +10 -0
- data/lib/occi/core/warehouse/kinds/resource.yml +9 -0
- data/lib/occi/core/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/core/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse.rb +115 -0
- data/lib/occi/core.rb +59 -23
- data/lib/occi/infrastructure/compute.rb +5 -122
- data/lib/occi/infrastructure/constants.rb +25 -0
- data/lib/occi/infrastructure/instance_builder.rb +24 -0
- data/lib/occi/infrastructure/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure/mixins/os_tpl.rb +19 -0
- data/lib/occi/infrastructure/mixins/resource_tpl.rb +19 -0
- data/lib/occi/infrastructure/mixins.rb +12 -0
- data/lib/occi/infrastructure/model.rb +27 -0
- data/lib/occi/infrastructure/network.rb +5 -104
- data/lib/occi/infrastructure/networkinterface.rb +5 -100
- data/lib/occi/infrastructure/storage.rb +5 -59
- data/lib/occi/infrastructure/storagelink.rb +5 -54
- data/lib/occi/infrastructure/version.rb +5 -0
- data/lib/occi/infrastructure/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_restart.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_save.yml +19 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_start.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_stop.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_suspend.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/network_down.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/network_up.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/networkinterface_down.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/networkinterface_up.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_backup.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_offline.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_online.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_resize.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_snapshot.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storagelink_offline.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storagelink_online.yml +4 -0
- data/lib/occi/infrastructure/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.architecture.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.cores.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.hostname.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.memory.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.speed.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.label.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.vlan.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.interface.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.mac.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storage.size.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storage.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.deviceid.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.mountpoint.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/compute.yml +19 -0
- data/lib/occi/infrastructure/warehouse/kinds/network.yml +13 -0
- data/lib/occi/infrastructure/warehouse/kinds/networkinterface.yml +13 -0
- data/lib/occi/infrastructure/warehouse/kinds/storage.yml +15 -0
- data/lib/occi/infrastructure/warehouse/kinds/storagelink.yml +13 -0
- data/lib/occi/infrastructure/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.address.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.allocation.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.gateway.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.address.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.allocation.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.gateway.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/ipnetwork.yml +11 -0
- data/lib/occi/infrastructure/warehouse/mixins/ipnetworkinterface.yml +11 -0
- data/lib/occi/infrastructure/warehouse.rb +20 -0
- data/lib/occi/infrastructure-ext.rb +35 -0
- data/lib/occi/infrastructure.rb +34 -19
- data/lib/occi/infrastructure_ext/constants.rb +20 -0
- data/lib/occi/infrastructure_ext/instance_builder.rb +22 -0
- data/lib/occi/infrastructure_ext/ipreservation.rb +9 -0
- data/lib/occi/infrastructure_ext/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/mixins/availability_zone.rb +19 -0
- data/lib/occi/infrastructure_ext/mixins.rb +12 -0
- data/lib/occi/infrastructure_ext/model.rb +26 -0
- data/lib/occi/infrastructure_ext/securitygroup.rb +9 -0
- data/lib/occi/infrastructure_ext/securitygrouplink.rb +9 -0
- data/lib/occi/infrastructure_ext/version.rb +5 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/ipreservation_down.yml +4 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/ipreservation_up.yml +4 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.address.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.used.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygroup.rules.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygroup.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygrouplink.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/ipreservation.yml +13 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/securitygroup.yml +9 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/securitygrouplink.yml +8 -0
- data/lib/occi/infrastructure_ext/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse.rb +20 -0
- data/lib/occi/monkey_island/boolean.rb +6 -0
- data/lib/occi/monkey_island/hash.rb +4 -0
- data/occi-core.gemspec +26 -26
- metadata +312 -243
- data/.yardopts +0 -1
- data/config/occi.yml +0 -4
- data/lib/occi/collection.rb +0 -265
- data/lib/occi/core/actions.rb +0 -21
- data/lib/occi/core/attributes.rb +0 -411
- data/lib/occi/core/categories.rb +0 -64
- data/lib/occi/core/dependencies.rb +0 -7
- data/lib/occi/core/entities.rb +0 -48
- data/lib/occi/core/kinds.rb +0 -22
- data/lib/occi/core/links.rb +0 -37
- data/lib/occi/core/mixins.rb +0 -37
- data/lib/occi/core/properties.rb +0 -108
- data/lib/occi/core/resources.rb +0 -14
- data/lib/occi/errors/attribute_definitions_converted_error.rb +0 -5
- data/lib/occi/errors/attribute_missing_error.rb +0 -5
- data/lib/occi/errors/attribute_name_invalid_error.rb +0 -5
- data/lib/occi/errors/attribute_not_defined_error.rb +0 -5
- data/lib/occi/errors/attribute_property_type_error.rb +0 -5
- data/lib/occi/errors/attribute_type_error.rb +0 -5
- data/lib/occi/errors/category_not_defined_error.rb +0 -5
- data/lib/occi/errors/kind_not_defined_error.rb +0 -5
- data/lib/occi/errors/parser_input_error.rb +0 -5
- data/lib/occi/errors/parser_type_error.rb +0 -5
- data/lib/occi/errors.rb +0 -1
- data/lib/occi/extensions/hashie.rb +0 -25
- data/lib/occi/helpers/comparators/action_instance.rb +0 -22
- data/lib/occi/helpers/comparators/attributes.rb +0 -22
- data/lib/occi/helpers/comparators/categories.rb +0 -22
- data/lib/occi/helpers/comparators/category.rb +0 -22
- data/lib/occi/helpers/comparators/collection.rb +0 -40
- data/lib/occi/helpers/comparators/entities.rb +0 -22
- data/lib/occi/helpers/comparators/entity.rb +0 -22
- data/lib/occi/helpers/comparators/properties.rb +0 -26
- data/lib/occi/helpers/comparators.rb +0 -1
- data/lib/occi/helpers/inspect.rb +0 -12
- data/lib/occi/infrastructure/network/ipnetwork.rb +0 -28
- data/lib/occi/infrastructure/networkinterface/ipnetworkinterface.rb +0 -28
- data/lib/occi/infrastructure/os_tpl.rb +0 -20
- data/lib/occi/infrastructure/resource_tpl.rb +0 -20
- data/lib/occi/log.rb +0 -71
- data/lib/occi/model.rb +0 -87
- data/lib/occi/parser/json.rb +0 -38
- data/lib/occi/parser/text/constants.rb +0 -89
- data/lib/occi/parser/text.rb +0 -280
- data/lib/occi/parser.rb +0 -144
- data/lib/occi/settings.rb +0 -10
- data/lib/occi/version.rb +0 -3
- data/lib/occi-core.rb +0 -53
- data/spec/helpers/to_plain.rb +0 -39
- data/spec/helpers/yaml_hash.rb +0 -32
- data/spec/occi/collection_samples/collection1.json +0 -1
- data/spec/occi/collection_samples/directory2/collection2.json +0 -1
- data/spec/occi/collection_spec.rb +0 -1003
- data/spec/occi/core/action_instance_spec.rb +0 -317
- data/spec/occi/core/action_spec.rb +0 -71
- data/spec/occi/core/attributes_spec.rb +0 -665
- data/spec/occi/core/categories_spec.rb +0 -28
- data/spec/occi/core/category_spec.rb +0 -216
- data/spec/occi/core/entities_spec.rb +0 -160
- data/spec/occi/core/entity_spec.rb +0 -374
- data/spec/occi/core/kind_spec.rb +0 -182
- data/spec/occi/core/link_spec.rb +0 -52
- data/spec/occi/core/links_spec.rb +0 -132
- data/spec/occi/core/mixin_spec.rb +0 -38
- data/spec/occi/core/mixins_spec.rb +0 -107
- data/spec/occi/core/properties_spec.rb +0 -171
- data/spec/occi/core/resource_spec.rb +0 -42
- data/spec/occi/core_spec.rb +0 -12
- data/spec/occi/infrastructure/compute_spec.rb +0 -229
- data/spec/occi/infrastructure/network_spec.rb +0 -96
- data/spec/occi/infrastructure/networkinterface_spec.rb +0 -96
- data/spec/occi/infrastructure/storage_spec.rb +0 -33
- data/spec/occi/infrastructure/storagelink_spec.rb +0 -45
- data/spec/occi/log_spec.rb +0 -117
- data/spec/occi/model_spec.rb +0 -256
- data/spec/occi/parser/json_samples/test.json +0 -49
- data/spec/occi/parser/text_samples/occi_categories.body_plain.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.parse_headers.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.text +0 -2
- data/spec/occi/parser/text_samples/occi_compute_rocci_server.expected +0 -11
- data/spec/occi/parser/text_samples/occi_compute_rocci_server.text +0 -10
- data/spec/occi/parser/text_samples/occi_link_resource_instance.body_plain.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.parse.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.text +0 -7
- data/spec/occi/parser/text_samples/occi_link_simple.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_simple.text +0 -1
- data/spec/occi/parser/text_samples/occi_link_w_attributes.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_attributes.text +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_category.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_category.text +0 -3
- data/spec/occi/parser/text_samples/occi_model_categories.expected +0 -3
- data/spec/occi/parser/text_samples/occi_model_rocci_server.text +0 -51
- data/spec/occi/parser/text_samples/occi_network_rocci_server.body_plain.expected +0 -11
- data/spec/occi/parser/text_samples/occi_network_rocci_server.expected +0 -11
- data/spec/occi/parser/text_samples/occi_network_rocci_server.resource.header.expected +0 -9
- data/spec/occi/parser/text_samples/occi_network_rocci_server.resource.rack.expected +0 -9
- data/spec/occi/parser/text_samples/occi_network_rocci_server.text +0 -11
- data/spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.parse.expected +0 -15
- data/spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.text +0 -15
- data/spec/occi/parser/text_samples/occi_resource_w_attributes.text +0 -11
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links.expected +0 -1
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links.text +0 -16
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links_only.text +0 -13
- data/spec/occi/parser/text_samples/occi_storage_rocci_server.expected +0 -9
- data/spec/occi/parser/text_samples/occi_storage_rocci_server.text +0 -9
- data/spec/occi/parser/text_spec.rb +0 -320
- data/spec/occi/parser_spec.rb +0 -259
- data/spec/occi-core_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -18
data/lib/occi/core/entity.rb
CHANGED
@@ -1,258 +1,364 @@
|
|
1
1
|
module Occi
|
2
2
|
module Core
|
3
|
+
# Implements the base class for all OCCI resources and links, this
|
4
|
+
# class should be treated as an abstracts class and not used directly
|
5
|
+
# to create entity instances.
|
6
|
+
#
|
7
|
+
# @attr kind [Occi::Core::Kind] entity kind, following OCCI's typing mechanism
|
8
|
+
# @attr id [String] entity instance identifier, unique in the given domain
|
9
|
+
# @attr location [URI] entity instance location, unique in the given domain
|
10
|
+
# @attr title [String] entity instance title
|
11
|
+
# @attr attributes [Hash] entity instance attributes
|
12
|
+
# @attr mixins [Set] set of mixins associated with this entity instance
|
13
|
+
# @attr actions [Set] set of actions associated with this entity instance
|
14
|
+
#
|
15
|
+
# @abstract The base class itself should be used as an abstract starting
|
16
|
+
# point when creating custom resources and links.
|
17
|
+
# @author Boris Parak <parak@cesnet.cz>
|
3
18
|
class Entity
|
4
|
-
|
5
|
-
include
|
6
|
-
include
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
|
26
|
-
|
19
|
+
include Yell::Loggable
|
20
|
+
include Helpers::Renderable
|
21
|
+
include Helpers::Locatable
|
22
|
+
include Helpers::InstanceAttributesAccessor
|
23
|
+
include Helpers::ArgumentValidator
|
24
|
+
include Helpers::InstanceAttributeResetter
|
25
|
+
|
26
|
+
attr_accessor :kind, :actions, :attributes, :mixins
|
27
|
+
attr_writer :location
|
28
|
+
|
29
|
+
ERRORS = [
|
30
|
+
Occi::Core::Errors::AttributeValidationError,
|
31
|
+
Occi::Core::Errors::AttributeDefinitionError,
|
32
|
+
Occi::Core::Errors::InstanceValidationError
|
33
|
+
].freeze
|
34
|
+
|
35
|
+
# Constructs an instance with the given information. `kind` is a mandatory
|
36
|
+
# argument, the rest will either default to appropriate values or remain
|
37
|
+
# `nil`. The `id` attribute will default to a newly generated UUID, see
|
38
|
+
# `SecureRandom.uuid` for details.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# my_kind = Occi::Core::Kind.new term: 'gnr', schema: 'http://example.org/test#'
|
42
|
+
# Entity.new kind: my_kind
|
43
|
+
#
|
44
|
+
# @param args [Hash] arguments with entity instance information
|
45
|
+
# @option args [Occi::Core::Kind] :kind entity kind, following OCCI's typing mechanism
|
46
|
+
# @option args [String] :id entity instance identifier, unique in the given domain
|
47
|
+
# @option args [URI] :location entity instance location, unique in the given domain
|
48
|
+
# @option args [String] :title entity instance title
|
49
|
+
# @option args [Hash] :attributes entity instance attributes
|
50
|
+
# @option args [Set] :mixins set of mixins associated with this entity instance
|
51
|
+
# @option args [Set] :actions set of actions associated with this entity instance
|
52
|
+
def initialize(args = {})
|
53
|
+
pre_initialize(args)
|
54
|
+
default_args! args
|
55
|
+
|
56
|
+
@kind = args.fetch(:kind)
|
57
|
+
@location = args.fetch(:location)
|
58
|
+
@attributes = args.fetch(:attributes)
|
59
|
+
@mixins = args.fetch(:mixins)
|
60
|
+
@actions = args.fetch(:actions)
|
61
|
+
|
62
|
+
post_initialize(args)
|
27
63
|
end
|
28
64
|
|
29
|
-
# @
|
30
|
-
|
31
|
-
|
32
|
-
if args.size > 0
|
33
|
-
type_identifier = args[0].to_s
|
34
|
-
related = [self.kind]
|
35
|
-
else
|
36
|
-
type_identifier = self.kind.type_identifier
|
37
|
-
related = nil
|
38
|
-
end
|
39
|
-
scheme, term = type_identifier.split '#'
|
40
|
-
|
41
|
-
klass = Occi::Core::Kind.get_class scheme, term, related
|
42
|
-
|
43
|
-
object = klass.allocate
|
44
|
-
object.send :initialize, *args
|
45
|
-
object
|
65
|
+
# @return [String] entity instance identifier, unique in the given domain
|
66
|
+
def id
|
67
|
+
self['occi.core.id']
|
46
68
|
end
|
47
69
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
attributes
|
70
|
+
# @param id [String] entity instance identifier, unique in the given domain
|
71
|
+
def id=(id)
|
72
|
+
self['occi.core.id'] = id
|
52
73
|
end
|
53
74
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
attributes
|
75
|
+
# @return [String] entity instance title
|
76
|
+
def title
|
77
|
+
self['occi.core.title']
|
58
78
|
end
|
59
79
|
|
60
|
-
# @param [String]
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# @return [Occi::Core::Entity]
|
65
|
-
def initialize(kind = self.kind, mixins=[], attributes={}, actions=[], location=nil)
|
66
|
-
@kind = self.class.kind.clone
|
67
|
-
@mixins = Occi::Core::Mixins.new mixins
|
68
|
-
@mixins.entity = self
|
69
|
-
|
70
|
-
attributes = self.class.attribute_properties if attributes.blank?
|
71
|
-
if attributes.kind_of? Occi::Core::Attributes
|
72
|
-
@attributes = attributes.convert
|
73
|
-
else
|
74
|
-
@attributes = Occi::Core::Attributes.new attributes
|
75
|
-
end
|
76
|
-
@attributes['occi.core.id'] ||= UUIDTools::UUID.random_create.to_s
|
80
|
+
# @param title [String] entity instance title
|
81
|
+
def title=(title)
|
82
|
+
self['occi.core.title'] = title
|
83
|
+
end
|
77
84
|
|
78
|
-
|
79
|
-
|
85
|
+
# Short-hand for accessing the identifier of assigned `Kind`
|
86
|
+
# instance.
|
87
|
+
#
|
88
|
+
# @return [String] identifier of the included `Kind` instance
|
89
|
+
# @return [NilClass] if no kind is present
|
90
|
+
def kind_identifier
|
91
|
+
kind ? kind.identifier : nil
|
80
92
|
end
|
81
93
|
|
82
|
-
#
|
83
|
-
#
|
94
|
+
# Assigns new kind instance to this entity instance. This
|
95
|
+
# method will trigger a complete reset on all previously
|
96
|
+
# set attributes, for the sake of consistency.
|
97
|
+
#
|
98
|
+
# @param kind [Occi::Core::Kind] kind instance to be assigned
|
99
|
+
# @return [Occi::Core::Kind] assigned kind instance
|
84
100
|
def kind=(kind)
|
85
|
-
|
86
|
-
|
87
|
-
|
101
|
+
unless kind
|
102
|
+
raise Occi::Core::Errors::InstanceValidationError,
|
103
|
+
'Missing valid kind'
|
88
104
|
end
|
105
|
+
|
89
106
|
@kind = kind
|
90
|
-
|
107
|
+
reset_attributes!
|
91
108
|
|
92
|
-
|
93
|
-
def mixins=(mixins)
|
94
|
-
@mixins = Occi::Core::Mixins.new mixins
|
95
|
-
@mixins.entity = self
|
96
|
-
@mixins
|
109
|
+
kind
|
97
110
|
end
|
98
111
|
|
99
|
-
#
|
100
|
-
|
101
|
-
|
102
|
-
|
112
|
+
# Assigns new mixins instance to this entity instance. This
|
113
|
+
# method will trigger a complete reset on all previously
|
114
|
+
# set attributes, for the sake of consistency.
|
115
|
+
#
|
116
|
+
# @param kind [Hash] mixins instance to be assigned
|
117
|
+
# @return [Hash] mixins instance assigned
|
118
|
+
def mixins=(mixins)
|
119
|
+
unless mixins
|
120
|
+
raise Occi::Core::Errors::InstanceValidationError,
|
121
|
+
'Missing valid mixins'
|
122
|
+
end
|
103
123
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
124
|
+
@mixins = mixins
|
125
|
+
reset_added_attributes!
|
126
|
+
remove_undef_attributes
|
127
|
+
# TODO: handle sync'ing actions
|
108
128
|
|
109
|
-
|
110
|
-
# @param [UUIDTools::UUID] id
|
111
|
-
def id=(id)
|
112
|
-
@attributes.occi!.core!.id = id
|
113
|
-
@id = id
|
129
|
+
mixins
|
114
130
|
end
|
115
131
|
|
116
|
-
#
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
132
|
+
# Shorthand for assigning mixins and actions to entity
|
133
|
+
# instances. Unsupported `object` types will raise an
|
134
|
+
# error. `self` is always returned for chaining purposes.
|
135
|
+
#
|
136
|
+
# @example
|
137
|
+
# entity << mixin #=> #<Occi::Core::Entity>
|
138
|
+
# entity << action #=> #<Occi::Core::Entity>
|
139
|
+
#
|
140
|
+
# @param object [Occi::Core::Mixin, Occi::Core::Action] object to be added
|
141
|
+
# @return [Occi::Core::Entity] self
|
142
|
+
def <<(object)
|
143
|
+
case object
|
144
|
+
when Occi::Core::Mixin
|
145
|
+
add_mixin object
|
146
|
+
when Occi::Core::Action
|
147
|
+
add_action object
|
148
|
+
else
|
149
|
+
raise ArgumentError, "Cannot automatically assign #{object.inspect}"
|
150
|
+
end
|
121
151
|
|
122
|
-
|
123
|
-
# @param [String] title
|
124
|
-
def title=(title)
|
125
|
-
@attributes.occi!.core!.title = title
|
152
|
+
self
|
126
153
|
end
|
154
|
+
alias add <<
|
155
|
+
|
156
|
+
# Shorthand for removing mixins and actions from entity
|
157
|
+
# instances. Unsupported `object` types will raise an
|
158
|
+
# error. `self` is always returned for chaining purposes.
|
159
|
+
#
|
160
|
+
# @example
|
161
|
+
# entity.remove mixin #=> #<Occi::Core::Entity>
|
162
|
+
# entity.remove action #=> #<Occi::Core::Entity>
|
163
|
+
#
|
164
|
+
# @param object [Occi::Core::Mixin, Occi::Core::Action] object to be removed
|
165
|
+
# @return [Occi::Core::Entity] self
|
166
|
+
def remove(object)
|
167
|
+
case object
|
168
|
+
when Occi::Core::Mixin
|
169
|
+
remove_mixin object
|
170
|
+
when Occi::Core::Action
|
171
|
+
remove_action object
|
172
|
+
else
|
173
|
+
raise ArgumentError, "Cannot automatically remove #{object.inspect}"
|
174
|
+
end
|
127
175
|
|
128
|
-
|
129
|
-
def title
|
130
|
-
@attributes.occi_.core_.title
|
176
|
+
self
|
131
177
|
end
|
132
178
|
|
133
|
-
#
|
134
|
-
#
|
135
|
-
|
136
|
-
|
179
|
+
# Adds the given mixin to this instance. Attributes defined in the mixin
|
180
|
+
# will be transfered to instance attributes.
|
181
|
+
#
|
182
|
+
# @param mixin [Occi::Core::Mixin] mixin to be added
|
183
|
+
def add_mixin(mixin)
|
184
|
+
unless mixin
|
185
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
186
|
+
'Cannot add a non-existent mixin'
|
187
|
+
end
|
137
188
|
|
138
|
-
|
139
|
-
|
189
|
+
# TODO: handle adding actions
|
190
|
+
mixins << mixin
|
191
|
+
reset_added_attributes
|
192
|
+
end
|
140
193
|
|
141
|
-
|
142
|
-
|
194
|
+
# Removes the given mixin from this instance. Attributes defined in the
|
195
|
+
# mixin will be reset to their original definition or removed completely
|
196
|
+
# if not defined as part of `kind` attributes.
|
197
|
+
#
|
198
|
+
# @param mixin [Occi::Core::Mixin] mixin to be removed
|
199
|
+
def remove_mixin(mixin)
|
200
|
+
unless mixin
|
201
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
202
|
+
'Cannot remove a non-existent mixin'
|
203
|
+
end
|
143
204
|
|
144
|
-
|
205
|
+
# TODO: handle removing actions
|
206
|
+
mixins.delete mixin
|
207
|
+
reset_attributes
|
145
208
|
end
|
146
209
|
|
147
|
-
#
|
148
|
-
#
|
149
|
-
|
150
|
-
|
210
|
+
# Replaces the given mixin in this instance with a new mixin provided.
|
211
|
+
# This is a shorthand for invoking `remove_mixin` and `add_mixin`.
|
212
|
+
#
|
213
|
+
# @param old_mixin [Occi::Core::Mixin] mixin to be removed
|
214
|
+
# @param new_mixin [Occi::Core::Mixin] mixin to be added
|
215
|
+
def replace_mixin(old_mixin, new_mixin)
|
216
|
+
# TODO: handle replacing actions
|
217
|
+
remove_mixin old_mixin
|
218
|
+
add_mixin new_mixin
|
151
219
|
end
|
152
220
|
|
153
|
-
#
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
tmp_id = id.gsub('urn:uuid:', '')
|
161
|
-
@location = if tmp_id.start_with?(kind.location)
|
162
|
-
# ID by itself is enough
|
163
|
-
tmp_id
|
164
|
-
else
|
165
|
-
# concat kind location and ID, remove duplicated slashes
|
166
|
-
"#{kind.location}#{tmp_id}".gsub(/\/+/, '/')
|
221
|
+
# Adds the given action to this instance.
|
222
|
+
#
|
223
|
+
# @param action [Occi::Core::Action] action to be added
|
224
|
+
def add_action(action)
|
225
|
+
unless action
|
226
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
227
|
+
'Cannot add a non-existent action'
|
167
228
|
end
|
229
|
+
actions << action
|
168
230
|
end
|
169
231
|
|
170
|
-
#
|
171
|
-
#
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
definitions.merge! kind.attributes
|
181
|
-
|
182
|
-
@mixins.each do |mxn|
|
183
|
-
mixin = @model.get_by_id(mxn.to_s)
|
184
|
-
raise Occi::Errors::CategoryNotDefinedError,
|
185
|
-
"Mixin #{mxn.to_s.inspect} not declared in the model!" unless mixin && mixin.kind_of?(Occi::Core::Mixin)
|
232
|
+
# Removes the given action from this instance.
|
233
|
+
#
|
234
|
+
# @param action [Occi::Core::Action] action to be removed
|
235
|
+
def remove_action(action)
|
236
|
+
unless action
|
237
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
238
|
+
'Cannot remove a non-existent action'
|
239
|
+
end
|
240
|
+
actions.delete action
|
241
|
+
end
|
186
242
|
|
187
|
-
|
188
|
-
|
243
|
+
# Validates the content of this entity instance, including
|
244
|
+
# all previously defined OCCI attributes and other required
|
245
|
+
# elements. This method limits the information returned to
|
246
|
+
# a boolean response.
|
247
|
+
#
|
248
|
+
# @example
|
249
|
+
# entity.valid? #=> false
|
250
|
+
# entity.valid? #=> true
|
251
|
+
#
|
252
|
+
# @return [TrueClass] when entity instance is valid
|
253
|
+
# @return [FalseClass] when entity instance is invalid
|
254
|
+
def valid?
|
255
|
+
begin
|
256
|
+
valid!
|
257
|
+
rescue *ERRORS => ex
|
258
|
+
logger.warn "Entity invalid: #{ex.message}"
|
259
|
+
return false
|
260
|
+
end
|
189
261
|
|
190
|
-
|
262
|
+
true
|
191
263
|
end
|
192
264
|
|
193
|
-
#
|
194
|
-
#
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
265
|
+
# Validates the content of this entity instance, including
|
266
|
+
# all previously defined OCCI attributes and other required
|
267
|
+
# elements. This method provides additional information in
|
268
|
+
# messages of raised errors.
|
269
|
+
#
|
270
|
+
# @example
|
271
|
+
# entity.valid! #=> #<Occi::Core::Errors::InstanceValidationError>
|
272
|
+
# entity.valid! #=> nil
|
273
|
+
#
|
274
|
+
# @return [NilClass] when entity instance is valid
|
275
|
+
def valid!
|
276
|
+
%i[kind id location title attributes mixins actions].each do |attr|
|
277
|
+
unless send(attr)
|
278
|
+
raise Occi::Core::Errors::InstanceValidationError,
|
279
|
+
"Missing valid #{attr}"
|
280
|
+
end
|
281
|
+
end
|
202
282
|
|
203
|
-
|
204
|
-
|
283
|
+
attributes.each_pair { |name, attribute| valid_attribute!(name, attribute) }
|
284
|
+
end
|
205
285
|
|
206
|
-
|
286
|
+
# Returns all base attributes for this instance in the
|
287
|
+
# form of the original hash.
|
288
|
+
#
|
289
|
+
# @return [Hash] hash with base attributes
|
290
|
+
def base_attributes
|
291
|
+
kind.attributes
|
207
292
|
end
|
208
293
|
|
209
|
-
#
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
end
|
294
|
+
# Collects all available additional attributes for this
|
295
|
+
# instance and returns them as an array.
|
296
|
+
#
|
297
|
+
# @return [Array] array with added attribute hashes
|
298
|
+
def added_attributes
|
299
|
+
mixins.collect(&:attributes)
|
300
|
+
end
|
217
301
|
|
218
|
-
|
302
|
+
# Returns entity instance identifier. If such identifier is not set,
|
303
|
+
# it will generate a pseudo-random UUID and assign/return it.
|
304
|
+
#
|
305
|
+
# @return [String] entity instance identifier
|
306
|
+
def identify!
|
307
|
+
self.id ||= SecureRandom.uuid
|
308
|
+
end
|
219
309
|
|
220
|
-
|
310
|
+
protected
|
221
311
|
|
222
|
-
|
312
|
+
# :nodoc:
|
313
|
+
def valid_attribute!(name, attribute)
|
314
|
+
attribute.valid!
|
315
|
+
rescue => ex
|
316
|
+
raise ex, "Attribute #{name.inspect} invalid: #{ex}", ex.backtrace
|
223
317
|
end
|
224
318
|
|
225
|
-
#
|
226
|
-
def
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
scheme << '#'
|
233
|
-
header['Category'] << ",#{term};scheme=#{scheme.inspect};class=\"mixin\""
|
319
|
+
# :nodoc:
|
320
|
+
def sufficient_args!(args)
|
321
|
+
%i[kind attributes mixins actions].each do |attr|
|
322
|
+
unless args[attr]
|
323
|
+
raise Occi::Core::Errors::MandatoryArgumentError, "#{attr} is a mandatory " \
|
324
|
+
"argument for #{self.class}"
|
325
|
+
end
|
234
326
|
end
|
327
|
+
end
|
235
328
|
|
236
|
-
|
237
|
-
|
329
|
+
# :nodoc:
|
330
|
+
def defaults
|
331
|
+
{
|
332
|
+
kind: nil, id: nil, location: nil, title: nil,
|
333
|
+
attributes: {}, mixins: Set.new, actions: Set.new
|
334
|
+
}
|
335
|
+
end
|
238
336
|
|
239
|
-
|
240
|
-
|
241
|
-
header['Link'] = links.join(',') if links.any?
|
337
|
+
# :nodoc:
|
338
|
+
def pre_initialize(args); end
|
242
339
|
|
243
|
-
|
244
|
-
|
340
|
+
# :nodoc:
|
341
|
+
def post_initialize(args)
|
342
|
+
reset_attributes
|
245
343
|
|
246
|
-
|
247
|
-
|
248
|
-
self.location
|
344
|
+
self.id = args.fetch(:id) if attributes['occi.core.id']
|
345
|
+
self.title = args.fetch(:title) if attributes['occi.core.title']
|
249
346
|
end
|
250
347
|
|
251
|
-
#
|
252
|
-
|
253
|
-
|
348
|
+
# Generates default location based on the already configured
|
349
|
+
# `kind.location` and `id` attribute. Fails if `id` is not present.
|
350
|
+
#
|
351
|
+
# @example
|
352
|
+
# entity.generate_location # => #<URI::Generic /compute/1>
|
353
|
+
#
|
354
|
+
# @return [URI] generated location
|
355
|
+
def generate_location
|
356
|
+
if id.blank?
|
357
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
358
|
+
'Cannot generate default location without an `id`'
|
359
|
+
end
|
360
|
+
URI.parse "#{kind.location}#{id}"
|
254
361
|
end
|
255
|
-
|
256
362
|
end
|
257
363
|
end
|
258
364
|
end
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'occi/core/errors/validation_error'
|
2
|
+
|
3
|
+
module Occi
|
4
|
+
module Core
|
5
|
+
module Errors
|
6
|
+
# Custom error class indicating validation failures on
|
7
|
+
# attribute values.
|
8
|
+
#
|
9
|
+
# @author Boris Parak <parak@cesnet.cz>
|
10
|
+
class AttributeValidationError < ValidationError; end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'occi/core/errors/validation_error'
|
2
|
+
|
3
|
+
module Occi
|
4
|
+
module Core
|
5
|
+
module Errors
|
6
|
+
# Custom error class indicating validation failures on
|
7
|
+
# category instances.
|
8
|
+
#
|
9
|
+
# @author Boris Parak <parak@cesnet.cz>
|
10
|
+
class CategoryValidationError < ValidationError; end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'occi/core/errors/validation_error'
|
2
|
+
|
3
|
+
module Occi
|
4
|
+
module Core
|
5
|
+
module Errors
|
6
|
+
# Custom error class indicating validation failures on
|
7
|
+
# various Core class instances.
|
8
|
+
#
|
9
|
+
# @author Boris Parak <parak@cesnet.cz>
|
10
|
+
class InstanceValidationError < ValidationError; end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|