Module: CIMI::Model

Included in:
API, Collections::Base
Defined in:
lib/cimi/models/base.rb,
lib/cimi/models.rb,
lib/cimi/helpers.rb,
lib/cimi/models/errors.rb,
lib/cimi/models/collection.rb

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Classes: Action, Address, AddressTemplate, BadRequest, Base, CloudEntryPoint, Collection, Credential, Disk, ForwardingGroup, ForwardingGroupTemplate, Machine, MachineConfiguration, MachineImage, MachineTemplate, MachineVolume, Network, NetworkConfiguration, NetworkPort, NetworkPortConfiguration, NetworkPortTemplate, NetworkTemplate, NotFound, NotImplemented, Resource, ResourceMetadata, Schema, UnsupportedMediaType, Volume, VolumeConfiguration, VolumeImage, VolumeTemplate

Class Method Summary collapse

Class Method Details

.register_as_root_entity!(klass, opts = {}) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/cimi/models/base.rb', line 74

def self.register_as_root_entity!(klass, opts = {})
  @root_entities ||= [CIMI::Model::CloudEntryPoint]
  @root_entities << klass
  name = klass.name.split("::").last.pluralize
  unless CIMI::Model::CloudEntryPoint.href_defined?(name)
    params = {}
    if opts[:as]
      params[:xml_name] = params[:json_name] = opts[:as]
    end
    CIMI::Model::CloudEntryPoint.send(:href, name.underscore, params)
  end
end

.root_entitiesObject



87
88
89
# File 'lib/cimi/models/base.rb', line 87

def self.root_entities
  @root_entities || []
end