All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| DeleteAPIKey | Delete /api-key/{api_key_id} | Delete API Key |
| GenerateAPIKey | Post /api-key/generate | Generate API Key |
| GetAPIKey | Get /api-key | Retrieve API Keys |
| UpdateAPIKey | Put /api-key/{api_key_id} | Update API Key |
CommonResponseModel DeleteAPIKey(ctx, apiKeyId).Execute()
Delete API Key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
apiKeyId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApiKeyAPI.DeleteAPIKey(context.Background(), apiKeyId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApiKeyAPI.DeleteAPIKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAPIKey`: CommonResponseModel
fmt.Fprintf(os.Stdout, "Response from `ApiKeyAPI.DeleteAPIKey`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| apiKeyId | int32 |
Other parameters are passed through a pointer to a apiDeleteAPIKeyRequest 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]
GenerateUpdateApiKeyResponseModel GenerateAPIKey(ctx).Payload(payload).Execute()
Generate API Key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
payload := *openapiclient.NewGenerateUpdateApiKeyPayload("Name_example") // GenerateUpdateApiKeyPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApiKeyAPI.GenerateAPIKey(context.Background()).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApiKeyAPI.GenerateAPIKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GenerateAPIKey`: GenerateUpdateApiKeyResponseModel
fmt.Fprintf(os.Stdout, "Response from `ApiKeyAPI.GenerateAPIKey`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGenerateAPIKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| payload | GenerateUpdateApiKeyPayload |
GenerateUpdateApiKeyResponseModel
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetApiKeysResponseModel GetAPIKey(ctx).Execute()
Retrieve API Keys
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.ApiKeyAPI.GetAPIKey(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApiKeyAPI.GetAPIKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAPIKey`: GetApiKeysResponseModel
fmt.Fprintf(os.Stdout, "Response from `ApiKeyAPI.GetAPIKey`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetAPIKeyRequest 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]
GenerateUpdateApiKeyResponseModel UpdateAPIKey(ctx, apiKeyId).Payload(payload).Execute()
Update API Key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
apiKeyId := int32(56) // int32 |
payload := *openapiclient.NewGenerateUpdateApiKeyPayload("Name_example") // GenerateUpdateApiKeyPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ApiKeyAPI.UpdateAPIKey(context.Background(), apiKeyId).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ApiKeyAPI.UpdateAPIKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAPIKey`: GenerateUpdateApiKeyResponseModel
fmt.Fprintf(os.Stdout, "Response from `ApiKeyAPI.UpdateAPIKey`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| apiKeyId | int32 |
Other parameters are passed through a pointer to a apiUpdateAPIKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
payload | GenerateUpdateApiKeyPayload | |
GenerateUpdateApiKeyResponseModel
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]