The behaviors that service calls, and each call that its examples make.
osapi behavior chain get --name service shows the same.
Chain
Deploy a unit file (create)
| CALL | SENDS | GETS |
|---|
| service create | name=app object=app.service | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | error: /etc/systemd/system/osapi-app.service: not managed |
| └─ object get | name=app.service | content=<8 lines> content_type=raw name=app.service sha256=f1f13ddd26… |
| └─ managedfile update | content=<8 lines> metadata={"object":"app.service"} mode=0644 path=/e… | changed=true path=/etc/systemd/system/osapi-app.service |
A unit file that has the content (create)
| CALL | SENDS | GETS |
|---|
| service create | name=app object=app.service | changed=false name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
| └─ object get | name=app.service | content=<8 lines> content_type=raw name=app.service sha256=f1f13ddd26… |
| └─ managedfile update | content=<8 lines> metadata={"object":"app.service"} mode=0644 path=/e… | changed=false path=/etc/systemd/system/osapi-app.service |
A new unit file (update)
| CALL | SENDS | GETS |
|---|
| service update | name=app object=app-v2.service | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
| └─ object get | name=app-v2.service | content=<9 lines> content_type=raw name=app-v2.service sha256=a67ff5f… |
| └─ managedfile update | content=<9 lines> metadata={"object":"app-v2.service"} mode=0644 path… | changed=true path=/etc/systemd/system/osapi-app.service |
Remove a service (delete)
| CALL | SENDS | GETS |
|---|
| service delete | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
| └─ managedfile delete | path=/etc/systemd/system/osapi-app.service | changed=true path=/etc/systemd/system/osapi-app.service |
A service that osapi did not deploy (delete)
| CALL | SENDS | GETS |
|---|
| service delete | name=app | changed=false name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | error: /etc/systemd/system/osapi-app.service: not managed |
A unit file that osapi did not deploy (delete)
| CALL | SENDS | GETS |
|---|
| service delete | name=agent | changed=false name=agent |
| └─ managedfile get | path=/etc/systemd/system/osapi-agent.service | error: /etc/systemd/system/osapi-agent.service: not managed |
Start the service (start)
| CALL | SENDS | GETS |
|---|
| service start | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
Stop the service (stop)
| CALL | SENDS | GETS |
|---|
| service stop | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
Restart the service (restart)
| CALL | SENDS | GETS |
|---|
| service restart | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
Enable the service (enable)
| CALL | SENDS | GETS |
|---|
| service enable | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |
A unit with no [Install] section (enable)
| CALL | SENDS | GETS |
|---|
| service enable | name=static | changed=false name=static |
| └─ managedfile get | path=/etc/systemd/system/osapi-static.service | metadata={"object":"static.service"} path=/etc/systemd/system/osapi-s… |
Disable the service (disable)
| CALL | SENDS | GETS |
|---|
| service disable | name=app | changed=true name=app |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.… |