class Fog::OpenStack::Workflow::V2::Mock

Public Class Methods

data() click to toggle source
# File lib/fog/openstack/workflow/v2.rb, line 69
def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {
      :workflows => {}
    }
  end
end
new(options = {}) click to toggle source
# File lib/fog/openstack/workflow/v2.rb, line 83
def initialize(options = {})
  @auth_token = Fog::Mock.random_base64(64)
  @auth_token_expiration = (Time.now.utc + 86_400).iso8601
end
reset() click to toggle source
# File lib/fog/openstack/workflow/v2.rb, line 77
def self.reset
  @data = nil
end

Public Instance Methods

create_action(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_action.rb, line 18
def create_action(_definition)
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_action_execution(_action, _input = {}, _params = {}) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_action_execution.rb, line 21
def create_action_execution(_action, _input = {}, _params = {})
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_cron_trigger(_name, _workflow_identifier, _workflow_input = nil, _workflow_params = nil, _pattern = nil, _first_time = nil, _count = nil) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_cron_trigger.rb, line 39
def create_cron_trigger(_name,
                        _workflow_identifier,
                        _workflow_input = nil,
                        _workflow_params = nil,
                        _pattern = nil,
                        _first_time = nil,
                        _count = nil)
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_environment(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_environment.rb, line 21
def create_environment(_definition)
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_execution(_workflow, _input = {}) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_execution.rb, line 20
def create_execution(_workflow, _input = {})
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_workbook(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_workbook.rb, line 18
def create_workbook(_definition)
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
create_workflow(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/create_workflow.rb, line 18
def create_workflow(_definition)
  response = Excon::Response.new
  response.status = 201
  response.body = ""
  response
end
data() click to toggle source
# File lib/fog/openstack/workflow/v2.rb, line 88
def data
  self.class.data[@openstack_username]
end
delete_action(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_action.rb, line 16
def delete_action(_name)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_action_execution(_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_action_execution.rb, line 16
def delete_action_execution(_id)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_cron_trigger(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_cron_trigger.rb, line 16
def delete_cron_trigger(_name)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_environment(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_environment.rb, line 16
def delete_environment(_name)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_execution(_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_execution.rb, line 16
def delete_execution(_id)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_workbook(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_workbook.rb, line 16
def delete_workbook(_name)
  response = Excon::Response.new
  response.status = 204
  response
end
delete_workflow(_identifier) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/delete_workflow.rb, line 16
def delete_workflow(_identifier)
  response = Excon::Response.new
  response.status = 204
  response
end
get_action(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_action.rb, line 16
def get_action(_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {"version" => "2.0",
                   "action1" => {"input" => ['test_id']}}
  response
end
get_action_execution(_execution_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_action_execution.rb, line 16
def get_action_execution(_execution_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {"state" => "running", "id" => "1111"}
  response
end
get_cron_trigger(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_cron_trigger.rb, line 16
def get_cron_trigger(_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {"version"     => "2.0",
                   "name"        => "cron_trigger1",
                   "description" => "d1"}
  response
end
get_environment(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_environment.rb, line 16
def get_environment(_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {"name"      => "environment1",
                   "variables" => {"var1" => "value1",
                                   "var2" => "value2"}}
  response
end
get_execution(_execution_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_execution.rb, line 16
def get_execution(_execution_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {"state" => "running", "id" => "1111"}
  response
end
get_task(_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_task.rb, line 16
def get_task(_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {"version" => "2.0",
                   "task1"   => {"id" => ['test_id']}}
  response
end
get_workbook(_name) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_workbook.rb, line 16
def get_workbook(_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {"version"     => "2.0",
                   "name"        => "workbook1",
                   "description" => "d1"}
  response
end
get_workflow(_identifier) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/get_workflow.rb, line 16
def get_workflow(_identifier)
  response = Excon::Response.new
  response.status = 200
  response.body = {"version"     => "2.0",
                   "name"        => "workflow1",
                   "description" => "d1"}
  response
end
list_action_executions() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_action_executions.rb, line 16
def list_action_executions
  response = Excon::Response.new
  response.status = 200
  response.body = {"action_executions" =>
                                          [{"state" => "ERROR", "id" => "1111"},
                                           {"state" => "RUNNING", "id" => "2222"}]}
  response
end
list_actions(_params = {}) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_actions.rb, line 18
def list_actions(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {"actions" =>
                                [{"name" => "action1", "description" => "d1"},
                                 {"name" => "action2", "description" => "d2"}]}
  response
end
list_cron_triggers() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_cron_triggers.rb, line 16
def list_cron_triggers
  response = Excon::Response.new
  response.status = 200
  response.body = {"cron_triggers" =>
                                      [{"name" => "cron_trigger1", "description" => "d1"},
                                       {"name" => "cron_trigger2", "description" => "d2"}]}
  response
end
list_environments() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_environments.rb, line 16
def list_environments
  response = Excon::Response.new
  response.status = 200
  response.body = {"environments" =>
                                     [{"name" => "environment1", "description" => "d1"},
                                      {"name" => "environment2", "description" => "d2"}]}
  response
end
list_executions() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_executions.rb, line 16
def list_executions
  response = Excon::Response.new
  response.status = 200
  response.body = {"executions" =>
                                   [{"state" => "ERROR", "id" => "1111"},
                                    {"state" => "RUNNING", "id" => "2222"}]}
  response
end
list_services() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_services.rb, line 16
def list_services
  response = Excon::Response.new
  response.status = 200
  response.body = {"services" =>
                                 [{"name" => "service1", "description" => "d1"},
                                  {"name" => "service2", "description" => "d2"}]}
  response
end
list_tasks(_workflow_execution_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_tasks.rb, line 16
def list_tasks(_workflow_execution_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {"tasks" =>
                              [{"name" => "task1", "description" => "d1"},
                               {"name" => "task2", "description" => "d2"}]}
  response
end
list_workbooks() click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_workbooks.rb, line 16
def list_workbooks
  response = Excon::Response.new
  response.status = 200
  response.body = {"workbooks" =>
                                  [{"name" => "workbook1", "description" => "d1"},
                                   {"name" => "workbook2", "description" => "d2"}]}
  response
end
list_workflows(_params = {}) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/list_workflows.rb, line 18
def list_workflows(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {"workflows" =>
                                  [{"name" => "workflow1", "description" => "d1"},
                                   {"name" => "workflow2", "description" => "d2"}]}
  response
end
reset_data() click to toggle source
# File lib/fog/openstack/workflow/v2.rb, line 92
def reset_data
  self.class.data.delete(@openstack_username)
end
update_action(_task_ex_id) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/rerun_task.rb, line 23
def update_action(_task_ex_id)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
update_action_execution(_id, _name, _value) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/update_action_execution.rb, line 23
def update_action_execution(_id, _name, _value)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
update_environment(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/update_environment.rb, line 21
def update_environment(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
update_execution(_id, _name, _value) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/update_execution.rb, line 23
def update_execution(_id, _name, _value)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
update_workbook(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/update_workbook.rb, line 18
def update_workbook(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
update_workflow(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/update_workflow.rb, line 18
def update_workflow(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = ""
  response
end
validate_action(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/validate_action.rb, line 18
def validate_action(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = "{\"valid\": true}"
  response
end
validate_workbook(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/validate_workbook.rb, line 18
def validate_workbook(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = "{\"valid\": true}"
  response
end
validate_workflow(_definition) click to toggle source
# File lib/fog/openstack/workflow/v2/requests/validate_workflow.rb, line 18
def validate_workflow(_definition)
  response = Excon::Response.new
  response.status = 200
  response.body = "{\"valid\": true}"
  response
end