\RoleApi

All URIs are relative to http://localhost/api/v1

MethodHTTP requestDescription
DeleteRoleDelete /roles/{role_name}Delete a role
GetRoleGet /roles/{role_name}Get a role
GetRolesGet /rolesList roles
PatchRolePatch /roles/{role_name}Update a role
PostRolePost /rolesCreate a role

DeleteRole

DeleteRole(ctx, roleName).Execute()

Delete a role

Example

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)
    }
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
roleNamestringThe role name

Other Parameters

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

NameTypeDescriptionNotes

Return type

(empty response body)

Authorization

Basic, Kerberos

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetRole

Role GetRole(ctx, roleName).Execute()

Get a role

Example

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)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
roleNamestringThe role name

Other Parameters

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

NameTypeDescriptionNotes

Return type

Role

Authorization

Basic, Kerberos

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetRoles

RoleCollection GetRoles(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()

List roles

Example

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)
}

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
limitint32The numbers of items to return.[default to 100]
offsetint32The number of items to skip before starting to collect the result set.
orderBystringThe 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

Return type

RoleCollection

Authorization

Basic, Kerberos

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchRole

Role PatchRole(ctx, roleName).Role(role).UpdateMask(updateMask).Execute()

Update a role

Example

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)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
roleNamestringThe role name

Other Parameters

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

NameTypeDescriptionNotes

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. |

Return type

Role

Authorization

Basic, Kerberos

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostRole

Role PostRole(ctx).Role(role).Execute()

Create a role

Example

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)
}

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
roleRole

Return type

Role

Authorization

Basic, Kerberos

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]