Skip to content

Latest commit

 

History

History
293 lines (209 loc) · 8.98 KB

File metadata and controls

293 lines (209 loc) · 8.98 KB

nexus_api_python_client.SecurityManagementRolesApi

All URIs are relative to http://localhost/service/rest

Method HTTP request Description
create POST /beta/security/roles Create role
delete DELETE /beta/security/roles/{id} Delete role
get_role GET /beta/security/roles/{id} Get role
get_roles GET /beta/security/roles List roles
update PUT /beta/security/roles/{id} Update role

create

RoleXOResponse create(body)

Create role

Example

from __future__ import print_function
import time
import nexus_api_python_client
from nexus_api_python_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.SecurityManagementRolesApi(api_client)
    body = nexus_api_python_client.RoleXORequest() # RoleXORequest | A role configuration

    try:
        # Create role
        api_response = api_instance.create(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SecurityManagementRolesApi->create: %s\n" % e)

Parameters

Name Type Description Notes
body RoleXORequest A role configuration

Return type

RoleXOResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -
403 Insufficient permissions to create role -

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

delete

delete(id)

Delete role

Example

from __future__ import print_function
import time
import nexus_api_python_client
from nexus_api_python_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.SecurityManagementRolesApi(api_client)
    id = 'id_example' # str | The id of the role to delete

    try:
        # Delete role
        api_instance.delete(id)
    except ApiException as e:
        print("Exception when calling SecurityManagementRolesApi->delete: %s\n" % e)

Parameters

Name Type Description Notes
id str The id of the role to delete

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
403 Insufficient permissions to delete role -
404 Role not found -

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

get_role

RoleXOResponse get_role(id, source=source)

Get role

Example

from __future__ import print_function
import time
import nexus_api_python_client
from nexus_api_python_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.SecurityManagementRolesApi(api_client)
    id = 'id_example' # str | The id of the role to get
source = 'default' # str | 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')

    try:
        # Get role
        api_response = api_instance.get_role(id, source=source)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SecurityManagementRolesApi->get_role: %s\n" % e)

Parameters

Name Type Description Notes
id str The id of the role to get
source str 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']

Return type

RoleXOResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -
400 The specified source does not exist -
403 Insufficient permissions to read roles -
404 Role not found -

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

get_roles

list[RoleXOResponse] get_roles(source=source)

List roles

Example

from __future__ import print_function
import time
import nexus_api_python_client
from nexus_api_python_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.SecurityManagementRolesApi(api_client)
    source = 'source_example' # str | The id of the user source to filter the roles by, if supplied. Otherwise roles from all user sources will be returned. (optional)

    try:
        # List roles
        api_response = api_instance.get_roles(source=source)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SecurityManagementRolesApi->get_roles: %s\n" % e)

Parameters

Name Type Description Notes
source str The id of the user source to filter the roles by, if supplied. Otherwise roles from all user sources will be returned. [optional]

Return type

list[RoleXOResponse]

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -
400 The specified source does not exist -
403 Insufficient permissions to read roles -

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

update

update(id, body)

Update role

Example

from __future__ import print_function
import time
import nexus_api_python_client
from nexus_api_python_client.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with nexus_api_python_client.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = nexus_api_python_client.SecurityManagementRolesApi(api_client)
    id = 'id_example' # str | The id of the role to update
body = nexus_api_python_client.RoleXORequest() # RoleXORequest | A role configuration

    try:
        # Update role
        api_instance.update(id, body)
    except ApiException as e:
        print("Exception when calling SecurityManagementRolesApi->update: %s\n" % e)

Parameters

Name Type Description Notes
id str The id of the role to update
body RoleXORequest A role configuration

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
403 Insufficient permissions to update role -
404 Role not found -

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