All URIs are relative to http://localhost/api/v2.0
Method | HTTP request | Description |
---|---|---|
create_user_group | POST /usergroups | Create user group |
delete_user_group | DELETE /usergroups/{group_id} | Delete user group |
get_user_group | GET /usergroups/{group_id} | Get user group information |
list_user_groups | GET /usergroups | Get all user groups information |
search_user_groups | GET /usergroups/search | Search groups by groupname |
update_user_group | PUT /usergroups/{group_id} | Update group information |
create_user_group(x_request_id: Optional[str], usergroup: Optional[UserGroup])-> None
Create user group
Create user group information
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
usergroup = harbor_client.UserGroup() # UserGroup | (optional)
try:
# Create user group
api_instance.create_user_group(x_request_id=x_request_id, usergroup=usergroup)
except ApiException as e:
print("Exception when calling UsergroupApi->create_user_group: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
usergroup | UserGroup | [optional] |
void (empty response body)
delete_user_group(group_id: int, x_request_id: Optional[str])-> None
Delete user group
Delete user group
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
group_id = 56 # int |
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Delete user group
api_instance.delete_user_group(group_id, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling UsergroupApi->delete_user_group: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
group_id | int | ||
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
get_user_group(group_id: int, x_request_id: Optional[str])-> UserGroup
Get user group information
Get user group information
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
group_id = 789 # int | Group ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get user group information
api_response = api_instance.get_user_group(group_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsergroupApi->get_user_group: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
group_id | int | Group ID | |
x_request_id | str | An unique ID for the request | [optional] |
list_user_groups(x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], ldap_group_dn: Optional[str], group_name: Optional[str])-> list[UserGroup]
Get all user groups information
Get all user groups information, it is open for system admin
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
ldap_group_dn = 'ldap_group_dn_example' # str | search with ldap group DN (optional)
group_name = 'group_name_example' # str | group name need to search, fuzzy matches (optional)
try:
# Get all user groups information
api_response = api_instance.list_user_groups(x_request_id=x_request_id, page=page, page_size=page_size, ldap_group_dn=ldap_group_dn, group_name=group_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsergroupApi->list_user_groups: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
page | int | The page number | [optional] [default to 1] |
page_size | int | The size of per page | [optional] [default to 10] |
ldap_group_dn | str | search with ldap group DN | [optional] |
group_name | str | group name need to search, fuzzy matches | [optional] |
search_user_groups(groupname: str, x_request_id: Optional[str], page: Optional[int], page_size: Optional[int])-> list[UserGroupSearchItem]
Search groups by groupname
This endpoint is to search groups by group name. It’s open for all authenticated requests.
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
groupname = 'groupname_example' # str | Group name for filtering results.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
try:
# Search groups by groupname
api_response = api_instance.search_user_groups(groupname, x_request_id=x_request_id, page=page, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsergroupApi->search_user_groups: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
groupname | str | Group name for filtering results. | |
x_request_id | str | An unique ID for the request | [optional] |
page | int | The page number | [optional] [default to 1] |
page_size | int | The size of per page | [optional] [default to 10] |
update_user_group(group_id: int, x_request_id: Optional[str], usergroup: Optional[UserGroup])-> None
Update group information
Update user group information
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.UsergroupApi(harbor_client.ApiClient(configuration))
group_id = 789 # int | Group ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
usergroup = harbor_client.UserGroup() # UserGroup | (optional)
try:
# Update group information
api_instance.update_user_group(group_id, x_request_id=x_request_id, usergroup=usergroup)
except ApiException as e:
print("Exception when calling UsergroupApi->update_user_group: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
group_id | int | Group ID | |
x_request_id | str | An unique ID for the request | [optional] |
usergroup | UserGroup | [optional] |
void (empty response body)