All URIs are relative to https://chaos.qernal.com/v1
Method | HTTP request | Description |
---|---|---|
FunctionsCreate | Post /functions | Create function |
FunctionsDelete | Delete /functions/{function_id} | Delete function |
FunctionsGet | Get /functions/{function_id} | Get function (latest revision) |
FunctionsRevisionsGet | Get /functions/{function_id}/revisions/{function_revision_id} | Get a specific revision of a function |
FunctionsRevisionsList | Get /functions/{function_id}/revisions | List all revisions for a function |
FunctionsUpdate | Put /functions/{function_id} | Update function |
ProjectsFunctionsList | Get /projects/{project_id}/functions | List all functions within a project |
Function FunctionsCreate(ctx).FunctionBody(functionBody).Execute()
Create function
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionBody := *openapiclient.NewFunctionBody("51687d2f-07b0-4260-8ecb-f5098305fdd4", "1.0.0", "my-function", "My function does this", "docker.io/my-image:latest", openapiclient.FunctionType("http"), *openapiclient.NewFunctionSize(int32(128), int32(128)), int32(8080), *openapiclient.NewFunctionScaling("cpu", int32(30), int32(60)), []openapiclient.FunctionDeploymentBody{*openapiclient.NewFunctionDeploymentBody(*openapiclient.NewLocation("51687d2f-07b0-4260-8ecb-f5098305fdd4"), *openapiclient.NewFunctionReplicas(int32(1), int32(5), *openapiclient.NewFunctionReplicasAffinity(true, true)))}, []openapiclient.FunctionEnv{*openapiclient.NewFunctionEnv("MY_ENV_VAR", "projects:0a6b9ff3-6807-4820-b94b-5e1d7efcdd93/MY_SECRET@0")}, []openapiclient.FunctionCompliance{openapiclient.FunctionCompliance("soc2")}) // FunctionBody | Create/Update any field
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsCreate(context.Background()).FunctionBody(functionBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsCreate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsCreate`: Function
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsCreate`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiFunctionsCreateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
functionBody | FunctionBody | Create/Update any field |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeletedResponse FunctionsDelete(ctx, functionId).Execute()
Delete function
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function ID reference
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsDelete(context.Background(), functionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsDelete`: DeletedResponse
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsDelete`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
functionId | string | Function ID reference |
Other parameters are passed through a pointer to a apiFunctionsDeleteRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Function FunctionsGet(ctx, functionId).Execute()
Get function (latest revision)
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function ID reference
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsGet(context.Background(), functionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsGet`: Function
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsGet`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
functionId | string | Function ID reference |
Other parameters are passed through a pointer to a apiFunctionsGetRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Function FunctionsRevisionsGet(ctx, functionId, functionRevisionId).Execute()
Get a specific revision of a function
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function ID reference
functionRevisionId := "1069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function revision ID reference
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsRevisionsGet(context.Background(), functionId, functionRevisionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsRevisionsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsRevisionsGet`: Function
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsRevisionsGet`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
functionId | string | Function ID reference | |
functionRevisionId | string | Function revision ID reference |
Other parameters are passed through a pointer to a apiFunctionsRevisionsGetRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListFunction FunctionsRevisionsList(ctx, functionId).Page(page).Execute()
List all revisions for a function
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function ID reference
page := *openapiclient.NewOrganisationsListPageParameter() // OrganisationsListPageParameter | Query parameters for pagination (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsRevisionsList(context.Background(), functionId).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsRevisionsList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsRevisionsList`: ListFunction
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsRevisionsList`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
functionId | string | Function ID reference |
Other parameters are passed through a pointer to a apiFunctionsRevisionsListRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
page | OrganisationsListPageParameter | Query parameters for pagination |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Function FunctionsUpdate(ctx, functionId).Function(function).Execute()
Update function
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
functionId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Function ID reference
function := *openapiclient.NewFunction("51687d2f-07b0-4260-8ecb-f5098305fdd4", "51687d2f-07b0-4260-8ecb-f5098305fdd4", "1.0.0", "my-function", "My function does this", "docker.io/my-image:latest", "51687d2f-07b0-4260-8ecb-f5098305fdd4", openapiclient.FunctionType("http"), *openapiclient.NewFunctionSize(int32(128), int32(128)), int32(8080), *openapiclient.NewFunctionScaling("cpu", int32(30), int32(60)), []openapiclient.FunctionDeployment{*openapiclient.NewFunctionDeployment(*openapiclient.NewLocation("51687d2f-07b0-4260-8ecb-f5098305fdd4"), *openapiclient.NewFunctionReplicas(int32(1), int32(5), *openapiclient.NewFunctionReplicasAffinity(true, true)))}, []openapiclient.FunctionEnv{*openapiclient.NewFunctionEnv("MY_ENV_VAR", "projects:0a6b9ff3-6807-4820-b94b-5e1d7efcdd93/MY_SECRET@0")}, []openapiclient.FunctionCompliance{openapiclient.FunctionCompliance("soc2")}) // Function | Update any field
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.FunctionsUpdate(context.Background(), functionId).Function(function).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionsUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FunctionsUpdate`: Function
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionsUpdate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
functionId | string | Function ID reference |
Other parameters are passed through a pointer to a apiFunctionsUpdateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
function | Function | Update any field |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListFunction ProjectsFunctionsList(ctx, projectId).Page(page).Execute()
List all functions within a project
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/qernal/openapi-chaos-go-client"
)
func main() {
projectId := "3069614e-adc8-47cb-a69c-decf9c5f90fc" // string | Project ID reference
page := *openapiclient.NewOrganisationsListPageParameter() // OrganisationsListPageParameter | Query parameters for pagination (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FunctionsAPI.ProjectsFunctionsList(context.Background(), projectId).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.ProjectsFunctionsList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ProjectsFunctionsList`: ListFunction
fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.ProjectsFunctionsList`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectId | string | Project ID reference |
Other parameters are passed through a pointer to a apiProjectsFunctionsListRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
page | OrganisationsListPageParameter | Query parameters for pagination |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]