All URIs are relative to /service/rest
| Method | HTTP request | Description |
|---|---|---|
| CreateSecurityRoles | Post /v1/security/roles | Create role |
| DeleteSecurityRoles | Delete /v1/security/roles/{id} | Delete role |
| GetSecurityRoles | Get /v1/security/roles/{id} | Get role |
| ListSecurityRoles | Get /v1/security/roles | List roles |
| ListSecurityRolesAssignable | Get /v1/security/roles/assignable | Get assignable roles |
| UpdateSecurityRoles | Put /v1/security/roles/{id} | Update role |
RoleXOResponse CreateSecurityRoles(ctx).RoleXORequest(roleXORequest).Execute()
Create role
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
roleXORequest := *sonatyperepo.NewRoleXORequest("Id_example", "Name_example") // RoleXORequest | A role configuration
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityManagementRolesAPI.CreateSecurityRoles(context.Background()).RoleXORequest(roleXORequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.CreateSecurityRoles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateSecurityRoles`: RoleXOResponse
fmt.Fprintf(os.Stdout, "Response from `SecurityManagementRolesAPI.CreateSecurityRoles`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateSecurityRolesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| roleXORequest | RoleXORequest | A role configuration |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSecurityRoles(ctx, id).Execute()
Delete role
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
id := "id_example" // string | The id of the role to delete
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
r, err := apiClient.SecurityManagementRolesAPI.DeleteSecurityRoles(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.DeleteSecurityRoles``: %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. | |
| id | string | The id of the role to delete |
Other parameters are passed through a pointer to a apiDeleteSecurityRolesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleXOResponse GetSecurityRoles(ctx, id).Source(source).Execute()
Get role
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
id := "id_example" // string | The id of the role to get
source := "source_example" // string | The id of the user source to filter the roles by. Available sources can be fetched using the 'User Sources' endpoint. (optional) (default to "default")
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityManagementRolesAPI.GetSecurityRoles(context.Background(), id).Source(source).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.GetSecurityRoles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetSecurityRoles`: RoleXOResponse
fmt.Fprintf(os.Stdout, "Response from `SecurityManagementRolesAPI.GetSecurityRoles`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The id of the role to get |
Other parameters are passed through a pointer to a apiGetSecurityRolesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
source | string | The id of the user source to filter the roles by. Available sources can be fetched using the 'User Sources' endpoint. | [default to "default"]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]RoleXOResponse ListSecurityRoles(ctx).Source(source).Execute()
List roles
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
source := "source_example" // string | The id of the user source to filter the roles by, if supplied. Otherwise roles from all user sources will be returned. (optional)
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityManagementRolesAPI.ListSecurityRoles(context.Background()).Source(source).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.ListSecurityRoles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSecurityRoles`: []RoleXOResponse
fmt.Fprintf(os.Stdout, "Response from `SecurityManagementRolesAPI.ListSecurityRoles`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListSecurityRolesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| source | string | The id of the user source to filter the roles by, if supplied. Otherwise roles from all user sources will be returned. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]RoleXOResponse ListSecurityRolesAssignable(ctx).Source(source).Execute()
Get assignable roles
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
source := "source_example" // string | The id of the user source to filter the roles by, if supplied. Otherwise roles from default user source will be returned. Available sources can be fetched using the 'User Sources' endpoint. (optional) (default to "default")
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
resp, r, err := apiClient.SecurityManagementRolesAPI.ListSecurityRolesAssignable(context.Background()).Source(source).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.ListSecurityRolesAssignable``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSecurityRolesAssignable`: []RoleXOResponse
fmt.Fprintf(os.Stdout, "Response from `SecurityManagementRolesAPI.ListSecurityRolesAssignable`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListSecurityRolesAssignableRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| source | string | The id of the user source to filter the roles by, if supplied. Otherwise roles from default user source will be returned. Available sources can be fetched using the 'User Sources' endpoint. | [default to "default"] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSecurityRoles(ctx, id).RoleXORequest(roleXORequest).Execute()
Update role
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
id := "id_example" // string | The id of the role to update
roleXORequest := *sonatyperepo.NewRoleXORequest("Id_example", "Name_example") // RoleXORequest | A role configuration
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
r, err := apiClient.SecurityManagementRolesAPI.UpdateSecurityRoles(context.Background(), id).RoleXORequest(roleXORequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementRolesAPI.UpdateSecurityRoles``: %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. | |
| id | string | The id of the role to update |
Other parameters are passed through a pointer to a apiUpdateSecurityRolesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
roleXORequest | RoleXORequest | A role configuration |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]