All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateVolume | Post /core/volumes | Create volume |
| DeleteVolume | Delete /core/volumes/{volume_id} | Delete volume |
| FetchVolumeNameAvailability | Get /core/volume/name-availability/{name} | Fetch volume name availability |
| GetVolume | Get /core/volumes/{volume_id} | Fetch Volume Details |
| ListVolumeTypes | Get /core/volume-types | List volume types |
| ListVolumes | Get /core/volumes | List volumes |
| UpdateVolume | Patch /core/volumes/{volume_id} | Update volume fields |
Volume CreateVolume(ctx).Payload(payload).Execute()
Create volume
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
payload := *openapiclient.NewCreateVolumePayload("EnvironmentName_example", "Name_example", int32(123), "VolumeType_example") // CreateVolumePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.CreateVolume(context.Background()).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.CreateVolume``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateVolume`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.CreateVolume`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateVolumeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| payload | CreateVolumePayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseModel DeleteVolume(ctx, volumeId).Execute()
Delete volume
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
volumeId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.DeleteVolume(context.Background(), volumeId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.DeleteVolume``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteVolume`: ResponseModel
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.DeleteVolume`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| volumeId | int32 |
Other parameters are passed through a pointer to a apiDeleteVolumeRequest 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]
NameAvailableModel FetchVolumeNameAvailability(ctx, name).Execute()
Fetch volume name availability
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
name := "name_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.FetchVolumeNameAvailability(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.FetchVolumeNameAvailability``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FetchVolumeNameAvailability`: NameAvailableModel
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.FetchVolumeNameAvailability`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string |
Other parameters are passed through a pointer to a apiFetchVolumeNameAvailabilityRequest 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]
Volume GetVolume(ctx, volumeId).Execute()
Fetch Volume Details
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
volumeId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.GetVolume(context.Background(), volumeId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.GetVolume``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetVolume`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.GetVolume`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| volumeId | int32 |
Other parameters are passed through a pointer to a apiGetVolumeRequest 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]
VolumeTypes ListVolumeTypes(ctx).Execute()
List volume types
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.ListVolumeTypes(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.ListVolumeTypes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListVolumeTypes`: VolumeTypes
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.ListVolumeTypes`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListVolumeTypesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Volumes ListVolumes(ctx).Page(page).PageSize(pageSize).Search(search).Environment(environment).Execute()
List volumes
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
page := "page_example" // string | Page Number (optional)
pageSize := "pageSize_example" // string | Data Per Page (optional)
search := "search_example" // string | (optional)
environment := "environment_example" // string | Filter Environment ID or Name (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.ListVolumes(context.Background()).Page(page).PageSize(pageSize).Search(search).Environment(environment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.ListVolumes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListVolumes`: Volumes
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.ListVolumes`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListVolumesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| page | string | Page Number | |
| pageSize | string | Data Per Page | |
| search | string | ||
| environment | string | Filter Environment ID or Name |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateVolumeResponse UpdateVolume(ctx, volumeId).Payload(payload).Execute()
Update volume fields
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
volumeId := int32(56) // int32 |
payload := *openapiclient.NewUpdateVolumePayload("EnvironmentName_example") // UpdateVolumePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VolumeAPI.UpdateVolume(context.Background(), volumeId).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.UpdateVolume``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateVolume`: UpdateVolumeResponse
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.UpdateVolume`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| volumeId | int32 |
Other parameters are passed through a pointer to a apiUpdateVolumeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
payload | UpdateVolumePayload | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]