Skip to content

Latest commit

 

History

History
148 lines (96 loc) · 3.7 KB

DisksAPI.md

File metadata and controls

148 lines (96 loc) · 3.7 KB

\DisksAPI

All URIs are relative to https://api.aptible.com

Method HTTP request Description
GetDisk Get /disks/{id} show disk
ListDisksForAccount Get /accounts/{account_id}/disks list disks

GetDisk

Disk GetDisk(ctx, id).Execute()

show disk

Example

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.DisksAPI.GetDisk(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DisksAPI.GetDisk``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetDisk`: Disk
	fmt.Fprintf(os.Stdout, "Response from `DisksAPI.GetDisk`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 id

Other Parameters

Other parameters are passed through a pointer to a apiGetDiskRequest struct via the builder pattern

Name Type Description Notes

Return type

Disk

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDisksForAccount

ListDisksForAccount200Response ListDisksForAccount(ctx, accountId).Page(page).Execute()

list disks

Example

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.DisksAPI.ListDisksForAccount(context.Background(), accountId).Page(page).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DisksAPI.ListDisksForAccount``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListDisksForAccount`: ListDisksForAccount200Response
	fmt.Fprintf(os.Stdout, "Response from `DisksAPI.ListDisksForAccount`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
accountId int32 account_id

Other Parameters

Other parameters are passed through a pointer to a apiListDisksForAccountRequest struct via the builder pattern

Name Type Description Notes

page | int32 | current page of results for pagination |

Return type

ListDisksForAccount200Response

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]