UpdateService
client.environments.automations.services.update(ServiceUpdateParams { id, metadata, spec, status } body, RequestOptionsoptions?): ServiceUpdateResponse
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 Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const service = await client.environments.automations.services.update({
id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
spec: { commands: { ready: 'curl -s http://localhost:8080', start: 'npm run start:dev' } },
});
console.log(service);{}Returns Examples
{}