All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| CreateNewServiceToken | Post /security/tokens | Create new service token |
| DeleteServiceToken | Delete /security/tokens/{serviceTokenId} | Delete service token |
| GetServiceTokens | Get /security/tokens | Get service tokens |
ServiceTokenCreatedResponse CreateNewServiceToken(ctx).NewServiceTokenRequest(newServiceTokenRequest).Execute()
Create new service token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
newServiceTokenRequest := *openapiclient.NewNewServiceTokenRequest("Name_example", []string{"Roles_example"}) // NewServiceTokenRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServiceTokenApi.CreateNewServiceToken(context.Background()).NewServiceTokenRequest(newServiceTokenRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceTokenApi.CreateNewServiceToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateNewServiceToken`: ServiceTokenCreatedResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceTokenApi.CreateNewServiceToken`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateNewServiceTokenRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| newServiceTokenRequest | NewServiceTokenRequest |
ApiToken, ServiceBearer, ServiceToken
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteServiceToken(ctx, serviceTokenId).Execute()
Delete service token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
serviceTokenId := int64(789) // int64 | The identifier of a service token
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServiceTokenApi.DeleteServiceToken(context.Background(), serviceTokenId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceTokenApi.DeleteServiceToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceTokenId | int64 | The identifier of a service token |
Other parameters are passed through a pointer to a apiDeleteServiceTokenRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ServiceToken GetServiceTokens(ctx).Execute()
Get service tokens
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServiceTokenApi.GetServiceTokens(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceTokenApi.GetServiceTokens``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetServiceTokens`: []ServiceToken
fmt.Fprintf(os.Stdout, "Response from `ServiceTokenApi.GetServiceTokens`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetServiceTokensRequest struct via the builder pattern
ApiToken, ServiceBearer, ServiceToken
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]