Skip to content

Latest commit

 

History

History
211 lines (137 loc) · 5.96 KB

File metadata and controls

211 lines (137 loc) · 5.96 KB

\AccessKeysAPI

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

Method HTTP request Description
CreateAccessKeyEndpoint Post /object-storage/access-keys Generate a new access key
DeleteAccessKeyEndpoint Delete /object-storage/access-keys/{access_key_id} Remove an existing access key
ListAccessKeysEndpoint Get /object-storage/access-keys List access keys

CreateAccessKeyEndpoint

ObjectStorageAccessKeyCreateResponse CreateAccessKeyEndpoint(ctx).Body(body).Execute()

Generate a new access key

Example

package main

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

func main() {
	body := *openapiclient.NewObjectStorageAccessKeyCreateRequest(openapiclient.object_storage__RegionsEnum("CANADA-1")) // ObjectStorageAccessKeyCreateRequest |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
body ObjectStorageAccessKeyCreateRequest

Return type

ObjectStorageAccessKeyCreateResponse

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]

DeleteAccessKeyEndpoint

ObjectStorageDeleteResponse DeleteAccessKeyEndpoint(ctx, accessKeyId).Execute()

Remove an existing access key

Example

package main

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

func main() {
	accessKeyId := "accessKeyId_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

ObjectStorageDeleteResponse

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]

ListAccessKeysEndpoint

ObjectStorageAccessKeyListResponse ListAccessKeysEndpoint(ctx).Search(search).Page(page).PageSize(pageSize).Execute()

List access keys

Example

package main

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

func main() {
	search := "search_example" // string |  (optional)
	page := "page_example" // string |  (optional)
	pageSize := "pageSize_example" // string |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
search string
page string
pageSize string

Return type

ObjectStorageAccessKeyListResponse

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]