agilix 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +123 -23
- data/lib/agilix.rb +1 -0
- data/lib/agilix/buzz/api.rb +20 -0
- data/lib/agilix/buzz/commands/enrollment.rb +140 -0
- data/lib/agilix/buzz/commands/general.rb +58 -2
- data/lib/agilix/version.rb +1 -1
- data/stats.html +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13bbcf27a8daa395a4e36a627dc9deb051ca2eb6d59d8b7461e75d2f5e002001
|
4
|
+
data.tar.gz: 4868b13937a95a056514a5b084a6da3b3bdec86f0032de5af76f6e7d47984ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28650a6f11ff0d3bb4aa4d0f4e4597679d889392cee1436c2827459d0fdfc6c30f707c7fb9797ea07db75873da0bd81bcb5a6b23042d2677c9b8d6641d18ca63
|
7
|
+
data.tar.gz: 6edb84ced7f75aad3c80be7018e866d1be80689e19fe5fcf8ba2dc61ca43a61899ffe29ed149b1bc55f50c57aab42be3c57a086a48f93675846f272ad6848545
|
data/README.md
CHANGED
@@ -374,20 +374,129 @@ api.update_courses [{courseid: 60994, title: "Updated Course"}]
|
|
374
374
|
|
375
375
|
## Enrollments
|
376
376
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
377
|
+
#### [CreateEnrollments](https://api.agilixbuzz.com/docs/#!/Command/CreateEnrollments)
|
378
|
+
ISSUE: API format is very inconsistent on this one, requires both query string modification & body modification
|
379
|
+
```
|
380
|
+
api.create_enrollments [{userid: 57026, entityid: 57025}]
|
381
|
+
```
|
382
|
+
|
383
|
+
#### [DeleteEnrollments](https://api.agilixbuzz.com/docs/#!/Command/DeleteEnrollments)
|
384
|
+
ISSUE: Inconsistent from other delete apis. many are singular, not plural
|
385
|
+
```
|
386
|
+
api.delete_enrollments [ { enrollmentid: 60997 }]
|
387
|
+
```
|
388
|
+
|
389
|
+
#### [GetEnrollment3](https://api.agilixbuzz.com/docs/#!/Command/GetEnrollment3)
|
390
|
+
This is aliased to `get_enrollment`
|
391
|
+
```
|
392
|
+
api.get_enrollment enrollmentid: 60997
|
393
|
+
```
|
394
|
+
|
395
|
+
#### [GetEnrollmentActivity](https://api.agilixbuzz.com/docs/#!/Command/GetEnrollmentActivity)
|
396
|
+
```
|
397
|
+
api.get_enrollment_activity enrollmentid: 60997
|
398
|
+
```
|
399
|
+
|
400
|
+
#### [GetEnrollmentGradebook2](https://api.agilixbuzz.com/docs/#!/Command/GetEnrollmentGradebook2)
|
401
|
+
```
|
402
|
+
api.get_enrollment_gradebook enrollmentid: 60997
|
403
|
+
```
|
404
|
+
|
405
|
+
#### [GetEnrollmentGroupList](https://api.agilixbuzz.com/docs/#!/Command/GetEnrollmentGroupList)
|
406
|
+
```
|
407
|
+
api.get_enrollment_group_list enrollmentid: 60997
|
408
|
+
```
|
409
|
+
|
410
|
+
#### [GetEnrollmentMetricsReport](https://api.agilixbuzz.com/docs/#!/Command/GetEnrollmentMetricsReport)
|
411
|
+
This is available in two types:
|
412
|
+
Student Report
|
413
|
+
```
|
414
|
+
api.get_enrollment_metrics_report entityid: 50725, report: "Student"
|
415
|
+
```
|
416
|
+
Enrollment Report
|
417
|
+
```
|
418
|
+
api.get_enrollment_metrics_report entityid: 50725, report: "Enrollment"
|
419
|
+
```
|
420
|
+
|
421
|
+
#### [ListEnrollments](https://api.agilixbuzz.com/docs/#!/Command/ListEnrollments)
|
422
|
+
```
|
423
|
+
api.list_enrollments domainid: 50725
|
424
|
+
```
|
425
|
+
|
426
|
+
#### [ListEnrollmentsByTeacher](https://api.agilixbuzz.com/docs/#!/Command/ListEnrollmentsByTeacher)
|
427
|
+
```
|
428
|
+
api.list_enrollments_by_teacher teacheruserid: 50726
|
429
|
+
|
430
|
+
# If you don't pass in a teacher user id, it will default to the logged in API user
|
431
|
+
|
432
|
+
api.list_enrollments_by_teacher
|
433
|
+
```
|
434
|
+
|
435
|
+
#### [ListEntityEnrollments](https://api.agilixbuzz.com/docs/#!/Command/ListEntityEnrollments)
|
436
|
+
```
|
437
|
+
api.list_entity_enrollments entityid: 60982
|
438
|
+
```
|
439
|
+
|
440
|
+
#### [ListUserEnrollments](https://api.agilixbuzz.com/docs/#!/Command/ListUserEnrollments)
|
441
|
+
```
|
442
|
+
api.list_user_enrollments userid: 57181
|
443
|
+
```
|
444
|
+
|
445
|
+
#### [PutSelfAssessment](https://api.agilixbuzz.com/docs/#!/Command/PutSelfAssessment)
|
446
|
+
# ISSUE: this should be a post, not a get
|
447
|
+
```
|
448
|
+
api.put_self_assessment enrollmentid: 60997, understanding: 200, effort: 220, interest: 100
|
449
|
+
```
|
450
|
+
|
451
|
+
#### [RestoreEnrollment](https://api.agilixbuzz.com/docs/#!/Command/RestoreEnrollment)
|
452
|
+
```
|
453
|
+
api.restore_enrollment enrollmentid: 60997
|
454
|
+
```
|
455
|
+
|
456
|
+
#### [UpdateEnrollments](https://api.agilixbuzz.com/docs/#!/Command/UpdateEnrollments)
|
457
|
+
```
|
458
|
+
api.update_enrollments [{enrollmentid: 60997, status: 7}]
|
459
|
+
```
|
460
|
+
|
461
|
+
## General
|
462
|
+
|
463
|
+
#### [Echo](https://api.agilixbuzz.com/docs/#!/Command/Echo)
|
464
|
+
```
|
465
|
+
api.echo test: 'param'
|
466
|
+
```
|
467
|
+
|
468
|
+
#### [GetCommandList](https://api.agilixbuzz.com/docs/#!/Command/GetCommandList)
|
469
|
+
```
|
470
|
+
api.get_command_list
|
471
|
+
```
|
472
|
+
|
473
|
+
#### [GetEntityType](https://api.agilixbuzz.com/docs/#!/Command/GetEntityType)
|
474
|
+
ISSUE: nothing saying this is an authenticated call, when others are non-authenticated
|
475
|
+
```
|
476
|
+
api.get_entity_type entityid: 57025
|
477
|
+
```
|
478
|
+
|
479
|
+
#### [GetStatus](https://api.agilixbuzz.com/docs/#!/Command/GetStatus)
|
480
|
+
ISSUE: docs in getting started reference a `level` param, actual docs suggest using rating
|
481
|
+
```
|
482
|
+
api.get_status rating: 4, html: true, sms: true
|
483
|
+
|
484
|
+
# you can also call this one non-authenticated
|
485
|
+
api.get_basic_status
|
486
|
+
```
|
487
|
+
|
488
|
+
#### [GetUploadLimits](https://api.agilixbuzz.com/docs/#!/Command/GetUploadLimits)
|
489
|
+
ISSUE: Docs have cmd spelled wrong, this API doesn't seem to work at all AccessDenied. It did say experimental
|
490
|
+
```
|
491
|
+
api.get_upload_limits
|
492
|
+
api.get_upload_limits domainid: 57025
|
493
|
+
```
|
494
|
+
|
495
|
+
#### [SendMail](https://api.agilixbuzz.com/docs/#!/Command/SendMail)
|
496
|
+
This is one of the more confusing APIs, it allows you to send emails to people in the same enrollment grouping as the person wanting to send the email (`enrollmentid`).
|
497
|
+
```
|
498
|
+
api.send_mail subject: "Test email", body: "Did you get this?", enrollmentid: 60997, enrollment_ids: ["all"]
|
499
|
+
```
|
391
500
|
|
392
501
|
## Rights
|
393
502
|
|
@@ -434,15 +543,6 @@ api.update_courses [{courseid: 60994, title: "Updated Course"}]
|
|
434
543
|
- [ ] [SubmitAttemptAnswers](https://api.agilixbuzz.com/docs/#!/Command/SubmitAttemptAnswers)
|
435
544
|
- [ ] [SubmitOfflineAttempt](https://api.agilixbuzz.com/docs/#!/Command/SubmitOfflineAttempt)
|
436
545
|
|
437
|
-
## General
|
438
|
-
|
439
|
-
- [ ] [Echo](https://api.agilixbuzz.com/docs/#!/Command/Echo)
|
440
|
-
- [ ] [GetCommandList](https://api.agilixbuzz.com/docs/#!/Command/GetCommandList)
|
441
|
-
- [ ] [GetEntityType](https://api.agilixbuzz.com/docs/#!/Command/GetEntityType)
|
442
|
-
- [ ] [GetStatus](https://api.agilixbuzz.com/docs/#!/Command/GetStatus)
|
443
|
-
- [ ] [GetUploadLimits](https://api.agilixbuzz.com/docs/#!/Command/GetUploadLimits)
|
444
|
-
- [ ] [SendMail](https://api.agilixbuzz.com/docs/#!/Command/SendMail)
|
445
|
-
|
446
546
|
## Manifests and Items
|
447
547
|
|
448
548
|
- [ ] [AssignItem](https://api.agilixbuzz.com/docs/#!/Command/AssignItem)
|
data/lib/agilix.rb
CHANGED
@@ -6,6 +6,7 @@ require "ostruct"
|
|
6
6
|
require "agilix/buzz/commands/authentication"
|
7
7
|
require "agilix/buzz/commands/course"
|
8
8
|
require "agilix/buzz/commands/domain"
|
9
|
+
require "agilix/buzz/commands/enrollment"
|
9
10
|
require "agilix/buzz/commands/general"
|
10
11
|
require "agilix/buzz/commands/report"
|
11
12
|
require "agilix/buzz/commands/user"
|
data/lib/agilix/buzz/api.rb
CHANGED
@@ -8,6 +8,7 @@ module Agilix
|
|
8
8
|
include Agilix::Buzz::Commands::Authentication
|
9
9
|
include Agilix::Buzz::Commands::Course
|
10
10
|
include Agilix::Buzz::Commands::Domain
|
11
|
+
include Agilix::Buzz::Commands::Enrollment
|
11
12
|
include Agilix::Buzz::Commands::General
|
12
13
|
include Agilix::Buzz::Commands::Report
|
13
14
|
include Agilix::Buzz::Commands::User
|
@@ -32,6 +33,11 @@ module Agilix
|
|
32
33
|
post query
|
33
34
|
end
|
34
35
|
|
36
|
+
def authenticated_query_post(query = {})
|
37
|
+
check_authentication unless query.delete(:bypass_authentication_check)
|
38
|
+
query_post query
|
39
|
+
end
|
40
|
+
|
35
41
|
def authenticated_bulk_post(query = {})
|
36
42
|
check_authentication
|
37
43
|
bulk_post query
|
@@ -45,9 +51,23 @@ module Agilix
|
|
45
51
|
response = self.class.post(URL_BASE, body: modify_body(query), timeout: 60, headers: headers)
|
46
52
|
end
|
47
53
|
|
54
|
+
# For when the api is super unconventional & you need to modify both query params & body params in a custom fashion
|
55
|
+
def query_post(query = {})
|
56
|
+
url = URL_BASE
|
57
|
+
query_params = query.delete(:query_params)
|
58
|
+
if query_params
|
59
|
+
url += "?&_token=#{token}" + query_params.map {|k,v| "&#{k}=#{v}" }.join("")
|
60
|
+
end
|
61
|
+
response = self.class.post(url, body: query.to_json, timeout: 60, headers: headers)
|
62
|
+
end
|
63
|
+
|
48
64
|
def bulk_post(query = {})
|
49
65
|
cmd = query.delete(:cmd)
|
50
66
|
url = URL_BASE + "?cmd=#{cmd}&_token=#{token}"
|
67
|
+
query_params = query.delete(:query_params)
|
68
|
+
if query_params
|
69
|
+
url += query_params.map {|k,v| "&#{k}=#{v}" }.join("")
|
70
|
+
end
|
51
71
|
response = self.class.post(url, body: modify_bulk_body(query), timeout: 60, headers: headers)
|
52
72
|
end
|
53
73
|
|
@@ -0,0 +1,140 @@
|
|
1
|
+
module Agilix
|
2
|
+
module Buzz
|
3
|
+
module Commands
|
4
|
+
module Enrollment
|
5
|
+
|
6
|
+
def enrollment_status
|
7
|
+
{
|
8
|
+
active: 1,
|
9
|
+
withdrawn: 4,
|
10
|
+
withdrawn_failed: 5,
|
11
|
+
transferred: 6,
|
12
|
+
completed: 7,
|
13
|
+
completed_no_credit: 8,
|
14
|
+
suspended: 9,
|
15
|
+
inactive: 10
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def enrollment_status_lookup_value(int)
|
20
|
+
int = int.to_i
|
21
|
+
raise ArgumentError.new("Not a valid enrollment status code") unless enrollment_status.values.include?(int)
|
22
|
+
enrollment_status.find {|k,v| v == int}.first
|
23
|
+
end
|
24
|
+
|
25
|
+
# ISSUE: API format is very inconsistent on this one, requires both query string modification & body modification
|
26
|
+
# api.create_enrollments [{userid: 57026, entityid: 57025}]
|
27
|
+
def create_enrollments(items = [], disallowduplicates: false, disallowsamestatusduplicates: false )
|
28
|
+
options = items.map do |item|
|
29
|
+
item[:status] ||= 1
|
30
|
+
argument_cleaner(required_params: %i( userid entityid status ), optional_params: %i( roleid flags domainid startdate enddate reference schema data ), options: item )
|
31
|
+
end
|
32
|
+
if [disallowduplicates, disallowsamestatusduplicates].compact.any?
|
33
|
+
query_params = {}
|
34
|
+
query_params[:disallowduplicates] = disallowduplicates
|
35
|
+
query_params[:disallowsamestatusduplicates] = disallowsamestatusduplicates
|
36
|
+
end
|
37
|
+
authenticated_bulk_post cmd: "createenrollments", root_node: 'enrollment', query_params: query_params, body: options
|
38
|
+
end
|
39
|
+
|
40
|
+
# ISSUE: Inconsistent from other delete apis. many are singular, not plural
|
41
|
+
# api.delete_enrollments [ { enrollmentid: 60997 }]
|
42
|
+
def delete_enrollments(items = {})
|
43
|
+
options = items.map do |item|
|
44
|
+
argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( ), options: item )
|
45
|
+
end
|
46
|
+
authenticated_bulk_post cmd: "deleteenrollments", root_node: 'enrollment', body: options
|
47
|
+
end
|
48
|
+
|
49
|
+
# api.get_enrollment enrollmentid: 60997
|
50
|
+
def get_enrollment3(options = {})
|
51
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( select ), options: options )
|
52
|
+
authenticated_get cmd: "getenrollment3", **options
|
53
|
+
end
|
54
|
+
alias_method :get_enrollment, :get_enrollment3
|
55
|
+
|
56
|
+
# api.get_enrollment_activity enrollmentid: 60997
|
57
|
+
def get_enrollment_activity(options = {})
|
58
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( last mergeoverlap ), options: options )
|
59
|
+
authenticated_get cmd: "getenrollmentactivity", **options
|
60
|
+
end
|
61
|
+
|
62
|
+
# api.get_enrollment_gradebook enrollmentid: 60997
|
63
|
+
def get_enrollment_gradebook2(options = {})
|
64
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( forcerequireditems gradingschemeid gradingscheme itemid scorm zerounscored ), options: options )
|
65
|
+
authenticated_get cmd: "getenrollmentgradebook2", **options
|
66
|
+
end
|
67
|
+
alias_method :get_enrollment_gradebook, :get_enrollment_gradebook2
|
68
|
+
|
69
|
+
# api.get_enrollment_group_list enrollmentid: 60997
|
70
|
+
def get_enrollment_group_list(options = {})
|
71
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( setid ), options: options )
|
72
|
+
authenticated_get cmd: "getenrollmentgrouplist", **options
|
73
|
+
end
|
74
|
+
|
75
|
+
# api.get_enrollment_metrics_report entityid: 50725, report: "Student"
|
76
|
+
# api.get_enrollment_metrics_report entityid: 50725, report: "Enrollment"
|
77
|
+
def get_enrollment_metrics_report(options = {})
|
78
|
+
raise ArgumentError.new("report can only be Student or Enrollment") unless ['Student', 'Enrollment'].include?(options[:report])
|
79
|
+
default_select = %w( user.id user.firstname user.lastname user.username user.reference)
|
80
|
+
student_select = %w( coursecount latecount failedcount paceyellows pacereds performanceyellows performancereds)
|
81
|
+
enrollment_select = %w(enrollment.id course.title course.id course.reference score achieved possible failing seconds completable completed gradable completedgradable graded percentcomplete late failed recentlyfailed pacelight pacereason performancelight performancereason lastduedatemissed calculateddate )
|
82
|
+
if options[:report] == "Student"
|
83
|
+
options[:select] ||= (default_select + student_select).flatten.join(",")
|
84
|
+
elsif options[:report] == "Enrollment"
|
85
|
+
options[:select] ||= (default_select + enrollment_select).flatten.join(",")
|
86
|
+
end
|
87
|
+
options = argument_cleaner(required_params: %i( entityid report select ), optional_params: %i( filename format ), options: options )
|
88
|
+
authenticated_get cmd: "getenrollmentmetricsreport", **options
|
89
|
+
end
|
90
|
+
|
91
|
+
# api.list_enrollments domainid: 50725
|
92
|
+
def list_enrollments(options = {})
|
93
|
+
options = argument_cleaner(required_params: %i( domainid ), optional_params: %i( includedescendantdomains limit show select query userdomainid userquery usertext coursedomainid coursequery coursetext ), options: options )
|
94
|
+
authenticated_get cmd: "listenrollments", **options
|
95
|
+
end
|
96
|
+
|
97
|
+
# api.list_enrollments_by_teacher teacheruserid: 50726
|
98
|
+
# api.list_enrollments_by_teacher
|
99
|
+
def list_enrollments_by_teacher(options = {})
|
100
|
+
options = argument_cleaner(required_params: %i( ), optional_params: %i( teacheruserid teacherallstatus teacherdaysactivepastend privileges allstatus daysactivepastend userid select ), options: options )
|
101
|
+
authenticated_get cmd: "listenrollmentsbyteacher", **options
|
102
|
+
end
|
103
|
+
|
104
|
+
# api.list_entity_enrollments entityid: 60982
|
105
|
+
def list_entity_enrollments(options = {})
|
106
|
+
options = argument_cleaner(required_params: %i( entityid ), optional_params: %i( privileges allstatus daysactivepastend userid select ), options: options )
|
107
|
+
authenticated_get cmd: "listentityenrollments", **options
|
108
|
+
end
|
109
|
+
|
110
|
+
# api.list_user_enrollments userid: 57181
|
111
|
+
def list_user_enrollments(options = {})
|
112
|
+
options = argument_cleaner(required_params: %i( userid ), optional_params: %i( allstatus entityid privileges daysactivepastend query select ), options: options )
|
113
|
+
authenticated_get cmd: "listuserenrollments", **options
|
114
|
+
end
|
115
|
+
|
116
|
+
# ISSUE: this should be a post, not a get
|
117
|
+
# api.put_self_assessment enrollmentid: 60997, understanding: 200, effort: 220, interest: 100
|
118
|
+
def put_self_assessment(options = {})
|
119
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( understanding interest effort ), options: options )
|
120
|
+
authenticated_get cmd: "putselfassessment", **options
|
121
|
+
end
|
122
|
+
|
123
|
+
# api.restore_enrollment enrollmentid: 60997
|
124
|
+
def restore_enrollment(options = {})
|
125
|
+
options = argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( ), options: options )
|
126
|
+
authenticated_get cmd: "restoreenrollment", **options
|
127
|
+
end
|
128
|
+
|
129
|
+
# api.update_enrollments [{enrollmentid: 60997, status: 7}]
|
130
|
+
def update_enrollments(items)
|
131
|
+
options = items.map do |item|
|
132
|
+
argument_cleaner(required_params: %i( enrollmentid ), optional_params: %i( userid entityid domainid roleid flags status startdate enddate reference schema data ), options: item)
|
133
|
+
end
|
134
|
+
authenticated_bulk_post cmd: "updateenrollments", root_node: 'enrollment', body: options
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -3,11 +3,67 @@ module Agilix
|
|
3
3
|
module Commands
|
4
4
|
module General
|
5
5
|
|
6
|
+
# api.echo test: 'param'
|
7
|
+
def echo(options= {})
|
8
|
+
post cmd: "echo", **options
|
9
|
+
end
|
10
|
+
|
11
|
+
# api.get_command_list
|
12
|
+
def get_command_list
|
13
|
+
get cmd: "getcommandlist"
|
14
|
+
end
|
15
|
+
|
16
|
+
# ISSUE: nothing saying this is an authenticated call, when others are non-authenticated
|
17
|
+
# api.get_entity_type entityid: 57025
|
18
|
+
def get_entity_type(options = {})
|
19
|
+
options = argument_cleaner(required_params: %i( entityid ), optional_params: %i( select ), options: options )
|
20
|
+
authenticated_get cmd: "getentitytype", **options
|
21
|
+
end
|
22
|
+
|
23
|
+
# ISSUE: docs in getting started reference a `level` param, actual docs suggest using rating
|
24
|
+
# api.get_status rating: 4, html: true, sms: true
|
25
|
+
def get_status(options = {})
|
26
|
+
options = argument_cleaner(required_params: %i( ), optional_params: %i( rating sms html ), options: options )
|
27
|
+
authenticated_get cmd: "getstatus", **options
|
28
|
+
end
|
29
|
+
|
30
|
+
# this is a non-authenticated call
|
6
31
|
# api.get_status
|
7
|
-
def
|
8
|
-
|
32
|
+
def get_basic_status(options = {})
|
33
|
+
options = argument_cleaner(required_params: %i( ), optional_params: %i( rating sms html ), options: options )
|
34
|
+
get cmd: "getstatus", **options
|
35
|
+
end
|
36
|
+
|
37
|
+
# ISSUE: Docs have cmd spelled wrong, this API doesn't seem to work at all AccessDenied. It did say experimental
|
38
|
+
# api.get_upload_limits
|
39
|
+
# api.get_upload_limits domainid: 57025
|
40
|
+
def get_upload_limits(options = {})
|
41
|
+
options = argument_cleaner(required_params: %i( ), optional_params: %i( userid domainid ), options: options )
|
42
|
+
get cmd: "getuploadlimits", **options
|
9
43
|
end
|
10
44
|
|
45
|
+
# api.send_mail subject: "Test email", body: "Did you get this?", enrollmentid: 60997, enrollment_ids: ["all"]
|
46
|
+
def send_mail(options = {})
|
47
|
+
options = argument_cleaner(required_params: %i( subject body enrollmentid enrollment_ids ), optional_params: %i( groups roles strings), options: options )
|
48
|
+
request = {email: {
|
49
|
+
subject: {"$value" => options[:subject]},
|
50
|
+
body: {"$value" => options[:body]},
|
51
|
+
enrollments: {enrollment: options[:enrollment_ids].map {|id| {id: id} } }
|
52
|
+
}}
|
53
|
+
request[:email][:groups] = {group: options[:groups].map {|id| {id: id} } } if options[:groups]
|
54
|
+
request[:email][:roles] = {role: options[:roles].map {|id| {id: id} } } if options[:roles]
|
55
|
+
if options[:strings]
|
56
|
+
request[:email][:strings] = options[:strings].map do |k,v|
|
57
|
+
[ k , {"$value" => v } ]
|
58
|
+
end.to_h
|
59
|
+
end
|
60
|
+
enrollment_response = self.get_enrollment enrollmentid: options[:enrollmentid]
|
61
|
+
user_id = enrollment_response.dig("response", "enrollment", "userid")
|
62
|
+
proxy_api = self.proxy_api userid: user_id
|
63
|
+
proxy_api.authenticated_query_post query_params: {cmd: "sendmail", enrollmentid: options[:enrollmentid] }, **request
|
64
|
+
end
|
65
|
+
|
66
|
+
|
11
67
|
end
|
12
68
|
end
|
13
69
|
end
|
data/lib/agilix/version.rb
CHANGED
data/stats.html
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<div style=\"text-indent:0em\"><h1>certificates: <div style=\"display:inline;color:#F0F000\">Acceptable</div></h1><div style=\"text-indent:1em\"><h2>certificate (BLOCKEDMACHINE)</h2><div style=\"text-indent:2em\">The certificate is expiring soon. If it is still in use, renew the certificate and replace it. If it is not still in use, remove the certificate.</div></div></div><div style=\"text-indent:0em\"><h1>databaseaccess: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>emailaccess (BLOCKEDMACHINE/587): <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>fileaccess: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>localdisk: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>mediastreaming: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>misc: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>networkaccess: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>queueaccess: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>search: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div><div style=\"text-indent:0em\"><h1>sharedcacheaccess: <div style=\"display:inline;color:#009900\">Ideal</div></h1></div>4
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -188,10 +188,12 @@ files:
|
|
188
188
|
- lib/agilix/buzz/commands/authentication.rb
|
189
189
|
- lib/agilix/buzz/commands/course.rb
|
190
190
|
- lib/agilix/buzz/commands/domain.rb
|
191
|
+
- lib/agilix/buzz/commands/enrollment.rb
|
191
192
|
- lib/agilix/buzz/commands/general.rb
|
192
193
|
- lib/agilix/buzz/commands/report.rb
|
193
194
|
- lib/agilix/buzz/commands/user.rb
|
194
195
|
- lib/agilix/version.rb
|
196
|
+
- stats.html
|
195
197
|
homepage: https://github.com/beneggett/agilix
|
196
198
|
licenses:
|
197
199
|
- MIT
|