►
Description
Jason Colyer, Support Operations Manager, takes us through how the ADWR works
A
Creating
itself,
my
name
is
jason
caller,
I'm
the
support
operations
manager
here
at
jet
lab
and
today
we're
going
to
go
over
how
the
amer
response
crew
notification
system
works.
Let
me
share
my
screen
and
we'll
get
started,
so
this
is
the
repo
where
it
lives
out
of
and
the
way
we've
got.
This
working
is
using
get
lab,
ci
cd
to
make
the
postings
and
other
things
that
it
does.
A
If
you
look
at
the
ci
file
itself,
you'll
notice
there's
one
stage
just
to
create
stage
the
before
script,
checks
for
the
ruby
version,
installs
active
support,
faraday
and
oj,
which
is
all
the
script,
really
needs,
and
there's
a
two
jobs
that
it
does
it
posts
message
which
will
only
work
on
schedules
when
the
action
is
post
and
it
uses
the
run
script
and
the
rotate
managers,
which
only
run
on
schedules
when
the
action
is
rotate
and
you'll
notice.
The
script
here
looks
really
different
from
what
you
might
see
in
other
things.
A
This
is
because
the
rotation
should
only
happen
every
four
weeks.
The
week
prior
to
the
actual
fourth
week,
I
tried
to
come
up
with
creative
solution
for
that.
The
gitlab
ci
schedule,
prom
that
it
uses,
doesn't
really
support
that
kind
of
logic.
So,
instead,
what
I
built
in
the
script
here
was
a
basic
bash
conditional
statement
where
it
says,
take
the
date,
but
the
week
of
the
number
the
week
number
of
the
year
divide
it
by
four
and
if
the
remainder
is
three
run,
the
rotate
schedules
otherwise
fail.
A
So,
if
we
actually
look
at
the
scripts
here,
we'll
notice
that
they're
they're,
not
very
complex,
rotate
manager
calls
for
rotate
managers
and
if
you
look
at
the
run
script,
you'll
notice,
it
basically
just
says
to
post
the
message:
yeah
slack
post,
where
the
real
magic
comes
into
play
is
through
the
actual
files.
So,
let's
look
at
those
they
may
have
response
to
notification.rb
file
is
calling
the
it's
declaring
a
module,
a
mirror
response,
crew
notification
requiring
the
active
support,
time,
faraday,
middleware,
json,
oj
enamel
and
it's
requiring
the
client
file.
A
A
Beyond
that
we
have
the
request
function,
which
is
going
to
take
this
faraday
connection.
We
established
here
perform
public,
send
using
http
method
and
the
url.
In
this
case
our
url
is
always
going
to
be
the
same.
So
we
didn't
need
a
whole
lot
of
being
able
to
be
customized
there
we're
going
to
get
the
response
from
that
and
part
and
load
it
using
oj.
So
it's
nice
and
easy
to
read.
A
The
support
team
comes
from
the
support
team
ammo
file,
which
is
going
to
make
a
request
to
gitlab
for
this
raw
data
file
from
there
it's
gonna
call
the
gitlab
public
sends
it's
gonna,
do
a
git
to
this
url
and
you
can't
use
ammo
to
safeload
it
we're
passing
a
date
to
specify
there
are
date,
objects
in
there,
not
just
strings
and
integers
and
other
default
stuff.
Dtek
user
is
going
to
be
past.
The
page
duty
id
at
which
point
it
will
go
through
this
support,
tml
information
to
find
the
user.
A
With
that
page
of
duty
id
now
the
page
of
duty
clients
will
be
making
a
new
faraday
connection
to
the
api.pagerdued.com.
The
url
is
encoded.
The
adapter
is
the
default
faraday
adapter,
the
authorization
is
the
token
content
type
is
application
json
and
we're
told
to
accept
vnd.pagerduty
plus
json,
which
is
recommended
from
pagerduty
themselves.
A
Here
we
have
our
slack
web
hook.
We'll
use
this
for
posting
into
a
slack
channel.
We
set
up
a
function
for
page
duty
request
which
takes
the
atg
method.
The
endpoint
and
parameters
which
we'll
use
the
page
of
duty
client
to
public,
send
via
the
http
method
and
point
the
parameters
and
then
use
oj
to
safely
to
load
that
in
an
icc
format
and
for
slack
requests,
we
take
the
content
and
we
basically
just
have
faraday
post
slap
slack
using
the
slack
web
book
with
the
content
itself.
A
So
we
can
go
ahead
and
start
with
slack,
that's
easier
one
to
kind
of
go
over,
so
we
have
post,
which
is
just
going
to
use
the
client
slack
request
function
to
post
a
slack
message,
and
the
slack
message
needs
to
be
formatted
in
this
way.
Where
the
text
may
say,
text
is
whatever
the
text
is,
and
then
we
parse
the
two
jsons
with
json
objects
that
we
pass
to
slack
the
message
itself
in
this
case.
A
It's
you
know
the
standard
message
that
we're
using
for
this,
as
well
as
the
notify,
whereas
notify
is
basically
going
to
be
the
users
it's
going
to
skip
the
group
entirely
if
it
has
no
users
in
the
group,
but
it'll
basically
just
push
to
notify
that
what
type
of
group
it
is
and
all
the
users
and
it's
going
to
join
all
that
with
new
lines.
So
it's
all
nicely
formatted
for
the
message
now,
the
user
list.
It
basically
takes
a
group
of
users
and
just
maps
them
out
to
the
formatting.
A
That
slack
requires
to
add
someone.
The
schedules
in
question
are
the
ones
that
we're
actually
using
from
pagerduty.
These
are
the
ones
that
are
currently
being
used,
the
options-
and
this
takes
the
schedule
id
basically
the
date
time,
and
then
we
have
this
nice
little
option,
string
that
we
can
then
say
this
is
what
our
options
are
schedule:
slash
sid
time
zone
mayor
chicago
since
beginning
of
day
end
of
day.
Basically,
the
users
will
use
obtain
users
and
the
way
this
works.
A
We
set
a
people
hash
with
the
various
categories,
we're
going
to
go
through
each
of
our
schedules.
Here
we're
going
to
make
a
request
to
page
duty
to
get
the
schedule
information
from
there.
We
will
determine
the
schedule
name.
The
reason
for
this
we
just
wanted.
We
didn't
want
to
always
output
the
message
we
want
to
simplify
it
and
from
page
3
we're
going
to
determine
the
users
using
the
schedule.
A
Final
schedule
rendered
schedule
entries
the
reason
we
use
this
one
specifically
is
this
takes
overrides
into
effect,
whereas
regular,
some
of
the
other
schedules
do
not
and
then
for
each
of
those
entries
from
this
determined
users
which
we'll
go
over
in
a
bit,
we're
basically
going
to
say
we're
going
to
push
the
people
object
up
here,
using
the
name
that
we
determined
here
we're
going
to
push.
You
know
the
people
that
we
found
from
the
determined
users
and
determine
users
is
literally
just
going
to
take.
A
The
client
use
this
detect
user
to
find
the
user's
id,
and
it's
going
to
push
that
to
the
people
objects
to
return
that.
So
that's
all
that
really
does,
and
what
that
ends
up
with
is
an
a
slack
message
once
a
day
that
comes
in
that
says:
hey
all
these
people,
you're
on
ameri
response
crew.
Today
now
the
pager
duty,
one
that
we
have
here,
is
a
little
more
a
little
little
different.
It
does
something
a
little
different
here.
A
You
can
see
how
rotate
managers
will
output
the
current
output
update
schedule,
output,
the
new
and
post
slack,
so
current
is
done
by
determining
the
current
people
we'll
go
over
that
a
bit
rotated
is
the
rotate
currents
function.
A
A
So
what
it's
going
to
do
is
take
the
current
value
and
it's
going
to
run
up
on
it
or
dupe
or,
however,
you
want
to
pronounce
that
basically
we're
cloning
it
so
that
we
can
tweak
it
and
edit
it
and
all
that
fun
stuff,
and
what
it's
going
to
do
is
it's
going
to
insert
it's
going
to
take
the
it's
going
to
take
the
latin
the
user?
A
That's
at
position,
four
I.e,
the
last
user
in
this
case
since
there's
five,
because
you
know
five
days
a
week
for
business
days,
it's
going
to
delete
them,
but
using
delete
act.
Four,
when
you
called
on
a
file
called
on
this,
is
basically
gonna,
say:
okay,
so
delete
whoever's
at
that
position,
the
fifth
person
in
the
array,
but
return
that
person
to
us.
So
what
this
is
essentially
doing
is
just
rotating
everybody
by
one
game
and
of
course,
it's
going
to
set
the
start
time
and
the
rotation
virtual
start
time.
A
It's
going
to
do
this
so
that
it
doesn't
apply
any
changes
today
but
add
a
day
we
specify
for
date.
Basically,
what
we're
doing
here
is
making
sure
we
get
sunday
as
the
date
that
we're
making
these
changes
that
it
tells
page
two
to
make.
The
changes
on
the
options
are
just
the
options.
We're
gonna
pass
to
it
to
determine
current
we're
literally
just
going
to
get
the
current
schedule.
We
don't
even
tweak
it
at
all.
A
We
do
that
via
the
rest
of
the
script
for
update
schedule,
we're
making
a
put
request
to
the
schedule
with
this
value.
We
came
up
here
with
this
rotated
value
and
then
we're
going
to
make
posts
and
slack
with
the
slack
message,
which
is
just
I've
rotated
this
here's,
the
new
rotation
list.
Users
is
just
going
to
go
through
each
of
them
and
output
it
into
a
way
that
we
can
use
that
slack
requires
to
have
people
and
then,
for
day
of
the
week.
We
just
kind
of
I
did
this
to
be
convenient
for
myself.
A
It
really
doesn't
have
to
have
been
done
this
way.
It
was
just
quick
and
easy
for
me,
but
that
that's
all
there
is
to
the
amer
response:
crew
notification
system
making
changes.
You
know
you
might
have
changed
web
hooks.
We
change
channels.
We
have
new
rotations
new
schedules,
stuff
like
that,
but
other
than
that,
that's
really
how
it
works.
That's
all
there
is
to
it.
I
hope
you
found
this
educational
and
I
look
forward
to
seeing
the
next
video.