Skip to content

Latest commit

 

History

History
290 lines (184 loc) · 7.26 KB

File metadata and controls

290 lines (184 loc) · 7.26 KB

\KeypairAPI

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
DeleteKeyPair Delete /core/keypair/{id} Delete key pair
ImportKeyPair Post /core/keypairs Import key pair
ListKeyPairs Get /core/keypairs List key pairs
UpdateKeyPairName Put /core/keypair/{id} Update key pair name

DeleteKeyPair

ResponseModel DeleteKeyPair(ctx, id).Execute()

Delete key pair

Example

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

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

ImportKeyPair

ImportKeypairResponse ImportKeyPair(ctx).Payload(payload).Execute()

Import key pair

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	payload := *openapiclient.NewImportKeypairPayload("EnvironmentName_example", "Name_example", "PublicKey_example") // ImportKeypairPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.KeypairAPI.ImportKeyPair(context.Background()).Payload(payload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `KeypairAPI.ImportKeyPair``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ImportKeyPair`: ImportKeypairResponse
	fmt.Fprintf(os.Stdout, "Response from `KeypairAPI.ImportKeyPair`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
payload ImportKeypairPayload

Return type

ImportKeypairResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

ListKeyPairs

Keypairs ListKeyPairs(ctx).Page(page).PageSize(pageSize).Search(search).Execute()

List key pairs

Example

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)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.KeypairAPI.ListKeyPairs(context.Background()).Page(page).PageSize(pageSize).Search(search).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `KeypairAPI.ListKeyPairs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListKeyPairs`: Keypairs
	fmt.Fprintf(os.Stdout, "Response from `KeypairAPI.ListKeyPairs`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
page string Page Number
pageSize string Data Per Page
search string

Return type

Keypairs

Authorization

apiKey

HTTP request headers

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

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

UpdateKeyPairName

UpdateKeypairNameResponse UpdateKeyPairName(ctx, id).Payload(payload).Execute()

Update key pair name

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	id := int32(56) // int32 | 
	payload := *openapiclient.NewUpdateKeypairName("Name_example") // UpdateKeypairName | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.KeypairAPI.UpdateKeyPairName(context.Background(), id).Payload(payload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `KeypairAPI.UpdateKeyPairName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateKeyPairName`: UpdateKeypairNameResponse
	fmt.Fprintf(os.Stdout, "Response from `KeypairAPI.UpdateKeyPairName`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

payload | UpdateKeypairName | |

Return type

UpdateKeypairNameResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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