def initialize(client, name, type, domain, scale=nil, gear_profile='default', initial_git_url=nil, environment_variables=nil, region=nil)
super({}, client)
@name = name
@domain = domain
@cartridges = []
@creation_time = Date.new(2000, 1, 1).strftime('%Y-%m-%dT%H:%M:%S%z')
@uuid = fakeuuid
@initial_git_url = initial_git_url
@git_url = "git:fake.foo/git/#{@name}.git"
@app_url = "https://#{@name}-#{@domain.name}.fake.foo/"
@ssh_url = "ssh://#{@uuid}@127.0.0.1"
@aliases = []
@environment_variables = environment_variables || []
@gear_profile = gear_profile
@auto_deploy = true
@keep_deployments = 1
if scale
@scalable = true
end
@region = region
self.attributes = {:links => mock_response_links(mock_app_links('mock_domain_0', 'mock_app_0')), :messages => []}
self.gear_count = 5
types = Array(type)
cart = add_cartridge(types.first, true) if types.first
if scale
cart.supported_scales_to = (cart.scales_to = -1)
cart.supported_scales_from = (cart.scales_from = 2)
cart.current_scale = 2
cart.scales_with = "haproxy-1.4"
prox = add_cartridge('haproxy-1.4')
prox.collocated_with = [types.first]
prox.tags = ['web_proxy']
end
types.drop(1).each{ |c| add_cartridge(c, false) }
@framework = types.first
end