All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
DeleteRole | Delete /roles/{role_name} | Delete a role |
GetRole | Get /roles/{role_name} | Get a role |
GetRoles | Get /roles | List roles |
PatchRole | Patch /roles/{role_name} | Update a role |
PostRole | Post /roles | Create a role |
DeleteRole(ctx, roleName).Execute()
Delete a role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
roleName := "roleName_example" // string | The role name
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.RoleApi.DeleteRole(context.Background(), roleName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.DeleteRole``: %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. | |
roleName | string | The role name |
Other parameters are passed through a pointer to a apiDeleteRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role GetRole(ctx, roleName).Execute()
Get a role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
roleName := "roleName_example" // string | The role name
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.RoleApi.GetRole(context.Background(), roleName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.GetRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetRole`: Role
fmt.Fprintf(os.Stdout, "Response from `RoleApi.GetRole`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
roleName | string | The role name |
Other parameters are passed through a pointer to a apiGetRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleCollection GetRoles(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()
List roles
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100)
offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional)
orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.RoleApi.GetRoles(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.GetRoles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetRoles`: RoleCollection
fmt.Fprintf(os.Stdout, "Response from `RoleApi.GetRoles`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetRolesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
limit | int32 | The numbers of items to return. | [default to 100] |
offset | int32 | The number of items to skip before starting to collect the result set. | |
orderBy | string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. New in version 2.1.0 |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role PatchRole(ctx, roleName).Role(role).UpdateMask(updateMask).Execute()
Update a role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
roleName := "roleName_example" // string | The role name
role := *openapiclient.NewRole() // Role |
updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.RoleApi.PatchRole(context.Background(), roleName).Role(role).UpdateMask(updateMask).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.PatchRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchRole`: Role
fmt.Fprintf(os.Stdout, "Response from `RoleApi.PatchRole`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
roleName | string | The role name |
Other parameters are passed through a pointer to a apiPatchRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
role | Role | | updateMask | []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role PostRole(ctx).Role(role).Execute()
Create a role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
role := *openapiclient.NewRole() // Role |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.RoleApi.PostRole(context.Background()).Role(role).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.PostRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostRole`: Role
fmt.Fprintf(os.Stdout, "Response from `RoleApi.PostRole`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiPostRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
role | Role |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]