Module: Orchestrate::API::Procedural

Included in:
Wrapper
Defined in:
lib/orchestrate_api/procedural.rb

Overview

Procedural interface methods (optional).

This file serves as useful documentation for the Orchestrate.io REST API. Each method illustrates an example for the corresponding HTTP request, and documents the required keys for the send_request argument hash.

Instance Method Summary collapse

Instance Method Details

#delete_collection(args) ⇒ Object

  • required: { collection }



29
30
31
# File 'lib/orchestrate_api/procedural.rb', line 29

def delete_collection(args)
  send_request :delete, args.merge(path: "?force=true")
end

#delete_graph(args) ⇒ Object

  • required: { collection, key, kind, to_collection, to_key }



115
116
117
# File 'lib/orchestrate_api/procedural.rb', line 115

def delete_graph(args)
  send_request :delete, args.merge(path: "?purge=true")
end

#delete_key(args) ⇒ Object

  • required: { collection, key }



50
51
52
# File 'lib/orchestrate_api/procedural.rb', line 50

def delete_key(args)
  send_request :delete, args
end

#get_by_ref(args) ⇒ Object

  • required: { collection, key, ref }



65
66
67
# File 'lib/orchestrate_api/procedural.rb', line 65

def get_by_ref(args)
  send_request :get, args
end

#get_events(args) ⇒ Object

  • required: { collection, key, event_type }

  • optional: { timestamp }, where timestamp = { :start => start, :end => end }



87
88
89
# File 'lib/orchestrate_api/procedural.rb', line 87

def get_events(args)
  send_request :get, args
end

#get_graph(args) ⇒ Object

  • required: { collection, key, kind }



103
104
105
# File 'lib/orchestrate_api/procedural.rb', line 103

def get_graph(args)
  send_request :get, args
end

#get_key(args) ⇒ Object

  • required: { collection, key }



38
39
40
# File 'lib/orchestrate_api/procedural.rb', line 38

def get_key(args)
  send_request :get, args
end

#list(args) ⇒ Object

  • required: { collection }

  • optional: { path }, which should have been called params



17
18
19
# File 'lib/orchestrate_api/procedural.rb', line 17

def list(args)
  send_request :get, args
end

#purge_key(args) ⇒ Object

  • required: { collection, key }



56
57
58
# File 'lib/orchestrate_api/procedural.rb', line 56

def purge_key(args)
  send_request :delete, args.merge(path: "?purge=true")
end

#put_event(args) ⇒ Object

  • required: { collection, key, event_type, json }

  • optional: { timestamp }, where timestamp is a scalar value



94
95
96
# File 'lib/orchestrate_api/procedural.rb', line 94

def put_event(args)
  send_request :put, args
end

#put_graph(args) ⇒ Object

  • required: { collection, key, kind, to_collection, to_key }



109
110
111
# File 'lib/orchestrate_api/procedural.rb', line 109

def put_graph(args)
  send_request :put, args
end

#put_key(args) ⇒ Object

  • required: { collection, key, json }



44
45
46
# File 'lib/orchestrate_api/procedural.rb', line 44

def put_key(args)
  send_request :put, args
end

#put_key_if_match(args) ⇒ Object

  • required: { collection, key, json, ref }



71
72
73
# File 'lib/orchestrate_api/procedural.rb', line 71

def put_key_if_match(args)
  send_request :put, args
end

#put_key_if_none_match(args) ⇒ Object

  • required: { collection, key, json }



77
78
79
# File 'lib/orchestrate_api/procedural.rb', line 77

def put_key_if_none_match(args)
  send_request :put, args.merge(ref: '"*"')
end

#search(args) ⇒ Object

  • required: { collection }



23
24
25
# File 'lib/orchestrate_api/procedural.rb', line 23

def search(args)
  send_request :get, args.merge(path: "?query=#{args[:query].gsub(/\s/, '%20')}")
end