Skip to content

Latest commit

 

History

History
410 lines (265 loc) · 11.9 KB

File metadata and controls

410 lines (265 loc) · 11.9 KB

\SecurityManagementRolesAPI

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

CreateSecurityRoles

RoleXOResponse CreateSecurityRoles(ctx).RoleXORequest(roleXORequest).Execute()

Create role

Example

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

Path Parameters

Other Parameters

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

Name Type Description Notes
roleXORequest RoleXORequest A role configuration

Return type

RoleXOResponse

Authorization

BasicAuth

HTTP request headers

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

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

DeleteSecurityRoles

DeleteSecurityRoles(ctx, id).Execute()

Delete role

Example

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

Path Parameters

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

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

Name Type Description Notes

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetSecurityRoles

RoleXOResponse GetSecurityRoles(ctx, id).Source(source).Execute()

Get role

Example

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

Path Parameters

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

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"]

Return type

RoleXOResponse

Authorization

BasicAuth

HTTP request headers

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

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

ListSecurityRoles

[]RoleXOResponse ListSecurityRoles(ctx).Source(source).Execute()

List roles

Example

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

Path Parameters

Other Parameters

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.

Return type

[]RoleXOResponse

Authorization

BasicAuth

HTTP request headers

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

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

ListSecurityRolesAssignable

[]RoleXOResponse ListSecurityRolesAssignable(ctx).Source(source).Execute()

Get assignable roles

Example

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

Path Parameters

Other Parameters

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"]

Return type

[]RoleXOResponse

Authorization

BasicAuth

HTTP request headers

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

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

UpdateSecurityRoles

UpdateSecurityRoles(ctx, id).RoleXORequest(roleXORequest).Execute()

Update role

Example

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

Path Parameters

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

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

Name Type Description Notes

roleXORequest | RoleXORequest | A role configuration |

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

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

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