All URIs are relative to https://api.aptible.com
Method | HTTP request | Description |
---|---|---|
GetPersistentDisk | Get /persistent_disks/{id} | show persistent disk |
ListPersistentDisksForAccount | Get /accounts/{account_id}/persistent_disks | list persistent disks |
PersistentDisk GetPersistentDisk(ctx, id).Execute()
show persistent disk
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
id := int32(56) // int32 | id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PersistentDisksAPI.GetPersistentDisk(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PersistentDisksAPI.GetPersistentDisk``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetPersistentDisk`: PersistentDisk
fmt.Fprintf(os.Stdout, "Response from `PersistentDisksAPI.GetPersistentDisk`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | id |
Other parameters are passed through a pointer to a apiGetPersistentDiskRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListPersistentDisksForAccount200Response ListPersistentDisksForAccount(ctx, accountId).Page(page).Execute()
list persistent disks
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
accountId := int32(56) // int32 | account_id
page := int32(56) // int32 | current page of results for pagination (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PersistentDisksAPI.ListPersistentDisksForAccount(context.Background(), accountId).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PersistentDisksAPI.ListPersistentDisksForAccount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListPersistentDisksForAccount`: ListPersistentDisksForAccount200Response
fmt.Fprintf(os.Stdout, "Response from `PersistentDisksAPI.ListPersistentDisksForAccount`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
accountId | int32 | account_id |
Other parameters are passed through a pointer to a apiListPersistentDisksForAccountRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
page | int32 | current page of results for pagination |
ListPersistentDisksForAccount200Response
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]