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/resource.rb
CHANGED
@@ -1,82 +1,118 @@
|
|
1
1
|
module Occi
|
2
2
|
module Core
|
3
|
-
class
|
4
|
-
|
5
|
-
|
3
|
+
# Implements the base class for all OCCI resources, this
|
4
|
+
# class can be used directly to create resource instances.
|
5
|
+
#
|
6
|
+
# @attr links [Set] set of links associated with this resource instance
|
7
|
+
# @attr summary [String] simple human-readable description of this resource instance
|
8
|
+
#
|
9
|
+
# @author Boris Parak <parak@cesnet.cz>
|
10
|
+
class Resource < Entity
|
11
|
+
attr_reader :links
|
12
|
+
|
13
|
+
# @return [String] resource summary
|
14
|
+
def summary
|
15
|
+
self['occi.core.summary']
|
16
|
+
end
|
6
17
|
|
7
|
-
|
18
|
+
# @param summary [String] resource summary
|
19
|
+
def summary=(summary)
|
20
|
+
self['occi.core.summary'] = summary
|
21
|
+
end
|
8
22
|
|
9
|
-
|
23
|
+
# @param links [Set] set of links
|
24
|
+
def links=(links)
|
25
|
+
unless links
|
26
|
+
raise Occi::Core::Errors::InstanceValidationError,
|
27
|
+
'Missing valid links'
|
28
|
+
end
|
29
|
+
@links ||= Set.new
|
30
|
+
@links.each { |l| remove_link(l) }
|
31
|
+
links.each { |l| add_link(l) }
|
32
|
+
|
33
|
+
@links
|
34
|
+
end
|
10
35
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
36
|
+
# :nodoc:
|
37
|
+
def <<(object)
|
38
|
+
case object
|
39
|
+
when Occi::Core::Link
|
40
|
+
add_link(object)
|
41
|
+
return self
|
42
|
+
end
|
16
43
|
|
17
|
-
|
18
|
-
# @param [Array] mixins
|
19
|
-
# @param [Occi::Core::Attributes,Hash] attributes
|
20
|
-
# @param [Array] links
|
21
|
-
# @return [Occi::Core::Resource]
|
22
|
-
def initialize(kind=self.kind, mixins=[], attributes={}, actions=[], links=[], location=nil)
|
23
|
-
super(kind, mixins, attributes, actions, location)
|
24
|
-
@links = Occi::Core::Links.new(links)
|
44
|
+
super
|
25
45
|
end
|
26
46
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
47
|
+
# :nodoc:
|
48
|
+
def remove(object)
|
49
|
+
case object
|
50
|
+
when Occi::Core::Link
|
51
|
+
remove_link(object)
|
52
|
+
return self
|
53
|
+
end
|
31
54
|
|
32
|
-
|
33
|
-
def summary
|
34
|
-
self.attributes.occi_.core_.summary
|
55
|
+
super
|
35
56
|
end
|
36
57
|
|
37
|
-
#
|
38
|
-
#
|
39
|
-
|
40
|
-
|
58
|
+
# Adds the given link to this instance.
|
59
|
+
#
|
60
|
+
# @param link [Occi::Core::Link] link to be added
|
61
|
+
def add_link(link)
|
62
|
+
unless link
|
63
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
64
|
+
'Cannot add a non-existent link'
|
65
|
+
end
|
66
|
+
link.source = location
|
67
|
+
link.source_kind = kind
|
68
|
+
links << link
|
41
69
|
end
|
42
70
|
|
43
|
-
|
44
|
-
|
71
|
+
# Removes the given link from this instance.
|
72
|
+
#
|
73
|
+
# @param link [Occi::Core::Link] link to be removed
|
74
|
+
def remove_link(link)
|
75
|
+
unless link
|
76
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
77
|
+
'Cannot remove a non-existent link'
|
78
|
+
end
|
79
|
+
link.source = nil
|
80
|
+
link.source_kind = nil
|
81
|
+
links.delete link
|
82
|
+
end
|
45
83
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
84
|
+
# See `#valid!` on `Occi::Core::Entity`.
|
85
|
+
def valid!
|
86
|
+
unless links
|
87
|
+
raise Occi::Core::Errors::InstanceValidationError,
|
88
|
+
'Missing valid links'
|
89
|
+
end
|
90
|
+
links.each(&:valid!)
|
91
|
+
super
|
92
|
+
end
|
52
93
|
|
53
|
-
|
94
|
+
protected
|
54
95
|
|
55
|
-
|
96
|
+
# :nodoc:
|
97
|
+
def defaults
|
98
|
+
super.merge(links: Set.new, summary: nil)
|
56
99
|
end
|
57
100
|
|
58
|
-
#
|
59
|
-
def
|
60
|
-
|
61
|
-
@links.each { |link| text << "\n#{link.to_text_link}" }
|
62
|
-
text
|
63
|
-
end
|
101
|
+
# :nodoc:
|
102
|
+
def sufficient_args!(args)
|
103
|
+
super
|
64
104
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
header['Link'] = @links.collect {|link| link.to_string }.join(',') if @links.any?
|
69
|
-
header
|
105
|
+
return unless args[:links].nil?
|
106
|
+
raise Occi::Core::Errors::MandatoryArgumentError,
|
107
|
+
"Links is a mandatory argument for #{self.class}"
|
70
108
|
end
|
71
109
|
|
72
|
-
#
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
resource
|
110
|
+
# :nodoc:
|
111
|
+
def post_initialize(args)
|
112
|
+
super
|
113
|
+
self.links = args.fetch(:links)
|
114
|
+
self.summary = args.fetch(:summary) if attributes['occi.core.summary']
|
78
115
|
end
|
79
|
-
|
80
116
|
end
|
81
117
|
end
|
82
118
|
end
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Occi
|
2
|
+
module Core
|
3
|
+
MAJOR_VERSION = 5 # Major update constant
|
4
|
+
MINOR_VERSION = 0 # Minor update constant
|
5
|
+
PATCH_VERSION = 0 # Patch/Fix version constant
|
6
|
+
STAGE_VERSION = 'alpha.1'.freeze # use `nil` for production releases
|
7
|
+
|
8
|
+
unless defined?(::Occi::Core::VERSION)
|
9
|
+
VERSION = [
|
10
|
+
MAJOR_VERSION,
|
11
|
+
MINOR_VERSION,
|
12
|
+
PATCH_VERSION,
|
13
|
+
STAGE_VERSION
|
14
|
+
].compact.join('.').freeze
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,115 @@
|
|
1
|
+
module Occi
|
2
|
+
module Core
|
3
|
+
# Base loader for static categories defined in the OCCI Core Standard
|
4
|
+
# published by OGF's OCCI WG. This warehouse is meant to be used as a
|
5
|
+
# quick bootstrap tools for `Occi::Core::Model` instances.
|
6
|
+
#
|
7
|
+
# @author Boris Parak <parak@cesnet.cz>
|
8
|
+
class Warehouse
|
9
|
+
include Yell::Loggable
|
10
|
+
|
11
|
+
# YAML DIR constants
|
12
|
+
BASE = 'warehouse'.freeze
|
13
|
+
KINDS = 'kinds'.freeze
|
14
|
+
ACTIONS = 'actions'.freeze
|
15
|
+
MIXINS = 'mixins'.freeze
|
16
|
+
ATTRIBS = 'attributes'.freeze
|
17
|
+
|
18
|
+
# YAML file pattern
|
19
|
+
FILE_SUFFIX = '.yml'.freeze
|
20
|
+
YAML_GLOB = "*#{FILE_SUFFIX}".freeze
|
21
|
+
|
22
|
+
class << self
|
23
|
+
# Bootstraps the given model instance with pre-defined category
|
24
|
+
# instances.
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# model = Occi::Core::Model.new
|
28
|
+
# Occi::Core::Warehouse.bootstrap! model
|
29
|
+
#
|
30
|
+
# @param model [Occi::Core::Model] model to be bootstrapped
|
31
|
+
def bootstrap!(model)
|
32
|
+
actions! model
|
33
|
+
kinds! model
|
34
|
+
mixins! model
|
35
|
+
nil # TODO: return something sensible
|
36
|
+
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
|
40
|
+
# :nodoc:
|
41
|
+
def whereami
|
42
|
+
File.expand_path(File.dirname(__FILE__))
|
43
|
+
end
|
44
|
+
|
45
|
+
# :nodoc:
|
46
|
+
def warehouse_path
|
47
|
+
File.join(whereami, BASE)
|
48
|
+
end
|
49
|
+
|
50
|
+
# :nodoc:
|
51
|
+
def kinds_path
|
52
|
+
File.join(warehouse_path, KINDS)
|
53
|
+
end
|
54
|
+
|
55
|
+
# :nodoc:
|
56
|
+
def actions_path
|
57
|
+
File.join(warehouse_path, ACTIONS)
|
58
|
+
end
|
59
|
+
|
60
|
+
# :nodoc:
|
61
|
+
def mixins_path
|
62
|
+
File.join(warehouse_path, MIXINS)
|
63
|
+
end
|
64
|
+
|
65
|
+
# :nodoc:
|
66
|
+
def kinds!(model)
|
67
|
+
attribute_definitions = attribute_definitions_for(kinds_path)
|
68
|
+
yamls_in(kinds_path).each do |file|
|
69
|
+
model << Occi::Core::Kind.from_yaml(file, model, attribute_definitions)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# :nodoc:
|
74
|
+
def mixins!(model)
|
75
|
+
attribute_definitions = attribute_definitions_for(mixins_path)
|
76
|
+
yamls_in(mixins_path).each do |file|
|
77
|
+
model << Occi::Core::Mixin.from_yaml(file, model, attribute_definitions)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# :nodoc:
|
82
|
+
def actions!(model)
|
83
|
+
# TODO: work with separate attribute definitions
|
84
|
+
attribute_definitions = {}
|
85
|
+
yamls_in(actions_path).each do |file|
|
86
|
+
model << Occi::Core::Action.from_yaml(file, model, attribute_definitions)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# :nodoc:
|
91
|
+
def attribute_definitions_for(categories_path)
|
92
|
+
attribute_definitions = {}
|
93
|
+
|
94
|
+
attr_defs_path = File.join(categories_path, ATTRIBS)
|
95
|
+
yamls_in(attr_defs_path).each do |file|
|
96
|
+
name = attribute_name_from(file)
|
97
|
+
attribute_definitions[name] = Occi::Core::AttributeDefinition.from_yaml(file)
|
98
|
+
end
|
99
|
+
|
100
|
+
attribute_definitions
|
101
|
+
end
|
102
|
+
|
103
|
+
# :nodoc:
|
104
|
+
def attribute_name_from(path)
|
105
|
+
path.split(File::SEPARATOR).last.gsub(FILE_SUFFIX, '')
|
106
|
+
end
|
107
|
+
|
108
|
+
# :nodoc:
|
109
|
+
def yamls_in(path)
|
110
|
+
Dir[File.join(path, YAML_GLOB)].sort
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
data/lib/occi/core.rb
CHANGED
@@ -1,30 +1,66 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require '
|
10
|
-
require 'occi/core/action'
|
11
|
-
require 'occi/core/action_instance'
|
12
|
-
require 'occi/core/actions'
|
13
|
-
require 'occi/core/entities'
|
14
|
-
require 'occi/core/entity'
|
15
|
-
require 'occi/core/link'
|
16
|
-
require 'occi/core/links'
|
17
|
-
require 'occi/core/resource'
|
18
|
-
require 'occi/core/resources'
|
1
|
+
# external deps
|
2
|
+
require 'active_support/all'
|
3
|
+
require 'uri'
|
4
|
+
require 'yaml'
|
5
|
+
require 'ipaddr'
|
6
|
+
require 'singleton'
|
7
|
+
require 'yell'
|
8
|
+
require 'json'
|
9
|
+
require 'json-schema'
|
19
10
|
|
11
|
+
# Contains all OCCI-related classes and modules. This module
|
12
|
+
# does not provide any additional functionality aside from
|
13
|
+
# acting as a wrapper and a namespace-defining mechanisms.
|
14
|
+
# Please, defer to specific classes and modules within this
|
15
|
+
# namespace for details and functionality descriptions.
|
16
|
+
#
|
17
|
+
# @author Boris Parak <parak@cesnet.cz>
|
20
18
|
module Occi
|
19
|
+
# Contains all OCCI-Core-related classes and modules. This
|
20
|
+
# module does not provide any additional functionality aside
|
21
|
+
# from acting as a wrapped, a namespace-defining mechanism,
|
22
|
+
# and versioning wrapper. Please, defer to specific classes
|
23
|
+
# and modules within this namespace for details and
|
24
|
+
# functionality descriptions.
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# Occi::Core::VERSION # => '5.0.0.alpha.1'
|
28
|
+
# Occi::Core::MAJOR_VERSION # => 5
|
29
|
+
# Occi::Core::MINOR_VERSION # => 0
|
30
|
+
# Occi::Core::PATCH_VERSION # => 0
|
31
|
+
# Occi::Core::STAGE_VERSION # => 'alpha.1'
|
32
|
+
#
|
33
|
+
# @author Boris Parak <parak@cesnet.cz>
|
21
34
|
module Core
|
35
|
+
autoload :Constants, 'occi/core/constants'
|
36
|
+
autoload :Errors, 'occi/core/errors'
|
37
|
+
autoload :Renderers, 'occi/core/renderers'
|
38
|
+
autoload :Helpers, 'occi/core/helpers'
|
39
|
+
autoload :Parsers, 'occi/core/parsers'
|
40
|
+
autoload :RendererFactory, 'occi/core/renderer_factory'
|
22
41
|
|
23
|
-
|
42
|
+
autoload :AttributeDefinition, 'occi/core/attribute_definition'
|
43
|
+
autoload :Category, 'occi/core/category'
|
44
|
+
autoload :Kind, 'occi/core/kind'
|
45
|
+
autoload :Action, 'occi/core/action'
|
46
|
+
autoload :Mixin, 'occi/core/mixin'
|
24
47
|
|
25
|
-
|
26
|
-
|
27
|
-
|
48
|
+
autoload :Attribute, 'occi/core/attribute'
|
49
|
+
autoload :ActionInstance, 'occi/core/action_instance'
|
50
|
+
autoload :Entity, 'occi/core/entity'
|
51
|
+
autoload :Link, 'occi/core/link'
|
52
|
+
autoload :Resource, 'occi/core/resource'
|
28
53
|
|
54
|
+
autoload :Collection, 'occi/core/collection'
|
55
|
+
autoload :Model, 'occi/core/model'
|
56
|
+
autoload :Warehouse, 'occi/core/warehouse'
|
57
|
+
autoload :InstanceBuilder, 'occi/core/instance_builder'
|
29
58
|
end
|
30
|
-
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Explicitly load monkey patches
|
62
|
+
require 'occi/monkey_island/boolean'
|
63
|
+
require 'occi/monkey_island/hash'
|
64
|
+
|
65
|
+
# Explicitly pull in versioning information
|
66
|
+
require 'occi/core/version'
|
@@ -1,126 +1,9 @@
|
|
1
1
|
module Occi
|
2
2
|
module Infrastructure
|
3
|
-
class
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
stop = Occi::Core::Action.new scheme='http://schemas.ogf.org/occi/infrastructure/compute/action#',
|
10
|
-
term='stop',
|
11
|
-
title='stop compute instance'
|
12
|
-
stop.attributes['method'] = {:mutable => true,
|
13
|
-
:pattern => 'graceful|acpioff|poweroff',
|
14
|
-
:default => 'poweroff'}
|
15
|
-
|
16
|
-
restart = Occi::Core::Action.new scheme='http://schemas.ogf.org/occi/infrastructure/compute/action#',
|
17
|
-
term='restart',
|
18
|
-
title='restart compute instance'
|
19
|
-
restart.attributes['method'] = {:mutable => true,
|
20
|
-
:pattern => 'graceful|warm|cold',
|
21
|
-
:default => 'cold'}
|
22
|
-
|
23
|
-
suspend = Occi::Core::Action.new scheme='http://schemas.ogf.org/occi/infrastructure/compute/action#',
|
24
|
-
term='suspend',
|
25
|
-
title='suspend compute instance'
|
26
|
-
suspend.attributes['method'] = {:mutable => true,
|
27
|
-
:pattern => 'hibernate|suspend',
|
28
|
-
:default => 'suspend'}
|
29
|
-
|
30
|
-
self.actions = Occi::Core::Actions.new << start << stop << restart << suspend
|
31
|
-
|
32
|
-
self.attributes = Occi::Core::Attributes.new(Occi::Core::Resource.attributes)
|
33
|
-
self.attributes['occi.compute.architecture'] = {:mutable => true,
|
34
|
-
:pattern => 'x86|x64'}
|
35
|
-
self.attributes['occi.compute.cores'] = {:type => 'number',
|
36
|
-
:mutable => true}
|
37
|
-
self.attributes['occi.compute.hostname'] = {:mutable => true,
|
38
|
-
:pattern => '(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*'}
|
39
|
-
self.attributes['occi.compute.memory'] = {:type => 'number',
|
40
|
-
:mutable => true}
|
41
|
-
self.attributes['occi.compute.speed'] = {:type => 'number',
|
42
|
-
:mutable => true}
|
43
|
-
self.attributes['occi.compute.state'] = {:type => 'string',
|
44
|
-
:pattern => 'inactive|active|suspended|error',
|
45
|
-
:default => 'inactive',
|
46
|
-
:mutable => false}
|
47
|
-
|
48
|
-
self.kind = Occi::Core::Kind.new scheme='http://schemas.ogf.org/occi/infrastructure#',
|
49
|
-
term='compute',
|
50
|
-
title = 'compute resource',
|
51
|
-
attributes=Occi::Core::Attributes.new(self.attributes),
|
52
|
-
parent=Occi::Core::Resource.kind,
|
53
|
-
actions = Occi::Core::Actions.new(self.actions),
|
54
|
-
location = '/compute/'
|
55
|
-
|
56
|
-
require 'occi/infrastructure/resource_tpl'
|
57
|
-
require 'occi/infrastructure/os_tpl'
|
58
|
-
self.mixins = Occi::Core::Mixins.new << Occi::Infrastructure::ResourceTpl.mixin << Occi::Infrastructure::OsTpl.mixin
|
59
|
-
|
60
|
-
def architecture
|
61
|
-
@attributes.occi_.compute_.architecture
|
62
|
-
end
|
63
|
-
|
64
|
-
def architecture=(architecture)
|
65
|
-
@attributes.occi!.compute!.architecture = architecture
|
66
|
-
end
|
67
|
-
|
68
|
-
def cores
|
69
|
-
@attributes.occi_.compute_.cores
|
70
|
-
end
|
71
|
-
|
72
|
-
def cores=(cores)
|
73
|
-
@attributes.occi!.compute!.cores = cores
|
74
|
-
end
|
75
|
-
|
76
|
-
def hostname
|
77
|
-
@attributes.occi_.compute_.hostname
|
78
|
-
end
|
79
|
-
|
80
|
-
def hostname=(hostname)
|
81
|
-
@attributes.occi!.compute!.hostname = hostname
|
82
|
-
end
|
83
|
-
|
84
|
-
def speed
|
85
|
-
@attributes.occi_.compute_.speed
|
86
|
-
end
|
87
|
-
|
88
|
-
def speed=(speed)
|
89
|
-
@attributes.occi!.compute!.speed = speed
|
90
|
-
end
|
91
|
-
|
92
|
-
def memory
|
93
|
-
@attributes.occi_.compute_.memory
|
94
|
-
end
|
95
|
-
|
96
|
-
def memory=(memory)
|
97
|
-
@attributes.occi!.compute!.memory = memory
|
98
|
-
end
|
99
|
-
|
100
|
-
def state
|
101
|
-
@attributes.occi_.compute_.state
|
102
|
-
end
|
103
|
-
|
104
|
-
def state=(state)
|
105
|
-
@attributes.occi!.compute!.state = state
|
106
|
-
end
|
107
|
-
|
108
|
-
def storagelink(target, mixins=[], attributes=Occi::Core::Attributes.new, kind=Occi::Infrastructure::Storagelink.kind)
|
109
|
-
link(target, kind, mixins, attributes, rel=Occi::Infrastructure::Storage.type_identifier)
|
110
|
-
end
|
111
|
-
|
112
|
-
def networkinterface(target, mixins=[], attributes=Occi::Core::Attributes.new, kind=Occi::Infrastructure::Networkinterface.kind)
|
113
|
-
link(target, kind, mixins, attributes, rel=Occi::Infrastructure::Network.type_identifier)
|
114
|
-
end
|
115
|
-
|
116
|
-
def storagelinks
|
117
|
-
@links.select { |link| link.kind == Occi::Infrastructure::Storagelink.kind }
|
118
|
-
end
|
119
|
-
|
120
|
-
def networkinterfaces
|
121
|
-
@links.select { |link| link.kind == Occi::Infrastructure::Networkinterface.kind }
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
3
|
+
# Dummy sub-class of `Occi::Core::Resource` meant to simplify handling
|
4
|
+
# of known instances of the given sub-class. Does not contain any functionality.
|
5
|
+
#
|
6
|
+
# @author Boris Parak <parak@cesnet.cz>
|
7
|
+
class Compute < Occi::Core::Resource; end
|
125
8
|
end
|
126
9
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Occi
|
2
|
+
module Infrastructure
|
3
|
+
# Module containing important constats defined in OGF's Infrastructure document.
|
4
|
+
# Here, you can find commonly used kind identifiers for `Compute`, `Network`,
|
5
|
+
# `Storage`, and others.
|
6
|
+
#
|
7
|
+
# @author Boris Parak <parak@cesnet.cz>
|
8
|
+
module Constants
|
9
|
+
# Resource sub-types
|
10
|
+
COMPUTE_KIND = 'http://schemas.ogf.org/occi/infrastructure#compute'.freeze
|
11
|
+
NETWORK_KIND = 'http://schemas.ogf.org/occi/infrastructure#network'.freeze
|
12
|
+
STORAGE_KIND = 'http://schemas.ogf.org/occi/infrastructure#storage'.freeze
|
13
|
+
|
14
|
+
# Link sub-types
|
15
|
+
NETWORKINTERFACE_KIND = 'http://schemas.ogf.org/occi/infrastructure#networkinterface'.freeze
|
16
|
+
STORAGELINK_KIND = 'http://schemas.ogf.org/occi/infrastructure#storagelink'.freeze
|
17
|
+
|
18
|
+
# Mixins
|
19
|
+
IPNETWORK_MIXIN = 'http://schemas.ogf.org/occi/infrastructure/network#ipnetwork'.freeze
|
20
|
+
IPNETWORKINTERFACE_MIXIN = 'http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface'.freeze
|
21
|
+
OS_TPL_MIXIN = 'http://schemas.ogf.org/occi/infrastructure#os_tpl'.freeze
|
22
|
+
RESOURCE_TPL_MIXIN = 'http://schemas.ogf.org/occi/infrastructure#resource_tpl'.freeze
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|