Package: jh-client
Jupyter Hub Python ClientAn SDK and API-wrapper for the jupyter hub REST API.API version: 4.0.2Package version: 1.0.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python 3.7+Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallgit+https://github.com/GIT_USER_ID/GIT_REPO_ID.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)Then import the package:importjh_clientSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importjh_clientTestsExecutepytestto run the tests.Getting StartedPlease follow theinstallation procedureand then run the following:importtimeimportjh_clientfromjh_client.restimportApiExceptionfrompprintimportpprint# Defining the host is optional and defaults to /hub/api# See configuration.py for a list of all supported configuration parameters.configuration=jh_client.Configuration(host="/hub/api")# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.configuration.access_token=os.environ["ACCESS_TOKEN"]# Configure API key authorization: tokenconfiguration.api_key['token']=os.environ["API_KEY"]# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['token'] = 'Bearer'# Enter a context with an instance of the API clientwithjh_client.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=jh_client.DefaultApi(api_client)cookie_name='cookie_name_example'# str |cookie_value='cookie_value_example'# str |try:# Identify a user from a cookieapi_response=api_instance.authorizations_cookie_cookie_name_cookie_value_get(cookie_name,cookie_value)print("The response of DefaultApi->authorizations_cookie_cookie_name_cookie_value_get:\n")pprint(api_response)exceptApiExceptionase:print("Exception when calling DefaultApi->authorizations_cookie_cookie_name_cookie_value_get:%s\n"%e)Documentation for API EndpointsAll URIs are relative to/hub/apiClassMethodHTTP requestDescriptionDefaultApiauthorizations_cookie_cookie_name_cookie_value_getGET/authorizations/cookie/{cookie_name}/{cookie_value}Identify a user from a cookieDefaultApiauthorizations_token_postPOST/authorizations/tokenRequest a new API tokenDefaultApiauthorizations_token_token_getGET/authorizations/token/{token}Identify a user or service from an API tokenDefaultApigroups_getGET/groupsList groupsDefaultApigroups_name_deleteDELETE/groups/{name}Delete a groupDefaultApigroups_name_getGET/groups/{name}Get a group by nameDefaultApigroups_name_postPOST/groups/{name}Create a groupDefaultApigroups_name_properties_putPUT/groups/{name}/propertiesSet the group properties.  Added in JupyterHub 3.2.DefaultApigroups_name_users_deleteDELETE/groups/{name}/usersRemove users from a groupDefaultApigroups_name_users_postPOST/groups/{name}/usersAdd users to a groupDefaultApiinfo_getGET/infoGet detailed info about JupyterHubDefaultApioauth2_authorize_getGET/oauth2/authorizeOAuth 2.0 authorize endpointDefaultApioauth2_token_postPOST/oauth2/tokenRequest an OAuth2 tokenDefaultApiproxy_getGET/proxyGet the proxy's routing tableDefaultApiproxy_patchPATCH/proxyNotify the Hub about a new proxyDefaultApiproxy_postPOST/proxyForce the Hub to sync with the proxyDefaultApiroot_getGET/Get JupyterHub versionDefaultApiservices_getGET/servicesList servicesDefaultApiservices_name_getGET/services/{name}Get a service by nameDefaultApishutdown_postPOST/shutdownShutdown the HubDefaultApiuser_getGET/userReturn authenticated user's modelDefaultApiusers_getGET/usersList usersDefaultApiusers_name_activity_postPOST/users/{name}/activityNotify Hub of activity for a given user.DefaultApiusers_name_deleteDELETE/users/{name}Delete a userDefaultApiusers_name_getGET/users/{name}Get a user by nameDefaultApiusers_name_patchPATCH/users/{name}Modify a userDefaultApiusers_name_postPOST/users/{name}Create a single userDefaultApiusers_name_server_deleteDELETE/users/{name}/serverStop a user's serverDefaultApiusers_name_server_postPOST/users/{name}/serverStart a user's single-user notebook serverDefaultApiusers_name_servers_server_name_deleteDELETE/users/{name}/servers/{server_name}Stop a user's named serverDefaultApiusers_name_servers_server_name_postPOST/users/{name}/servers/{server_name}Start a user's single-user named-server notebook serverDefaultApiusers_name_tokens_getGET/users/{name}/tokensList tokens for the userDefaultApiusers_name_tokens_postPOST/users/{name}/tokensCreate a new token for the userDefaultApiusers_name_tokens_token_id_deleteDELETE/users/{name}/tokens/{token_id}Delete (revoke) a token by idDefaultApiusers_name_tokens_token_id_getGET/users/{name}/tokens/{token_id}Get the model for a token by idDefaultApiusers_postPOST/usersCreate multiple usersDocumentation For ModelsAuthorizationsTokenPost200ResponseAuthorizationsTokenPostRequestGet200ResponseGroupGroupsNameUsersPostRequestInfoGet200ResponseInfoGet200ResponseAuthenticatorInfoGet200ResponseSpawnerOauth2TokenPost200ResponseProxyPatchRequestRequestIdentityServerServiceShutdownPostRequestTokenUserUsersNameActivityPostRequestUsersNameActivityPostRequestServersUsersNameActivityPostRequestServersServerNameUsersNamePatchRequestUsersNameTokensPostRequestUsersPostRequestDocumentation For AuthorizationAuthentication schemes defined for the API:tokenType: API keyAPI key parameter name: AuthorizationLocation: HTTP headeroauth2Type: OAuthFlow: accessCodeAuthorization URL:https://hub.example/hub/api/oauth2/authorizeScopes:(no_scope): Identify the owner of the requesting entity.self: The user’s own resources(metascope for users, resolves to (no_scope) for services)inherit: Everything that the token-owning entity can access(metascope for tokens)admin-ui: Access the admin page. Permission to take actions via the admin page granted separately.admin:users: Read, write, create and delete users and their authentication state, not including their servers or tokens.admin:auth_state: Read a user’s authentication state.users: Read and write permissions to user models (excluding servers, tokens and authentication state).delete:users: Delete users.list:users: List users, including at least their names.read:users: Read user models (excluding including servers, tokens and authentication state).read:users:name: Read names of users.read:users:groups: Read users’ group membership.read:users:activity: Read time of last user activity.read:roles: Read role assignments.read:roles:users: Read user role assignments.read:roles:services: Read service role assignments.read:roles:groups: Read group role assignments.users:activity: Update time of last user activity.admin:servers: Read, start, stop, create and delete user servers and their state.admin:server_state: Read and write users’ server state.servers: Start and stop user servers.read:servers: Read users’ names and their server models (excluding the server state).delete:servers: Stop and delete users' servers.tokens: Read, write, create and delete user tokens.read:tokens: Read user tokens.admin:groups: Read and write group information, create and delete groups.groups: Read and write group information, including adding/removing users to/from groups.list:groups: List groups, including at least their names.read:groups: Read group models.read:groups:name: Read group names.delete:groups: Delete groups.list:services: List services, including at least their names.read:services: Read service models.read:services:name: Read service names.read:hub: Read detailed information about the Hub.access:servers: Access user servers via API or browser.access:services: Access services via API or browser.proxy: Read information about the proxy’s routing table, sync the Hub with the proxy and notify the Hub about a new proxy.shutdown: Shutdown the hub.read:metrics: Read prometheus metrics.Author