All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateTemplate | Post /core/marketplace/templates | Create template |
| DeleteTemplate | Delete /core/marketplace/templates/{id} | Delete template |
| GetTemplate | Get /core/marketplace/templates/{id} | Retrieve template details |
| ListTemplates | Get /core/marketplace/templates | List templates |
| UpdateTemplate | Put /core/marketplace/templates/{id} | Update template |
Template CreateTemplate(ctx).Content(content).Description(description).IsPublic(isPublic).Name(name).Execute()
Create template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
content := os.NewFile(1234, "some_file") // *os.File | YAML file is required
description := "description_example" // string | description is required
isPublic := "isPublic_example" // string | is_public is required
name := "name_example" // string | name is required
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplateAPI.CreateTemplate(context.Background()).Content(content).Description(description).IsPublic(isPublic).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplateAPI.CreateTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTemplate`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplateAPI.CreateTemplate`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateTemplateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| content | *os.File | YAML file is required | |
| description | string | description is required | |
| isPublic | string | is_public is required | |
| name | string | name is required |
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseModel DeleteTemplate(ctx, id).Execute()
Delete template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
id := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplateAPI.DeleteTemplate(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplateAPI.DeleteTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteTemplate`: ResponseModel
fmt.Fprintf(os.Stdout, "Response from `TemplateAPI.DeleteTemplate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | int32 |
Other parameters are passed through a pointer to a apiDeleteTemplateRequest 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]
Template GetTemplate(ctx, id).Execute()
Retrieve template details
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
id := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplateAPI.GetTemplate(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplateAPI.GetTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTemplate`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplateAPI.GetTemplate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | int32 |
Other parameters are passed through a pointer to a apiGetTemplateRequest 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]
Templates ListTemplates(ctx).Visibility(visibility).Execute()
List templates
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
visibility := "visibility_example" // string | Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplateAPI.ListTemplates(context.Background()).Visibility(visibility).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplateAPI.ListTemplates``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListTemplates`: Templates
fmt.Fprintf(os.Stdout, "Response from `TemplateAPI.ListTemplates`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListTemplatesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| visibility | string | Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Template UpdateTemplate(ctx, id).Payload(payload).Execute()
Update template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
id := int32(56) // int32 |
payload := *openapiclient.NewUpdateTemplate() // UpdateTemplate |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplateAPI.UpdateTemplate(context.Background(), id).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplateAPI.UpdateTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateTemplate`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplateAPI.UpdateTemplate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | int32 |
Other parameters are passed through a pointer to a apiUpdateTemplateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
payload | UpdateTemplate | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]