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/{id} | Delete volume |
FetchVolumeDetails | Get /core/volume/{volume_id} | Fetch Volume Details |
FetchVolumeNameAvailability | Get /core/volume/name-availability/{name} | Fetch volume name availability |
ListVolumeTypes | Get /core/volume-types | List volume types |
ListVolumes | Get /core/volumes | List volumes |
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, id).Execute()
Delete volume
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.VolumeAPI.DeleteVolume(context.Background(), id).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. | |
id | 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]
Volumes FetchVolumeDetails(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.FetchVolumeDetails(context.Background(), volumeId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumeAPI.FetchVolumeDetails``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FetchVolumeDetails`: Volumes
fmt.Fprintf(os.Stdout, "Response from `VolumeAPI.FetchVolumeDetails`: %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 apiFetchVolumeDetailsRequest 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]
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]