Schedule
The behaviors that schedule calls, and each call that its examples make.
osapi dsl chain get --name schedule shows the same.
Chain
| Behavior | schedule |
| Chain | schedule → (object, managedfile) |
| Calls | object, managedfile |
| Used by | none |
An entry that osapi deployed (list)
| CALL | SENDS | GETS |
|---|---|---|
| schedule list | [{"name":"osapitest","object":"osapitest.cron","schedule":"0 2 * * *"… | |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
A daily script that osapi deployed (list)
| CALL | SENDS | GETS |
|---|---|---|
| schedule list | [{"name":"osapitest","object":"osapitest.sh","interval":"daily","sour… | |
| └─ managedfile get | path=/etc/cron.daily/osapitest | metadata={"interval":"daily","object":"osapitest.sh"} object_sha256=b… |
A host where osapi deployed none (list)
| CALL | SENDS | GETS |
|---|---|---|
| schedule list | [] | |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
An entry that osapi deployed (get)
| CALL | SENDS | GETS |
|---|---|---|
| schedule get | name=osapitest | name=osapitest object=osapitest.cron schedule="0 2 * * *" source=cron… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
An entry with a cron expression (create)
| CALL | SENDS | GETS |
|---|---|---|
| schedule create | name=osapitest object=osapitest.cron schedule="0 2 * * *" user=root | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.hourly/osapitest | error: /etc/cron.hourly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | error: /etc/cron.daily/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.weekly/osapitest | error: /etc/cron.weekly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.monthly/osapitest | error: /etc/cron.monthly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ object get | name=osapitest.cron | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw nam… |
| └─ managedfile update | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw met… | changed=true path=/etc/cron.d/osapitest |
A script that runs daily (create)
| CALL | SENDS | GETS |
|---|---|---|
| schedule create | interval=daily name=osapitest object=osapitest.sh | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.hourly/osapitest | error: /etc/cron.hourly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | error: /etc/cron.daily/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.weekly/osapitest | error: /etc/cron.weekly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.monthly/osapitest | error: /etc/cron.monthly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | error: /etc/cron.daily/osapitest: not managed |
| └─ object get | name=osapitest.sh | content=<2 lines> content_type=raw name=osapitest.sh sha256=b0f49e4f6… |
| └─ managedfile update | content=<2 lines> content_type=raw metadata={"interval":"daily","obje… | changed=true path=/etc/cron.daily/osapitest |
A template, rendered with its vars (create)
| CALL | SENDS | GETS |
|---|---|---|
| schedule create | content_type=template name=osapitest object=osapitest.tmpl schedule="… | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.hourly/osapitest | error: /etc/cron.hourly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | error: /etc/cron.daily/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.weekly/osapitest | error: /etc/cron.weekly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.monthly/osapitest | error: /etc/cron.monthly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ object get | name=osapitest.tmpl | content="0 2 * * * root /usr/local/bin/backup {{ .Vars.target }}\n" c… |
| └─ managedfile update | content="0 2 * * * root /usr/local/bin/backup /srv\n" content_type=te… | changed=true path=/etc/cron.d/osapitest |
An entry that has the content (create)
| CALL | SENDS | GETS |
|---|---|---|
| schedule create | name=osapitest object=osapitest.cron schedule="0 2 * * *" user=root | changed=false name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ object get | name=osapitest.cron | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw nam… |
| └─ managedfile update | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw met… | changed=false path=/etc/cron.d/osapitest |
An entry of the name in a different directory (create)
| CALL | SENDS | GETS |
|---|---|---|
| schedule create | interval=daily name=osapitest object=osapitest.sh | changed=false name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
A new object (update)
| CALL | SENDS | GETS |
|---|---|---|
| schedule update | name=osapitest object=osapitest-v2.cron | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ object get | name=osapitest-v2.cron | content="30 2 * * * root /usr/local/bin/backup --full\n" content_type… |
| └─ managedfile update | content="30 2 * * * root /usr/local/bin/backup --full\n" content_type… | changed=true path=/etc/cron.d/osapitest |
A new cron expression, with the same object (update)
| CALL | SENDS | GETS |
|---|---|---|
| schedule update | name=osapitest schedule="30 2 * * *" | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ object get | name=osapitest.cron | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw nam… |
| └─ managedfile update | content="0 2 * * * root /usr/local/bin/backup\n" content_type=raw met… | changed=true path=/etc/cron.d/osapitest |
A new object, cron expression and user (update)
| CALL | SENDS | GETS |
|---|---|---|
| schedule update | name=osapitest object=osapitest-v2.cron schedule="30 2 * * *" user=no… | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ object get | name=osapitest-v2.cron | content="30 2 * * * root /usr/local/bin/backup --full\n" content_type… |
| └─ managedfile update | content="30 2 * * * root /usr/local/bin/backup --full\n" content_type… | changed=true path=/etc/cron.d/osapitest |
A daily script with a new object (update)
| CALL | SENDS | GETS |
|---|---|---|
| schedule update | name=osapitest object=osapitest-v2.sh | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.hourly/osapitest | error: /etc/cron.hourly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | metadata={"interval":"daily","object":"osapitest.sh"} object_sha256=b… |
| └─ managedfile get | path=/etc/cron.daily/osapitest | metadata={"interval":"daily","object":"osapitest.sh"} object_sha256=b… |
| └─ object get | name=osapitest-v2.sh | content=<3 lines> content_type=raw name=osapitest-v2.sh sha256=176e1c… |
| └─ managedfile update | content=<3 lines> content_type=raw metadata={"interval":"daily","obje… | changed=true path=/etc/cron.daily/osapitest |
Remove an entry (delete)
| CALL | SENDS | GETS |
|---|---|---|
| schedule delete | name=osapitest | changed=true name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | metadata={"object":"osapitest.cron","schedule":"0 2 * * *","user":"ro… |
| └─ managedfile delete | path=/etc/cron.d/osapitest | changed=true path=/etc/cron.d/osapitest |
An entry that osapi did not deploy (delete)
| CALL | SENDS | GETS |
|---|---|---|
| schedule delete | name=osapitest | changed=false name=osapitest |
| └─ managedfile get | path=/etc/cron.d/osapitest | error: /etc/cron.d/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.hourly/osapitest | error: /etc/cron.hourly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.daily/osapitest | error: /etc/cron.daily/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.weekly/osapitest | error: /etc/cron.weekly/osapitest: not managed |
| └─ managedfile get | path=/etc/cron.monthly/osapitest | error: /etc/cron.monthly/osapitest: not managed |