Module: Agilix::Buzz::Commands::General
- Included in:
- Api
- Defined in:
- lib/agilix/buzz/commands/general.rb
Instance Method Summary collapse
-
#echo(options = {}) ⇒ Object
api.echo test: ‘param’.
-
#get_basic_status(options = {}) ⇒ Object
this is a non-authenticated call api.get_status.
-
#get_command_list ⇒ Object
api.get_command_list.
-
#get_entity_type(options = {}) ⇒ Object
ISSUE: nothing saying this is an authenticated call, when others are non-authenticated api.get_entity_type entityid: 57025.
-
#get_status(options = {}) ⇒ Object
ISSUE: docs in getting started reference a ‘level` param, actual docs suggest using rating api.get_status rating: 4, html: true, sms: true.
-
#get_upload_limits(options = {}) ⇒ Object
ISSUE: Docs have cmd spelled wrong, this API doesn’t seem to work at all AccessDenied.
-
#send_mail(options = {}) ⇒ Object
api.send_mail subject: “Test email”, body: “Did you get this?”, enrollmentid: 60997, enrollment_ids: [“all”].
Instance Method Details
#echo(options = {}) ⇒ Object
api.echo test: ‘param’
7 8 9 |
# File 'lib/agilix/buzz/commands/general.rb', line 7 def echo(= {}) post cmd: "echo", ** end |
#get_basic_status(options = {}) ⇒ Object
this is a non-authenticated call api.get_status
32 33 34 35 |
# File 'lib/agilix/buzz/commands/general.rb', line 32 def get_basic_status( = {}) = argument_cleaner(required_params: %i( ), optional_params: %i( rating sms html ), options: ) get cmd: "getstatus", ** end |
#get_command_list ⇒ Object
api.get_command_list
12 13 14 |
# File 'lib/agilix/buzz/commands/general.rb', line 12 def get_command_list get cmd: "getcommandlist" end |
#get_entity_type(options = {}) ⇒ Object
ISSUE: nothing saying this is an authenticated call, when others are non-authenticated api.get_entity_type entityid: 57025
18 19 20 21 |
# File 'lib/agilix/buzz/commands/general.rb', line 18 def get_entity_type( = {}) = argument_cleaner(required_params: %i( entityid ), optional_params: %i( select ), options: ) authenticated_get cmd: "getentitytype", ** end |
#get_status(options = {}) ⇒ Object
ISSUE: docs in getting started reference a ‘level` param, actual docs suggest using rating api.get_status rating: 4, html: true, sms: true
25 26 27 28 |
# File 'lib/agilix/buzz/commands/general.rb', line 25 def get_status( = {}) = argument_cleaner(required_params: %i( ), optional_params: %i( rating sms html ), options: ) authenticated_get cmd: "getstatus", ** end |
#get_upload_limits(options = {}) ⇒ Object
ISSUE: Docs have cmd spelled wrong, this API doesn’t seem to work at all AccessDenied. It did say experimental api.get_upload_limits api.get_upload_limits domainid: 57025
40 41 42 43 |
# File 'lib/agilix/buzz/commands/general.rb', line 40 def get_upload_limits( = {}) = argument_cleaner(required_params: %i( ), optional_params: %i( userid domainid ), options: ) get cmd: "getuploadlimits", ** end |
#send_mail(options = {}) ⇒ Object
api.send_mail subject: “Test email”, body: “Did you get this?”, enrollmentid: 60997, enrollment_ids: [“all”]
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/agilix/buzz/commands/general.rb', line 46 def send_mail( = {}) = argument_cleaner(required_params: %i( subject body enrollmentid enrollment_ids ), optional_params: %i( groups roles strings), options: ) request = {email: { subject: {"$value" => [:subject]}, body: {"$value" => [:body]}, enrollments: {enrollment: [:enrollment_ids].map {|id| {id: id} } } }} request[:email][:groups] = {group: [:groups].map {|id| {id: id} } } if [:groups] request[:email][:roles] = {role: [:roles].map {|id| {id: id} } } if [:roles] if [:strings] request[:email][:strings] = [:strings].map do |k,v| [ k , {"$value" => v } ] end.to_h end enrollment_response = self.get_enrollment enrollmentid: [:enrollmentid] user_id = enrollment_response.dig("response", "enrollment", "userid") proxy_api = self.proxy_api userid: user_id proxy_api.authenticated_query_post query_params: {cmd: "sendmail", enrollmentid: [:enrollmentid] }, **request end |