CreateRunnerToken
client.runners.createRunnerToken(RunnerCreateRunnerTokenParams { runnerId } body, RequestOptionsoptions?): RunnerCreateRunnerTokenResponse { accessToken, exchangeToken }
POST/gitpod.v1.RunnerService/CreateRunnerToken
Creates a new authentication token for a runner.
Use this method to:
- Generate runner credentials
- Renew expired tokens
- Set up runner authentication
Note: This does not expire previously issued tokens.
Examples
-
Create token:
Creates a new token for runner authentication.
runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
CreateRunnerToken
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const response = await client.runners.createRunnerToken({
runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
});
console.log(response.accessToken);{
"accessToken": "accessToken",
"exchangeToken": "exchangeToken"
}Returns Examples
{
"accessToken": "accessToken",
"exchangeToken": "exchangeToken"
}