Skip to content

Latest commit

 

History

History
350 lines (220 loc) · 8.2 KB

LambdaAPI.md

File metadata and controls

350 lines (220 loc) · 8.2 KB

\LambdaAPI

All URIs are relative to http://localhost:8081

Method HTTP request Description
CreateLambda Post /lambda Create lambda
DestroyLambda Post /lambda/{id}/destroy Destroy lambda
GetLambda Get /lambda/{id} Get lambda
ListLambdas Get /lambda List lambdas
StartLambda Post /lambda/{id}/start Start lambda

CreateLambda

Lambda CreateLambda(ctx).CreateLambda(createLambda).Execute()

Create lambda

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/onpremless/go-client"
)

func main() {
    createLambda := *openapiclient.NewCreateLambda("Archive_example", "Name_example", "Runtime_example", "LambdaType_example") // CreateLambda | Create lambda body

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.LambdaAPI.CreateLambda(context.Background()).CreateLambda(createLambda).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LambdaAPI.CreateLambda``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateLambda`: Lambda
    fmt.Fprintf(os.Stdout, "Response from `LambdaAPI.CreateLambda`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateLambdaRequest struct via the builder pattern

Name Type Description Notes
createLambda CreateLambda Create lambda body

Return type

Lambda

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DestroyLambda

TaskResponse DestroyLambda(ctx, id).Execute()

Destroy lambda

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/onpremless/go-client"
)

func main() {
    id := "id_example" // string | lambda id

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.LambdaAPI.DestroyLambda(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LambdaAPI.DestroyLambda``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DestroyLambda`: TaskResponse
    fmt.Fprintf(os.Stdout, "Response from `LambdaAPI.DestroyLambda`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string lambda id

Other Parameters

Other parameters are passed through a pointer to a apiDestroyLambdaRequest struct via the builder pattern

Name Type Description Notes

Return type

TaskResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLambda

Lambda GetLambda(ctx, id).Execute()

Get lambda

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/onpremless/go-client"
)

func main() {
    id := "id_example" // string | lambda id

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.LambdaAPI.GetLambda(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LambdaAPI.GetLambda``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetLambda`: Lambda
    fmt.Fprintf(os.Stdout, "Response from `LambdaAPI.GetLambda`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string lambda id

Other Parameters

Other parameters are passed through a pointer to a apiGetLambdaRequest struct via the builder pattern

Name Type Description Notes

Return type

Lambda

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListLambdas

[]Lambda ListLambdas(ctx).Execute()

List lambdas

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/onpremless/go-client"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.LambdaAPI.ListLambdas(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LambdaAPI.ListLambdas``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListLambdas`: []Lambda
    fmt.Fprintf(os.Stdout, "Response from `LambdaAPI.ListLambdas`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListLambdasRequest struct via the builder pattern

Return type

[]Lambda

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StartLambda

TaskResponse StartLambda(ctx, id).Execute()

Start lambda

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/onpremless/go-client"
)

func main() {
    id := "id_example" // string | lambda id

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.LambdaAPI.StartLambda(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LambdaAPI.StartLambda``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `StartLambda`: TaskResponse
    fmt.Fprintf(os.Stdout, "Response from `LambdaAPI.StartLambda`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string lambda id

Other Parameters

Other parameters are passed through a pointer to a apiStartLambdaRequest struct via the builder pattern

Name Type Description Notes

Return type

TaskResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]