Sha256: 4b96fe2780449501797a57c98e0e6a6ed1ff109db15736b3d9197cdb1c07c85f
Contents?: true
Size: 1.41 KB
Versions: 4
Compression:
Stored size: 1.41 KB
Contents
require 'fog/huaweicloud/models/collection' require 'fog/orchestration/huaweicloud/models/template' module Fog module Orchestration class HuaweiCloud class Templates < Fog::HuaweiCloud::Collection model Fog::Orchestration::HuaweiCloud::Template def get(obj) data = if obj.kind_of?(Stack) service.get_stack_template(obj).body else service.show_resource_template(obj.resource_name).body end if data.key?('AWSTemplateFormatVersion') data['content'] = data.to_json data['format'] = 'CFN' data['template_version'] = data.delete('AWSTemplateFormatVersion') data['description'] = data.delete('Description') data['parameter'] = data.delete('Parameters') data['resources'] = data.delete('Resources') else data['content'] = data.to_yaml data['format'] = 'HOT' data['template_version'] = data.delete('heat_template_version') end new(data) rescue Fog::Orchestration::HuaweiCloud::NotFound nil end def validate(options = {}) data = service.validate_template(options).body temp = new temp.parameters = data['Parameters'] temp.description = data['Description'] temp end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems