UpdateService
environments.automations.services.update(ServiceUpdateParams**kwargs) -> object
POST/gitpod.v1.EnvironmentAutomationService/UpdateService
Updates an automation service configuration.
Use this method to:
- Modify service commands
- Update triggers
- Change runtime settings
- Adjust dependencies
Examples
-
Update commands:
Changes service start and ready commands.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" spec: commands: start: "npm run start:dev" ready: "curl -s http://localhost:8080" -
Update triggers:
Modifies when the service starts.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" metadata: triggeredBy: trigger: - postDevcontainerStart: true - manual: true
UpdateService
import os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
service = client.environments.automations.services.update(
id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
spec={
"commands": {
"ready": "curl -s http://localhost:8080",
"start": "npm run start:dev",
}
},
)
print(service){}Returns Examples
{}