Package: ct-python
ct-pythonConfigTree API definitionsThis Python package is automatically generated by theSwagger Codegenproject:API version: v1Package version: 1.0.3Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegenRequirements.Python 2.7 and 3.4+Installation & Usagepip installIt's recommended to install the SDK from PyPI useing:pipinstallct-pythonYou can also install it directly from Githubpipinstallgit+https://github.com/configtree/ct-python-sdk(you may need to runpipwith root permission:sudo pip install git+https://github.com/configtree/ct-python-sdk)Then import the package:importct_pythonSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importct_pythonGetting StartedPlease follow theinstallation procedureand then you can use the SDK. A sample usage:from__future__importprint_functionimporttimeimportct_pythonfromct_python.restimportApiExceptionfrompprintimportpprint# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Application()# Application |organization_slug='organization_slug_example'# str |try:api_response=api_instance.create_application(body,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->create_application:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Configuration()# Configuration |organization_slug='organization_slug_example'# str |try:api_response=api_instance.create_configuration(body,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->create_configuration:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Environment()# Environment |organization_slug='organization_slug_example'# str |try:api_response=api_instance.create_environment(body,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->create_environment:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Version()# Version |organization_slug='organization_slug_example'# str |try:api_response=api_instance.create_version(body,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->create_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_instance.delete_application(id,organization_slug)exceptApiExceptionase:print("Exception when calling CTApi->delete_application:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_instance.delete_configuration(id,organization_slug)exceptApiExceptionase:print("Exception when calling CTApi->delete_configuration:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_instance.delete_environment(id,organization_slug)exceptApiExceptionase:print("Exception when calling CTApi->delete_environment:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_instance.delete_version(id,organization_slug)exceptApiExceptionase:print("Exception when calling CTApi->delete_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Version()# Version |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.duplicate_version(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->duplicate_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_all_applications(organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_all_applications:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_application_by_id(id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_application_by_id:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_configuration_by_id(id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_configuration_by_id:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_environment_by_id(id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_environment_by_id:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_environment_live_version(id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_environment_live_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))organization_slug='organization_slug_example'# str | The name in all lowercase, suitable for URL identificationtry:api_response=api_instance.get_organization_by_slug(organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_organization_by_slug:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))organization_slug='organization_slug_example'# str |application_name='application_name_example'# str | Application Name (optional)environment_name='environment_name_example'# str | Environment Name (optional)version_name='version_name_example'# str | Version Name (optional)try:api_response=api_instance.get_version(organization_slug,application_name=application_name,environment_name=environment_name,version_name=version_name)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.get_version_by_id(id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->get_version_by_id:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.CustomTokenObtainPair()# CustomTokenObtainPair |try:api_response=api_instance.login(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->login:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Application()# Application |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.partial_update_application(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->partial_update_application:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Configuration()# Configuration |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.partial_update_configuration(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->partial_update_configuration:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Environment()# Environment |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.partial_update_environment(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->partial_update_environment:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Version()# Version |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.partial_update_version(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->partial_update_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.TokenRefresh()# TokenRefresh |try:api_response=api_instance.refresh_token(body)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->refresh_token:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Application()# Application |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.update_application(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->update_application:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Configuration()# Configuration |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.update_configuration(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->update_configuration:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Environment()# Environment |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.update_environment(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->update_environment:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))body=ct_python.Version()# Version |id='id_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.update_version(body,id,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->update_version:%s\n"%e)# Configure API key authorization: Bearerconfiguration=ct_python.Configuration()configuration.api_key['Authorization']='YOUR_API_KEY'configuration.api_key_prefix['Authorization']='Bearer'# create an instance of the API classapi_instance=ct_python.CTApi(ct_python.ApiClient(configuration))file='file_example'# file |ext='ext_example'# str |organization_slug='organization_slug_example'# str |try:api_response=api_instance.upload_configuration_file(file,ext,organization_slug)pprint(api_response)exceptApiExceptionase:print("Exception when calling CTApi->upload_configuration_file:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://api.configtree.co/MethodHTTP requestDescriptioncreate_applicationPOST/v1/{organizationSlug}/applications/create_configurationPOST/v1/{organizationSlug}/configurations/create_environmentPOST/v1/{organizationSlug}/environments/create_versionPOST/v1/{organizationSlug}/versions/delete_applicationDELETE/v1/{organizationSlug}/applications/{id}/delete_configurationDELETE/v1/{organizationSlug}/configurations/{id}/delete_environmentDELETE/v1/{organizationSlug}/environments/{id}/delete_versionDELETE/v1/{organizationSlug}/versions/{id}/duplicate_versionPOST/v1/{organizationSlug}/versions/{id}/duplicate/get_all_applicationsGET/v1/{organizationSlug}/applications/get_application_by_idGET/v1/{organizationSlug}/applications/{id}/get_configuration_by_idGET/v1/{organizationSlug}/configurations/{id}/get_environment_by_idGET/v1/{organizationSlug}/environments/{id}/get_environment_live_versionGET/v1/{organizationSlug}/environments/{id}/liveVersion/get_organization_by_slugGET/v1/{organizationSlug}/get_versionGET/v1/{organizationSlug}/versions/get_version_by_idGET/v1/{organizationSlug}/versions/{id}/loginPOST/v1/login/partial_update_applicationPATCH/v1/{organizationSlug}/applications/{id}/partial_update_configurationPATCH/v1/{organizationSlug}/configurations/{id}/partial_update_environmentPATCH/v1/{organizationSlug}/environments/{id}/partial_update_versionPATCH/v1/{organizationSlug}/versions/{id}/refresh_tokenPOST/v1/login/refresh/update_applicationPUT/v1/{organizationSlug}/applications/{id}/update_configurationPUT/v1/{organizationSlug}/configurations/{id}/update_environmentPUT/v1/{organizationSlug}/environments/{id}/update_versionPUT/v1/{organizationSlug}/versions/{id}/upload_configuration_filePOST/v1/{organizationSlug}/configurations/upload_config/Documentation For ModelsApplicationConfigurationConfigurationFileCustomTokenObtainPairCustomTokenObtainPairResponseEnvironmentOrganizationOrganizationGroupTokenRefreshTokenUserResponseVersionDocumentation For AuthorizationBearerType: API keyAPI key parameter name: AuthorizationLocation: HTTP headerAuthor