The behaviors that service calls, and each call that its examples make.
osapi dsl chain get --name service shows the same.
Chain
A service that osapi deployed reads by its name (list)
| CALL | SENDS | GETS |
|---|
| service list | | [{"name":"ssh","state":"running","enabled":true,"description":"OpenBS… |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} object_sha256=f1f13ddd26ea6233bbcc7… |
A host with two services (list)
| CALL | SENDS | GETS |
|---|
| service list | | [{"name":"ssh","state":"running","enabled":true,"description":"OpenBS… |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | error: /etc/systemd/system/osapi-app.service: not managed |
A running service (get)
| CALL | SENDS | GETS |
|---|
| service get | name=ssh | description="OpenBSD Secure Shell server" enabled=true managed=false … |
| └─ managedfile get | path=/etc/systemd/system/osapi-ssh.service | error: /etc/systemd/system/osapi-ssh.service: not managed |
A name with .service (get)
| CALL | SENDS | GETS |
|---|
| service get | name=ssh.service | description="OpenBSD Secure Shell server" enabled=true managed=false … |
| └─ managedfile get | path=/etc/systemd/system/osapi-ssh.service | error: /etc/systemd/system/osapi-ssh.service: not managed |
A service that osapi deployed, by the name it was deployed with (get)
| CALL | SENDS | GETS |
|---|
| service get | name=app | description="Example app" enabled=false managed=true name=app state=d… |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} object_sha256=f1f13ddd26ea6233bbcc7… |
A service that osapi deployed, by its unit's name (get)
| CALL | SENDS | GETS |
|---|
| service get | name=osapi-app | description="Example app" enabled=false managed=true name=app state=d… |
| └─ managedfile get | path=/etc/systemd/system/osapi-app.service | metadata={"object":"app.service"} object_sha256=f1f13ddd26ea6233bbcc7… |
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 object=… | 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"} object_sha256=f1f13ddd26ea6233bbcc7… |
| └─ 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 object=… | 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"} object_sha256=f1f13ddd26ea6233bbcc7… |
| └─ 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 obje… | 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"} object_sha256=f1f13ddd26ea6233bbcc7… |
| └─ 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"} object_sha256=f1f13ddd26ea6233bbcc7… |
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"} object_sha256=f1f13ddd26ea6233bbcc7… |
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"} object_sha256=f1f13ddd26ea6233bbcc7… |
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"} object_sha256=f1f13ddd26ea6233bbcc7… |
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"} object_sha256=716bed98f25a213a18… |
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"} object_sha256=f1f13ddd26ea6233bbcc7… |