abandon_stack(stack)
click to toggle source
def abandon_stack(stack)
request(
:expects => [200],
:method => 'DELETE',
:path => "stacks/#{stack.stack_name}/#{stack.id}/abandon"
)
end
authenticate(options={})
click to toggle source
def authenticate(options={})
super({
:rackspace_api_key => @rackspace_api_key,
:rackspace_username => @rackspace_username,
:rackspace_auth_url => @rackspace_auth_url,
:connection_options => @connection_options
})
end
build_info()
click to toggle source
def build_info
request(
:expects => [200],
:method => 'GET',
:path => 'build_info'
)
end
create_stack(options={})
click to toggle source
def create_stack(options={})
request(
:body => Fog::JSON.encode(options),
:expects => [201],
:method => 'POST',
:path => "stacks"
)
end
delete_stack(stack)
click to toggle source
def delete_stack(stack)
request(
:expects => [204],
:method => 'DELETE',
:path => "stacks/#{stack.stack_name}/#{stack.id}"
)
end
endpoint_uri(service_endpoint_url=nil)
click to toggle source
def endpoint_uri(service_endpoint_url=nil)
@uri = super(@rackspace_endpoint || service_endpoint_url, :rackspace_orchestration_url)
end
get_stack_template(stack)
click to toggle source
def get_stack_template(stack)
request(
:method => 'GET',
:path => "stacks/#{stack.stack_name}/#{stack.id}/template",
:expects => 200
)
end
list_resource_events(stack, resource, options={})
click to toggle source
def list_resource_events(stack, resource, options={})
uri = request_uri("stacks/#{stack.stack_name}/#{stack.id}/resources/#{resource.resource_name}/events", options)
request(:method => 'GET', :path => uri, :expects => 200)
end
list_resource_types()
click to toggle source
def list_resource_types
request(
:method => 'GET',
:path => "resource_types",
:expects => 200
)
end
list_resources(stack, options={})
click to toggle source
def list_resources(stack, options={})
uri = request_uri("stacks/#{stack.stack_name}/#{stack.id}/resources", options)
request(:method => 'GET', :path => uri, :expects => 200)
end
list_stack_data(options={})
click to toggle source
def list_stack_data(options={})
request(
:method => 'GET',
:path => request_uri("stacks", options),
:expects => 200
)
end
list_stack_events(stack, options={})
click to toggle source
def list_stack_events(stack, options={})
uri = request_uri("stacks/#{stack.stack_name}/#{stack.id}/events", options)
request(:method => 'GET', :path => uri, :expects => 200)
end
preview_stack(options = {})
click to toggle source
def preview_stack(options = {})
request(
:body => Fog::JSON.encode(options),
:expects => [200],
:method => 'POST',
:path => 'stacks/preview'
)
end
region()
click to toggle source
def region
@rackspace_region
end
request(params, parse_json = true)
click to toggle source
def request(params, parse_json = true)
super
rescue Excon::Errors::NotFound => error
raise NotFound.slurp(error, self)
rescue Excon::Errors::BadRequest => error
raise BadRequest.slurp(error, self)
rescue Excon::Errors::InternalServerError => error
raise InternalServerError.slurp(error, self)
rescue Excon::Errors::HTTPStatusError => error
raise ServiceError.slurp(error, self)
end
request_uri(path, options={})
click to toggle source
def request_uri(path, options={})
return path if options == {}
require "addressable/uri"
Addressable::URI.new({:path=>path, :query_values=>options}).request_uri
end
service_name()
click to toggle source
def service_name
:cloudOrchestration
end
show_event_details(stack, resource, event_id)
click to toggle source
def show_event_details(stack, resource, event_id)
request(
:method => 'GET',
:path => "stacks/#{stack.stack_name}/#{stack.id}/resources/#{resource.resource_name}/events/#{event_id}",
:expects => 200
)
end
show_resource_data(stack_name, stack_id, resource_name)
click to toggle source
def show_resource_data(stack_name, stack_id, resource_name)
request(
:method => 'GET',
:path => "stacks/#{stack_name}/#{stack_id}/resources/#{resource_name}",
:expects => 200
)
end
show_resource_schema(name)
click to toggle source
def show_resource_schema(name)
request(
:method => 'GET',
:path => "resource_types/#{name}",
:expects => 200
)
end
show_resource_template(name)
click to toggle source
def show_resource_template(name)
request(
:method => 'GET',
:path => "resource_types/#{name}/template",
:expects => 200
)
end
show_stack_details(name, id)
click to toggle source
def show_stack_details(name, id)
request(
:method => 'GET',
:path => "stacks/#{name}/#{id}",
:expects => 200
)
end
update_stack(stack, options = {})
click to toggle source
def update_stack(stack, options = {})
request(
:body => Fog::JSON.encode(options),
:expects => [202],
:method => 'PUT',
:path => "stacks/#{stack.stack_name}/#{stack.id}"
)
end
validate_template(options = {})
click to toggle source
def validate_template(options = {})
request(
:body => Fog::JSON.encode(options),
:expects => [200],
:method => 'POST',
:path => 'validate'
)
end