Functions
Update a function
PUT /v1/functions/{id}- Permission
write:functions- Tokens
- API key, CLI user token
Replace an API-managed function definition. Git-managed definitions must be edited in their repository.
Path parameters
idstringrequired
{
}
{
}
1
import os
2
3
from ellipsis import (
4
Ellipsis,
5
FunctionConfig,
6
FunctionIdentity,
7
FunctionSettings,
8
)
9
10
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
11
12
result = client.functions.update(
13
"...",
14
FunctionConfig(
15
ellipsis=FunctionIdentity(name="open-pr-count"),
16
function=FunctionSettings(
17
handler="api-repo/functions/report.py:handler",
18
environment="api-environment",
19
),
20
),
21
)
22
print(result)
1
import { Ellipsis } from '@ellipsis-dev/sdk';
2
3
const client = new Ellipsis({
4
apiKey: process.env.ELLIPSIS_API_TOKEN!,
5
});
6
7
const request: Parameters<typeof client.functions.update>[1] = {
8
ellipsis: { kind: 'function', name: 'open-pr-count' },
9
function: {
10
handler: 'api-repo/functions/report.py:handler',
11
environment: 'api-environment',
12
},
13
};
14
15
const result = await client.functions.update('...', request);
16
console.log(result);
1
curl -X PUT "https://api.ellipsis.dev/v1/functions/{id}" \
2
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
3
-H "Content-Type: application/json" \
4
-d '{
5
"function": {
6
"ellipsis": {
7
"kind": "function",
8
"name": "open-pr-count"
9
},
10
"function": {
11
"handler": "api-repo/functions/report.py:handler",
12
"environment": "api-environment"
13
}
14
}
15
}'
Request
functionFunctionConfigrequired
The function's new definition. It replaces the whole previous one.
Response
functionFunctionrequired
The saved function.