All URIs are relative to https://dashboard.quantcdn.io
| Method | HTTP request | Description |
|---|---|---|
| TokensCreate | Post /api/v2/organizations/{organization}/tokens | Create a new API token scoped to this organization |
| TokensDelete | Delete /api/v2/organizations/{organization}/tokens/{token_id} | Revoke an API token |
| TokensList | Get /api/v2/organizations/{organization}/tokens | List API tokens scoped to this organization |
TokensCreate201Response TokensCreate(ctx, organization).TokensCreateRequest(tokensCreateRequest).Execute()
Create a new API token scoped to this organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/quantcdn/quant-admin-go"
)
func main() {
organization := "test-org" // string | Organization identifier
tokensCreateRequest := *openapiclient.NewTokensCreateRequest("My CI token") // TokensCreateRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TokensAPI.TokensCreate(context.Background(), organization).TokensCreateRequest(tokensCreateRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TokensAPI.TokensCreate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TokensCreate`: TokensCreate201Response
fmt.Fprintf(os.Stdout, "Response from `TokensAPI.TokensCreate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| organization | string | Organization identifier |
Other parameters are passed through a pointer to a apiTokensCreateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
tokensCreateRequest | TokensCreateRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TokensDelete200Response TokensDelete(ctx, organization, tokenId).Execute()
Revoke an API token
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/quantcdn/quant-admin-go"
)
func main() {
organization := "test-org" // string | Organization identifier
tokenId := int32(42) // int32 | Token ID to revoke
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TokensAPI.TokensDelete(context.Background(), organization, tokenId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TokensAPI.TokensDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TokensDelete`: TokensDelete200Response
fmt.Fprintf(os.Stdout, "Response from `TokensAPI.TokensDelete`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| organization | string | Organization identifier | |
| tokenId | int32 | Token ID to revoke |
Other parameters are passed through a pointer to a apiTokensDeleteRequest 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]
[]TokensList200ResponseInner TokensList(ctx, organization).Execute()
List API tokens scoped to this organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/quantcdn/quant-admin-go"
)
func main() {
organization := "test-org" // string | Organization identifier
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TokensAPI.TokensList(context.Background(), organization).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TokensAPI.TokensList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TokensList`: []TokensList200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `TokensAPI.TokensList`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| organization | string | Organization identifier |
Other parameters are passed through a pointer to a apiTokensListRequest 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]