Module: StackMate

Defined in:
lib/stackmate/stackpi.rb,
lib/stackmate/stack.rb,
lib/stackmate/client.rb,
lib/stackmate/logging.rb,
lib/stackmate/version.rb,
lib/stackmate/classmap.rb,
lib/stackmate/metadata.rb,
lib/stackmate/resolver.rb,
lib/stackmate/stack_server.rb,
lib/stackmate/stack_executor.rb,
lib/stackmate/intrinsic_functions.rb,
lib/stackmate/participants/common.rb,
lib/stackmate/waitcondition_server.rb,
lib/stackmate/participants/cloudstack.rb,
lib/stackmate/participants/cloudstack_iso.rb,
lib/stackmate/participants/cloudstack_vpc.rb,
lib/stackmate/participants/cloudstack_tags.rb,
lib/stackmate/participants/cloudstack_volume.rb,
lib/stackmate/participants/cloudstack_iptonic.rb,
lib/stackmate/participants/cloudstack_network.rb,
lib/stackmate/participants/cloudstack_project.rb,
lib/stackmate/participants/cloudstack_vpnuser.rb,
lib/stackmate/participants/cloudstack_snapshot.rb,
lib/stackmate/participants/cloudstack_template.rb,
lib/stackmate/participants/cloudstack_condition.rb,
lib/stackmate/participants/cloudstack_ipaddress.rb,
lib/stackmate/participants/cloudstack_staticnat.rb,
lib/stackmate/participants/cloudstack_volumeops.rb,
lib/stackmate/participants/cloudstack_networkacl.rb,
lib/stackmate/participants/cloudstack_sshkeypair.rb,
lib/stackmate/participants/cloudstack_vmsnapshot.rb,
lib/stackmate/participants/cloudstack_vpngateway.rb,
lib/stackmate/participants/cloudstack_staticroute.rb,
lib/stackmate/participants/cloudstack_firewallrule.rb,
lib/stackmate/participants/cloudstack_loadbalancer.rb,
lib/stackmate/participants/cloudstack_affinitygroup.rb,
lib/stackmate/participants/cloudstack_instancegroup.rb,
lib/stackmate/participants/cloudstack_securitygroup.rb,
lib/stackmate/participants/cloudstack_vpnconnection.rb,
lib/stackmate/participants/cloudstack_networkacllist.rb,
lib/stackmate/participants/cloudstack_snapshotpolicy.rb,
lib/stackmate/participants/cloudstack_virtualmachine.rb,
lib/stackmate/participants/cloudstack_autoscalepolicy.rb,
lib/stackmate/participants/cloudstack_remoteaccessvpn.rb,
lib/stackmate/participants/cloudstack_autoscalevmgroup.rb,
lib/stackmate/participants/cloudstack_ipforwardingrule.rb,
lib/stackmate/participants/cloudstack_loadbalancerrule.rb,
lib/stackmate/participants/cloudstack_virtualmachineops.rb,
lib/stackmate/participants/cloudstack_autoscalevmprofile.rb,
lib/stackmate/participants/cloudstack_egressfirewallrule.rb,
lib/stackmate/participants/cloudstack_lbstickinesspolicy.rb,
lib/stackmate/participants/cloudstack_portforwardingrule.rb,
lib/stackmate/participants/cloudstack_toloadbalancerrule.rb,
lib/stackmate/participants/cloudstack_vpncustomergateway.rb,
lib/stackmate/participants/cloudstack_lbhealthcheckpolicy.rb,
lib/stackmate/participants/cloudstack_nictovirtualmachine.rb,
lib/stackmate/participants/cloudstack_securitygroupegress.rb,
lib/stackmate/participants/cloudstack_securitygroupingress.rb,
lib/stackmate/participants/cloudstack_globalloadbalancerrule.rb,
lib/stackmate/participants/cloudstack_togloballoadbalancerrule.rb

Overview

API for creating stack TODO clean up repeated code

Defined Under Namespace

Modules: Intrinsic, Logging, Resolver, StackPi Classes: CloudStackAffinityGroup, CloudStackApiException, CloudStackAutoScalePolicy, CloudStackAutoScaleVmGroup, CloudStackAutoScaleVmProfile, CloudStackClient, CloudStackCondition, CloudStackEgressFirewallRule, CloudStackFirewallRule, CloudStackGlobalLoadBalancerRule, CloudStackInstance, CloudStackInstanceGroup, CloudStackIpAddress, CloudStackIpForwardingRule, CloudStackIpToNic, CloudStackIso, CloudStackLBHealthCheckPolicy, CloudStackLBStickinessPolicy, CloudStackLoadBalancer, CloudStackLoadBalancerRule, CloudStackNetwork, CloudStackNetworkACL, CloudStackNetworkACLList, CloudStackNicToVirtualMachine, CloudStackOutput, CloudStackPortForwardingRule, CloudStackProject, CloudStackRemoteAccessVpn, CloudStackResource, CloudStackSSHKeyPair, CloudStackSecurityGroup, CloudStackSecurityGroupAWS, CloudStackSecurityGroupEgress, CloudStackSecurityGroupIngress, CloudStackSnapshot, CloudStackSnapshotPolicy, CloudStackStaticNat, CloudStackStaticRoute, CloudStackTags, CloudStackTemplate, CloudStackToGlobalLoadBalancerRule, CloudStackToLoadBalancerRule, CloudStackVMSnapshot, CloudStackVPC, CloudStackVirtualMachine, CloudStackVirtualMachineOps, CloudStackVolume, CloudStackVolumeOps, CloudStackVpnConnection, CloudStackVpnCustomerGateway, CloudStackVpnGateway, CloudStackVpnUser, Metadata, NoOpResource, Output, StackExecutor, StackNest, StackNotifier, StackServer, Stacker, WaitCondition, WaitConditionHandle, WaitConditionServer

Constant Summary collapse

VERSION =
"0.2.0"
PROFILES =
['CLOUDSTACK', 'NOOP']
CS_CLASS_MAP =
{
  'AWS::CloudFormation::WaitConditionHandle' => 'StackMate::WaitConditionHandle',
  'AWS::CloudFormation::WaitCondition' => 'StackMate::WaitCondition',
  'AWS::EC2::Instance' => 'StackMate::CloudStackInstance',
  'AWS::EC2::SecurityGroup' => 'StackMate::CloudStackSecurityGroupAWS',
  'Outputs' => 'StackMate::CloudStackOutput',
}
WAIT_COND_URL_BASE_DEFAULT =
'http://localhost:4567/'

Class Method Summary collapse

Class Method Details

.class_for(cf_resource) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/stackmate/classmap.rb', line 13

def StackMate.class_for(cf_resource)
  #return cf_resource
  case @profile
  when 'CLOUDSTACK'
    if(cf_resource.start_with?("CloudStack::"))
      c = cf_resource.split('::')[1]
      "StackMate::CloudStack"+c
    elsif(CS_CLASS_MAP.has_key?(cf_resource))
      CS_CLASS_MAP[cf_resource]
    else
      cf_resource
    end
  when 'NOOP'
    if cf_resource == 'Outputs'
      'StackMate::Output'
    else
      'StackMate::NoOpResource'
    end
  end
end

.configure(profile) ⇒ Object



34
35
36
# File 'lib/stackmate/classmap.rb', line 34

def StackMate.configure(profile)
  @profile = profile
end

.log_levelObject



14
15
16
# File 'lib/stackmate/logging.rb', line 14

def StackMate.log_level
  @log_lvl
end

.set_log_level(lvl) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/stackmate/logging.rb', line 5

def StackMate.set_log_level(lvl)
  case lvl
  when 'info'
    @log_lvl = Logger::INFO
  when 'debug'
    @log_lvl = Logger::DEBUG
  end
end