function: Describe + Delete endpoints (#230)

This commit is contained in:
Janos Dobronszki
2021-10-14 10:29:18 +01:00
committed by GitHub
parent a67ecc0e36
commit e6e0b1a84d
12 changed files with 406 additions and 63 deletions

View File

@@ -34,6 +34,12 @@ func (t *FunctionService) Deploy(request *DeployRequest) (*DeployResponse, error
return rsp, t.client.Call("function", "Deploy", request, rsp)
}
//
func (t *FunctionService) Describe(request *DescribeRequest) (*DescribeResponse, error) {
rsp := &DescribeResponse{}
return rsp, t.client.Call("function", "Describe", request, rsp)
}
// List all the deployed functions
func (t *FunctionService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
@@ -89,10 +95,24 @@ type DeployRequest struct {
type DeployResponse struct {
}
type DescribeRequest struct {
// The name of the function
Name string `json:"name"`
// Optional project name
Project string `json:"project"`
}
type DescribeResponse struct {
Status string `json:"status"`
Timeout string `json:"timeout"`
UpdateTime string `json:"updateTime"`
}
type Func struct {
// name of handler in source code
Entrypoint string `json:"entrypoint"`
// function name
// limitation: must be unique across projects
Name string `json:"name"`
// project of function, optional
// defaults to literal "default"

View File

@@ -30,6 +30,14 @@ export class FunctionService {
request
) as Promise<DeployResponse>;
}
//
describe(request: DescribeRequest): Promise<DescribeResponse> {
return this.client.call(
"function",
"Describe",
request
) as Promise<DescribeResponse>;
}
// List all the deployed functions
list(request: ListRequest): Promise<ListResponse> {
return this.client.call(
@@ -87,10 +95,24 @@ export interface DeployRequest {
export interface DeployResponse {}
export interface DescribeRequest {
// The name of the function
name?: string;
// Optional project name
project?: string;
}
export interface DescribeResponse {
status?: string;
timeout?: string;
updateTime?: string;
}
export interface Func {
// name of handler in source code
entrypoint?: string;
// function name
// limitation: must be unique across projects
name?: string;
// project of function, optional
// defaults to literal "default"