Package: noia-sdk
NOIA-SDKNOIA Platform SDK allows you to manage NOIA networks.This Python package is automatically generated by theSwagger Codegenproject:API version: 0.1.0Package version: 0.1.0Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegenRequirements.Python 3.6+Installation & Usagepip installThe latest package can be installed from PyPi:pipinstallnoia-sdkThen import the package:importnoia_sdkGetting StartedPlease follow theinstallation procedureand then run the following:from__future__importprint_functionimporttimeimportnoia_sdkfromnoia_sdk.restimportApiExceptionfrompprintimportpprint# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))code='code_example'# str | Account deletion code (received by mail).try:api_response=api_instance.delete_account(code)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->delete_account:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) | Email verification code (received by mail).try:api_response=api_instance.deprecated_verify_email(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->deprecated_verify_email:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))ip='ip_example'# str |try:api_response=api_instance.geo_ip(ip)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->geo_ip:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.local(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->local:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.pair_latency_test_report(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->pair_latency_test_report:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=[noia_sdk.UserPairLatencyTestReportObject()]# list[UserPairLatencyTestReportObject] |try:api_response=api_instance.pair_latency_test_report_bulk(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->pair_latency_test_report_bulk:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.pair_speedtest_report(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->pair_speedtest_report:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.provider_attach(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->provider_attach:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.provider_detach(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->provider_detach:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.provider_login(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->provider_login:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |attach=noia_sdk.AutoAttach()# AutoAttach |  (optional)try:api_response=api_instance.provider_register(body,attach=attach)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->provider_register:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))refresh_token='refresh_token_example'# str |try:api_response=api_instance.refresh(refresh_token)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->refresh:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |ref=noia_sdk.MailBodyTemplates()# MailBodyTemplates |  (optional)try:api_response=api_instance.register(body,ref=ref)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->register:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.reset_password(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->reset_password:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))ref=noia_sdk.MailBodyTemplates()# MailBodyTemplates |  (optional)try:api_response=api_instance.set_delete_account_code(ref=ref)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->set_delete_account_code:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |ref=noia_sdk.MailBodyTemplates()# MailBodyTemplates |  (optional)try:api_response=api_instance.set_reset_password_code(body,ref=ref)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->set_reset_password_code:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |ref=noia_sdk.MailBodyTemplates()# MailBodyTemplates |  (optional)try:api_response=api_instance.set_verify_email_code(body,ref=ref)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->set_verify_email_code:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.speedtest_report(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->speedtest_report:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))try:api_response=api_instance.user()pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->user:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |ref=noia_sdk.MailBodyTemplates()# MailBodyTemplates |  (optional)try:api_response=api_instance.user_change_email(body,ref=ref)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->user_change_email:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_instance.user_change_password(body)exceptApiExceptionase:print("Exception when calling AuthApi->user_change_password:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_instance.user_destroy(body)exceptApiExceptionase:print("Exception when calling AuthApi->user_destroy:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))body=NULL# dict(str, object) |try:api_response=api_instance.user_hosts_create(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->user_hosts_create:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))id=1.2# float |try:api_response=api_instance.user_hosts_destroy(id)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->user_hosts_destroy:%s\n"%e)# Configure API key authorization: jwtconfiguration=noia_sdk.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Authorization'] = 'Bearer'# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))try:api_response=api_instance.user_hosts_index()pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->user_hosts_index:%s\n"%e)# create an instance of the API classapi_instance=noia_sdk.AuthApi(noia_sdk.ApiClient(configuration))code='code_example'# str | Email verification code (received by mail).try:api_response=api_instance.verify_email(code)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthApi->verify_email:%s\n"%e)Command line tool usageIn order to be able to perform operations with platform API keys, networks, connections or edges you can usenoiactlutility.
First you must set proper environment variables:$exportNOIA_API_SERVER={NOIAAPIURL}$exportNOIA_TOKEN={theAPIauthorizationtoken}In case you have a registered user on the platform you can retrieve the API token using this command(deprecated):$noiactllogin{username}{password}{yourAPIauthorizationtoken}You can omit{password}on the command line, then the utility will ask you to type the password.In case you are using SSO to login to the platform the API authorization token can be retrieved from the Platform itself.Or you can set theNOIA_TOKENenvironment variable like this(SetNOIA_API_SERVERto the server address andNOIA_TOKENto empty value before that):exportNOIA_TOKEN=`noiactllogin{username}{password}`You can learn about the types of actions this utility can perform by running:$noiactl--help
Usage:noiactl[OPTIONS]COMMAND[ARGS]...NOIANETWORKSclitool

Options:--helpShowthismessageandexit.

Commands:configure-networksConfigurenetworksusingaconfigurationYAMLfile.create-api-keyCreateaAPIkeycreate-connectionsCreateconnectionsbetweenendpoints.create-networkCreateanetwork.delete-api-keyDeleteAPIkeyeitherbynameorbyid.delete-connectionDeletesaconnectiondelete-networkDeletesaNOIAnetwork.export-networksExportsexistingnetworkstoconfigurationYAMLfile.get-api-keysListallAPIkeysget-connectionsRetrievesnetworkconnectionsget-endpointsListallendpointsget-networksListallnetworksget-topologyRetrievesnetworkstopologyloginLoginwithusernameandpassword.Exporting and configuring networksIt is possible to export existing networks usingnoiactl export-networkscommand which will output existing networks configuration to stdout
in a YAML format.
This configuration can be passed tonoiactl configure-networks {infrastructure.yaml}to create networks and connections.Below you can find a sample configuration file for different types of networks:---# Create point-to-point connectionsname:interconnect# Network topology is mandaroty. Values: P2P, P2M, MESHtopology:p2p# Network state is mandatory. Values: present, absentstate:presentuse_sdn:false# Connections to createconnections:# Endpoint can be refferred to by name and by idendpoint-1:# state is present by defaultstate:present# type is endpoint by default. Values: endpoint, tag, idtype:endpoint# services specifies what services to enable for given endpointservices:-nginx# id has precedence before name when type is endpointid:123connect_to:endpoint-2:type:endpointservices:-postgre3:connect_to:endpoint-4:type:endpointstate:presenttype:idendpoint-5:connect_to:6:type:idstate:absenttype:endpoint---# Connect mqtt server with iot devicesname:iot-networkstate:presentuse_sdn:falsetopology:p2mconnections:mqtt-server-name.com:type:endpointconnect_to:# Will connect mqtt server with all the endpoints tagged as "iot-devices"iot-devices:state:presenttype:tag---# Create DNS servers mesh networkname:dns-meshstate:presentuse_sdn:truetopology:meshconnections:# Will create a mesh network using endpoints tagged as "dns-servers"dns-servers:state:presenttype:tag---# Delete a networkname:old-iot-networktopology:meshstate:absentDocumentation for API EndpointsAll URIs are relative to/ClassMethodHTTP requestDescriptionAuthApidelete_accountGET/api/auth/delete-account/{code}AuthApideprecated_verify_emailPOST/api/auth/verify-emailAuthApigeo_ipGET/api/auth/{ip}/geoipAuthApilocalPOST/api/auth/local/loginAuthApipair_latency_test_reportPOST/api/auth/pair-latency-test-reportAuthApipair_latency_test_report_bulkPOST/api/auth/pair-latency-test-report/bulkAuthApipair_speedtest_reportPOST/api/auth/pair-speedtest-reportAuthApiprovider_attachPOST/api/auth/provider/attachAuthApiprovider_detachPOST/api/auth/provider/detachAuthApiprovider_loginPOST/api/auth/provider/loginAuthApiprovider_registerPOST/api/auth/provider/registerAuthApirefreshPOST/api/auth/refresh-tokenAuthApiregisterPOST/api/auth/registerAuthApireset_passwordPOST/api/auth/reset-passwordAuthApiset_delete_account_codePOST/api/auth/send-delete-account-linkAuthApiset_reset_password_codePOST/api/auth/send-reset-password-linkAuthApiset_verify_email_codePOST/api/auth/send-verify-email-linkAuthApispeedtest_reportPOST/api/auth/speedtest-reportAuthApiuserGET/api/auth/userAuthApiuser_change_emailPOST/api/auth/user/change-emailAuthApiuser_change_passwordPOST/api/auth/user/change-passwordAuthApiuser_destroyPOST/api/auth/user/deleteAuthApiuser_hosts_createPOST/api/auth/user/hostsAuthApiuser_hosts_destroyDELETE/api/auth/user/hosts/{id}AuthApiuser_hosts_indexGET/api/auth/user/hostsAuthApiverify_emailGET/api/auth/verify-email/{code}PlatformApiconfigGET/api/platform/admin/agent/{agent_id}/configPlatformApicreate_agent_groupPOST/api/platform/network/{network_id}/agent-groups/{group_name}PlatformApicreate_api_keyPOST/api/platform/api-keysPlatformApicreate_connectionsPOST/api/platform/connectionsPlatformApicreate_networkPOST/api/platform/networksPlatformApicreate_network_agentsPOST/api/platform/network/{network_id}/agentsPlatformApidelete_agentsDELETE/api/platform/agents/{agent_id}PlatformApidelete_api_keyDELETE/api/platform/api-keys/{api_key_id}PlatformApidelete_connectionDELETE/api/platform/connections/{connection_id}PlatformApidelete_networksDELETE/api/platform/networks/{network_id}PlatformApidelete_networks_agentDELETE/api/platform/networks/{network_id}/agents/{agent_id}PlatformApifind_all_name_id_pairs_by_user_idGET/api/platform/agents/id-name-pairsPlatformApiget_agent_services_with_subnetsGET/api/platform/agent-servicesPlatformApiget_connection_servicesGET/api/platform/connection-servicesPlatformApiget_network_infoGET/api/platform/network/{network_id}/infoPlatformApiindex_agentsGET/api/platform/agentsPlatformApiindex_api_keyGET/api/platform/api-keysPlatformApiindex_connectionsGET/api/platform/connectionsPlatformApiindex_networksGET/api/platform/networksPlatformApipatch_agentsPATCH/api/platform/agents/{agent_id}PlatformApiremove_agent_groupDELETE/api/platform/network/agent-groups/{group_id}PlatformApiremove_network_agentsDELETE/api/platform/network/{network_id}/agentsPlatformApisave_logs_read_timestampPOST/api/platform/logs-reads-timestampPlatformApitopology_networksGET/api/platform/networks/topologyPlatformApiupdate_agent_groupPUT/api/platform/network/agent-groups/{group_id}PlatformApiupdate_agent_services_subnets_statusPOST/api/platform/agent-services-subnetsPlatformApiupdate_api_keyPATCH/api/platform/api-keys/{api_key_id}PlatformApiupdate_connection_servicesPOST/api/platform/connection-servicesDocumentation For AuthorizationjwtType: API keyAPI key parameter name: AuthorizationLocation: HTTP headerAuthor